From f098a7fa5154f47bb640172a2ad61ed65b39f506 Mon Sep 17 00:00:00 2001 From: Sypsesty Date: Tue, 7 Jan 2025 20:09:59 +0300 Subject: [PATCH] Add Nanochat is nanochat (whatsapp) TODO: -delete all stock trading code (or add stock trading) -figure out why nanochat won't work -idk --- .../UI/AgentIDCardBoundUserInterface.cs | 34 +- .../Access/UI/AgentIDCardWindow.xaml | 15 +- .../Access/UI/AgentIDCardWindow.xaml.cs | 67 ++- .../CartridgeLoader/Cartridges/LogProbeUi.cs | 2 +- .../Cartridges/LogProbeUiFragment.xaml | 28 +- .../Cartridges/LogProbeUiFragment.xaml.cs | 109 +++- .../Cartridges/EditChatPopup.xaml | 53 ++ .../Cartridges/EditChatPopup.xaml.cs | 89 +++ .../Cartridges/NanoChatEntry.xaml | 48 ++ .../Cartridges/NanoChatEntry.xaml.cs | 39 ++ .../Cartridges/NanoChatLogEntry.xaml | 21 + .../Cartridges/NanoChatLogEntry.xaml.cs | 17 + .../Cartridges/NanoChatMessageBubble.xaml | 55 ++ .../Cartridges/NanoChatMessageBubble.xaml.cs | 62 ++ .../CartridgeLoader/Cartridges/NanoChatUi.cs | 43 ++ .../Cartridges/NanoChatUiFragment.xaml | 175 ++++++ .../Cartridges/NanoChatUiFragment.xaml.cs | 289 ++++++++++ .../Cartridges/NewChatPopup.xaml | 52 ++ .../Cartridges/NewChatPopup.xaml.cs | 87 +++ .../DeltaV/NanoChat/NanoChatSystem.cs | 5 + .../Access/Systems/AgentIDCardSystem.cs | 63 +- .../Cartridges/LogProbeCartridgeComponent.cs | 7 + .../Cartridges/LogProbeCartridgeSystem.cs | 16 +- .../LogProbeCartridgeSystem.NanoChat.cs | 82 +++ .../Cartridges/NanoChatCartridgeComponent.cs | 26 + .../Cartridges/NanoChatCartridgeSystem.cs | 541 ++++++++++++++++++ .../DeltaV/NanoChat/NanoChatSystem.cs | 130 +++++ .../Access/SharedAgentIDCardSystem.cs | 24 +- .../Cartridges/LogProbeUiState.cs | 11 +- .../Cartridges/NanoChatUiMessageEvent.cs | 166 ++++++ .../Cartridges/NanoChatUiState.cs | 30 + .../DeltaV/NanoChat/NanoChatCardComponent.cs | 52 ++ .../DeltaV/NanoChat/SharedNanoChatSystem.cs | 275 +++++++++ .../components/agent-id-card-component.ftl | 1 + .../deltav/cartridge-loader/cartridges.ftl | 83 ++- .../components/nanochat-card-component.ftl | 7 + .../Entities/Objects/Devices/cartridges.yml | 45 ++ .../DeltaV/Entities/Objects/Devices/pda.yml | 41 ++ .../DeltaV/name_identifier_groups.yml | 4 + .../Entities/Objects/Devices/pda.yml | 156 +++-- .../Objects/Misc/identification_cards.yml | 144 ++--- .../Entities/Objects/Devices/pda.yml | 3 + .../Interface/VerbIcons/ATTRIBUTION.txt | 2 + .../DeltaV/Interface/VerbIcons/bell.svg | 5 + .../DeltaV/Interface/VerbIcons/bell.svg.png | Bin 0 -> 720 bytes .../DeltaV/Interface/VerbIcons/bell_muted.png | Bin 0 -> 355 bytes .../DeltaV/Misc/program_icons.rsi/meta.json | 17 + .../Misc/program_icons.rsi/nanochat.png | Bin 0 -> 725 bytes .../Misc/program_icons.rsi/stock_trading.png | Bin 0 -> 1012 bytes .../Devices/cartridge.rsi/cart-chat.png | Bin 0 -> 419 bytes .../Objects/Devices/cartridge.rsi/meta.json | 8 +- 51 files changed, 3023 insertions(+), 206 deletions(-) create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/EditChatPopup.xaml create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/EditChatPopup.xaml.cs create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NanoChatEntry.xaml create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NanoChatEntry.xaml.cs create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NanoChatLogEntry.xaml create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NanoChatLogEntry.xaml.cs create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NanoChatMessageBubble.xaml create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NanoChatMessageBubble.xaml.cs create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NanoChatUi.cs create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NanoChatUiFragment.xaml create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NanoChatUiFragment.xaml.cs create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NewChatPopup.xaml create mode 100644 Content.Client/DeltaV/CartridgeLoader/Cartridges/NewChatPopup.xaml.cs create mode 100644 Content.Client/DeltaV/NanoChat/NanoChatSystem.cs create mode 100644 Content.Server/DeltaV/CartridgeLoader/Cartridges/LogProbeCartridgeSystem.NanoChat.cs create mode 100644 Content.Server/DeltaV/CartridgeLoader/Cartridges/NanoChatCartridgeComponent.cs create mode 100644 Content.Server/DeltaV/CartridgeLoader/Cartridges/NanoChatCartridgeSystem.cs create mode 100644 Content.Server/DeltaV/NanoChat/NanoChatSystem.cs create mode 100644 Content.Shared/DeltaV/CartridgeLoader/Cartridges/NanoChatUiMessageEvent.cs create mode 100644 Content.Shared/DeltaV/CartridgeLoader/Cartridges/NanoChatUiState.cs create mode 100644 Content.Shared/DeltaV/NanoChat/NanoChatCardComponent.cs create mode 100644 Content.Shared/DeltaV/NanoChat/SharedNanoChatSystem.cs create mode 100644 Resources/Locale/en-US/deltav/access/components/agent-id-card-component.ftl create mode 100644 Resources/Locale/en-US/deltav/nanochat/components/nanochat-card-component.ftl create mode 100644 Resources/Prototypes/DeltaV/name_identifier_groups.yml create mode 100644 Resources/Textures/DeltaV/Interface/VerbIcons/ATTRIBUTION.txt create mode 100644 Resources/Textures/DeltaV/Interface/VerbIcons/bell.svg create mode 100644 Resources/Textures/DeltaV/Interface/VerbIcons/bell.svg.png create mode 100644 Resources/Textures/DeltaV/Interface/VerbIcons/bell_muted.png create mode 100644 Resources/Textures/DeltaV/Misc/program_icons.rsi/meta.json create mode 100644 Resources/Textures/DeltaV/Misc/program_icons.rsi/nanochat.png create mode 100644 Resources/Textures/DeltaV/Misc/program_icons.rsi/stock_trading.png create mode 100644 Resources/Textures/DeltaV/Objects/Devices/cartridge.rsi/cart-chat.png diff --git a/Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs b/Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs index c3fac8cb92a..09724f14a2c 100644 --- a/Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs +++ b/Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs @@ -1,5 +1,9 @@ using Content.Shared.Access.Systems; +using Content.Shared.StatusIcon; using Robust.Client.GameObjects; +using Robust.Client.UserInterface; +using Robust.Shared.Prototypes; +using Robust.Shared.Prototypes; namespace Content.Client.Access.UI { @@ -18,16 +22,18 @@ protected override void Open() { base.Open(); - _window?.Dispose(); - _window = new AgentIDCardWindow(this); - if (State != null) - UpdateState(State); + _window = this.CreateWindow(); - _window.OpenCentered(); - - _window.OnClose += Close; _window.OnNameChanged += OnNameChanged; _window.OnJobChanged += OnJobChanged; + _window.OnJobIconChanged += OnJobIconChanged; + _window.OnNumberChanged += OnNumberChanged; // DeltaV + } + + // DeltaV - Add number change handler + private void OnNumberChanged(uint newNumber) + { + SendMessage(new AgentIDCardNumberChangedMessage(newNumber)); } private void OnNameChanged(string newName) @@ -40,7 +46,7 @@ private void OnJobChanged(string newJob) SendMessage(new AgentIDCardJobChangedMessage(newJob)); } - public void OnJobIconChanged(string newJobIconId) + public void OnJobIconChanged(ProtoId newJobIconId) { SendMessage(new AgentIDCardJobIconChangedMessage(newJobIconId)); } @@ -57,16 +63,8 @@ protected override void UpdateState(BoundUserInterfaceState state) _window.SetCurrentName(cast.CurrentName); _window.SetCurrentJob(cast.CurrentJob); - _window.SetAllowedIcons(cast.Icons, cast.CurrentJobIconId); - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - if (!disposing) - return; - - _window?.Dispose(); + _window.SetAllowedIcons(cast.CurrentJobIconId); + _window.SetCurrentNumber(cast.CurrentNumber); // DeltaV } } } diff --git a/Content.Client/Access/UI/AgentIDCardWindow.xaml b/Content.Client/Access/UI/AgentIDCardWindow.xaml index 89de793714d..a2ddd1c417d 100644 --- a/Content.Client/Access/UI/AgentIDCardWindow.xaml +++ b/Content.Client/Access/UI/AgentIDCardWindow.xaml @@ -6,12 +6,13 @@