Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #1694

Closed
wants to merge 51 commits into from
Closed

update #1694

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
002fdf5
Replaced old posters by Sh18RW's.
Jul 8, 2023
afbe218
Moved sprite
Jul 8, 2023
a5caa96
Added locale without renaming locale names.
Jul 8, 2023
afeb01d
Removed mention of NT
Jul 8, 2023
cb9acb7
Fixed wrong word
Jul 8, 2023
4735842
Merge pull request #1 from Sh18RW/indev
u9djfgoj Jul 8, 2023
169a3df
Add new files for space station
Jul 8, 2023
3b0e2e8
Merge branch 'master' of https://github.com/u9djfgoj/space-station-ussp
Jul 8, 2023
aadef94
Описание изменений
u9djfgoj Jul 9, 2023
d08dce5
Merge branch 'master' of https://github.com/u9djfgoj/space-station-ussp
u9djfgoj Jul 9, 2023
66bfd3f
Revert "Merge branch 'master' of https://github.com/u9djfgoj/space-st…
u9djfgoj Jul 9, 2023
dfa215e
Описание изменений
u9djfgoj Jul 9, 2023
71cf7cd
Merge branch 'master' of https://github.com/u9djfgoj/space-station-ussp
u9djfgoj Jul 9, 2023
e71aaf3
Revert "Описание изменений"
u9djfgoj Jul 9, 2023
aa5d302
Replaced posters by new
Jul 9, 2023
7a89010
Replaced a poster5_legit.png
Jul 9, 2023
d0c3a3b
Added locale for new posters
Jul 9, 2023
0c8ddc8
Fixed misspell
Jul 9, 2023
96f0375
Added USSP soap texture
Jul 9, 2023
9b615f5
Added USSP soap
Jul 9, 2023
e813164
Replaced NT soap to USSP
Jul 9, 2023
8e5ec3d
Added USSP cloak
Jul 9, 2023
505aabc
Added doshirak
Jul 9, 2023
7373d2d
Refactor ramen to doshirak
Jul 9, 2023
fdf592c
Refactor ramen to doshirak
Jul 9, 2023
7d8bcb5
Changed botany instruments
Jul 9, 2023
7cd9c71
Added USSP cloak icon
Jul 9, 2023
c2b1589
Added hell doshirak icon
Jul 9, 2023
99f9115
Added USSP soup inhand textures
Jul 9, 2023
bf58301
Fixed naming
Jul 9, 2023
f64182e
Added dashirak opening sound (maybe loud)
Jul 9, 2023
9a1c366
Replaced plastic container opening by less loudly
Jul 10, 2023
14b6341
Merge pull request #2 from Sh18RW/indev
u9djfgoj Jul 13, 2023
f2b2a69
tts + ears and tails
u9djfgoj Jul 16, 2023
8ba7373
Merge branch 'master' of https://github.com/u9djfgoj/space-station-ussp
u9djfgoj Jul 16, 2023
79249ea
Update CCCVars.cs
u9djfgoj Jul 16, 2023
ce7735d
I forgot to do normal commits :(
Jul 31, 2023
d215c0d
Made full UI for document copier
Aug 1, 2023
631d53b
Made copying logic
Aug 1, 2023
3ab75b6
Remake printing logic to queue and added fax animation with sound
Aug 1, 2023
dac40e9
Added localization
Aug 1, 2023
f1651f2
Cosmetic work
Aug 1, 2023
bd6cb6a
Merge branch 'u9djfgoj:master' into indev
Sh18RW Aug 1, 2023
56502ad
Some changes in README.md
Aug 1, 2023
81952eb
Added document copier board
Sh18RW Aug 2, 2023
cafc664
Moved document copier board from computers to electronics
Sh18RW Aug 2, 2023
da77fd2
Added to researches document copier board
Sh18RW Aug 2, 2023
13f7d0c
now you can print document copier board
Sh18RW Aug 2, 2023
673e368
Added localiztion
Sh18RW Aug 2, 2023
63b23f9
Added admin stamps
Sh18RW Aug 2, 2023
940cc5f
Merge pull request #3 from Sh18RW/indev
u9djfgoj Aug 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Content.Client/Content.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<Compile Update="UserInterface\Systems\Inventory\Windows\StrippingWindow.xaml.cs">
<DependentUpon>StrippingWindow.xaml</DependentUpon>
</Compile>
<Compile Update="DocumentCopier\UI\DocumentCopierWindow.xaml.cs">
<DependentUpon>DocumentCopierWindow.xaml</DependentUpon>
</Compile>
</ItemGroup>

<Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
Expand Down
66 changes: 66 additions & 0 deletions Content.Client/DocumentCopier/UI/DocumentCopierBoundUi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using Content.Client.Fax.UI;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.DocumentCopier;
using Content.Shared.Fax;
using JetBrains.Annotations;
using Robust.Client.GameObjects;

namespace Content.Client.DocumentCopier.UI;

[UsedImplicitly]
public sealed class DocumentCopierBoundUi : BoundUserInterface
{
public static string SourceDocumentSlotId = "targetSheet";
public static string TargetDocumentSlotId = "sourceSheet";

private DocumentCopierWindow? _window;

public DocumentCopierBoundUi(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();

_window = new DocumentCopierWindow();
_window.OpenCentered();

_window.OnClose += Close;
_window.PrintButtonPressed += OnPrintButtonPressed;
_window.SourceDocumentButtonPressed += OnSourceDocumentButtonPressed;
_window.TargetDocumentButtonPressed += OnTargetDocumentButtonPressed;
}

private void OnSourceDocumentButtonPressed()
{
SendMessage(new ItemSlotButtonPressedEvent(SourceDocumentSlotId));
}

private void OnTargetDocumentButtonPressed()
{
SendMessage(new ItemSlotButtonPressedEvent(TargetDocumentSlotId));
}

private void OnPrintButtonPressed()
{
SendMessage(new DocumentCopierPrintMessage());
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

if (_window == null || state is not DocumentCopierUiState cast)
return;

_window.UpdateState(cast);
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing)
_window?.Dispose();
}
}
25 changes: 25 additions & 0 deletions Content.Client/DocumentCopier/UI/DocumentCopierWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<DefaultWindow xmlns="https://spacestation14.io"
Title="{Loc 'document-copier-name'}"
MinWidth="250">
<BoxContainer Orientation="Vertical" VerticalExpand="True">
<BoxContainer Orientation="Horizontal" VerticalExpand="True">
<BoxContainer Orientation="Vertical" MinWidth="100">
<Label Text="{Loc 'document-copier-ui-source-document'}"/>
<Label Text="{Loc 'document-copier-ui-target-document'}"/>
</BoxContainer>
<Control MinWidth="50" />
<BoxContainer Orientation="Vertical" MinWidth="100">
<Button Name="SourceDocumentControl"
Text="{Loc 'document-copier-ui-insert-document'}"/>
<Button Name="TargetDocumentControl"
Text="{Loc 'document-copier-ui-insert-document'}"/>
</BoxContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Control MinWidth="150" />
<Button Name="PrintButton"
Text="{Loc 'document-copier-ui-print-document'}"
Disabled="True"/>
</BoxContainer>
</BoxContainer>
</DefaultWindow>
40 changes: 40 additions & 0 deletions Content.Client/DocumentCopier/UI/DocumentCopierWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Content.Shared.DocumentCopier;
using Content.Shared.Fax;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.DocumentCopier.UI;

[GenerateTypedNameReferences]
public sealed partial class DocumentCopierWindow : DefaultWindow
{
public event Action? SourceDocumentButtonPressed;
public event Action? TargetDocumentButtonPressed;
public event Action? PrintButtonPressed;

public DocumentCopierWindow()
{
RobustXamlLoader.Load(this);

PrintButton.OnPressed += _ => PrintButtonPressed?.Invoke();
SourceDocumentControl.OnPressed += _ => SourceDocumentButtonPressed?.Invoke();
TargetDocumentControl.OnPressed += _ => TargetDocumentButtonPressed?.Invoke();
}

public void UpdateState(DocumentCopierUiState state)
{
SetButtonText(SourceDocumentControl, state.IsSourceDocumentInserted);
SetButtonText(TargetDocumentControl, state.IsTargetDocumentInserted);

PrintButton.Disabled = !state.IsCanPrintDocument;

void SetButtonText(Button target, bool buttonState)
{
target.Text = buttonState
? Loc.GetString("document-copier-ui-eject-document")
: Loc.GetString("document-copier-ui-insert-document");
}
}
}
87 changes: 87 additions & 0 deletions Content.Server/DocumentCopier/DocumentCopierComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using Content.Server.Paper;
using Content.Shared.Containers.ItemSlots;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Server.DocumentCopier;

[RegisterComponent]
public sealed class DocumentCopierComponent : Component
{
/// <summary>
/// Contains the paper to copy document to it
/// </summary>
[DataField("targetSheet", required: false)]
public ItemSlot TargetSheet = new();

/// <summary>
/// Contains the document to copy to blank sheet
/// </summary>
[DataField("sourceSheet", required: false)]
public ItemSlot SourceSheet = new();

/// <summary>
/// Sound to play when copier printing a copy
/// </summary>
[DataField("printSound", required: false)]
public SoundSpecifier PrintSound = new SoundPathSpecifier("/Audio/Machines/printer.ogg");

/// <summary>
/// Print queue of the incoming message
/// </summary>
[ViewVariables]
[DataField("printingQueue")]
public Queue<DocumentCopierPrintout> PrintingQueue { get; } = new();

/// <summary>
/// Remaining time of inserting animation
/// </summary>
[DataField("insertingTimeRemaining")]
public float InsertingTimeRemaining;

/// <summary>
/// How long the inserting animation will play
/// </summary>
[ViewVariables]
public float InsertionTime = 1.88f; // 0.02 off for correct animation

/// <summary>
/// Remaining time of printing animation
/// </summary>
[DataField("printingTimeRemaining")]
public float PrintingTimeRemaining;

/// <summary>
/// How long the printing animation will play
/// </summary>
[ViewVariables]
public float PrintingTime = 2.3f;
}

public sealed class DocumentCopierPrintout
{
[DataField("name", required: true)]
public string Name { get; }

[DataField("content", required: true)]
public string Content { get; }

[DataField("prototypeId", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>), required: true)]
public string PrototypeId { get; set; }

[DataField("stampState")]
public string? StampState { get; set; }

[DataField("stampedBy")]
public List<string> StampedBy { get; }

public DocumentCopierPrintout(string content, string name, string? prototypeId = null, string? stampState = null, List<string>? stampedBy = null)
{
Content = content;
Name = name;
PrototypeId = prototypeId ?? "";
StampState = stampState;
StampedBy = stampedBy ?? new List<string>();
}
}
Loading
Loading