diff --git a/Content.Client/DeltaV/CartridgeLoader/Cartridges/CrimeAssistUi.cs b/Content.Client/DeltaV/CartridgeLoader/Cartridges/CrimeAssistUi.cs index 2dbe923b2a6..ea5aa3cf256 100644 --- a/Content.Client/DeltaV/CartridgeLoader/Cartridges/CrimeAssistUi.cs +++ b/Content.Client/DeltaV/CartridgeLoader/Cartridges/CrimeAssistUi.cs @@ -18,6 +18,15 @@ public override Control GetUIFragmentRoot() public override void Setup(BoundUserInterface userInterface, EntityUid? fragmentOwner) { _fragment = new CrimeAssistUiFragment(); + + _fragment.OnSync += _ => SendSyncMessage(userInterface); + } + + private void SendSyncMessage(BoundUserInterface userInterface) + { + var syncMessage = new CrimeAssistSyncMessageEvent(); + var message = new CartridgeUiMessage(syncMessage); + userInterface.SendMessage(message); } public override void UpdateState(BoundUserInterfaceState state) diff --git a/Content.Client/DeltaV/CartridgeLoader/Cartridges/CrimeAssistUiFragment.xaml.cs b/Content.Client/DeltaV/CartridgeLoader/Cartridges/CrimeAssistUiFragment.xaml.cs index fb085a8a799..e3163975d12 100644 --- a/Content.Client/DeltaV/CartridgeLoader/Cartridges/CrimeAssistUiFragment.xaml.cs +++ b/Content.Client/DeltaV/CartridgeLoader/Cartridges/CrimeAssistUiFragment.xaml.cs @@ -1,6 +1,7 @@ using Content.Client.Message; using Content.Shared.DeltaV.CartridgeLoader.Cartridges; using Robust.Client.AutoGenerated; +using Robust.Client.ResourceManagement; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; using Robust.Shared.Prototypes; @@ -12,7 +13,9 @@ namespace Content.Client.DeltaV.CartridgeLoader.Cartridges; public sealed partial class CrimeAssistUiFragment : BoxContainer { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; + public event Action? OnSync; private CrimeAssistPage _currentPage; private List? _pages; diff --git a/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchEntryControl.xaml b/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchEntryControl.xaml deleted file mode 100644 index 2de8a37ff77..00000000000 --- a/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchEntryControl.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - diff --git a/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchEntryControl.xaml.cs b/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchEntryControl.xaml.cs deleted file mode 100644 index e8dd4eea446..00000000000 --- a/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchEntryControl.xaml.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Content.Shared.CartridgeLoader.Cartridges; -using Robust.Client.AutoGenerated; -using Robust.Client.UserInterface; -using Robust.Client.UserInterface.Controls; -using Robust.Client.UserInterface.XAML; - -namespace Content.Client.DeltaV.CartridgeLoader.Cartridges; - -[GenerateTypedNameReferences] -public sealed partial class SecWatchEntryControl : BoxContainer -{ - public SecWatchEntryControl(SecWatchEntry entry) - { - RobustXamlLoader.Load(this); - - Status.Text = Loc.GetString($"criminal-records-status-{entry.Status.ToString().ToLower()}"); - Title.Text = Loc.GetString("sec-watch-entry", ("name", entry.Name), ("job", entry.Job)); - - Reason.Text = entry.Reason ?? Loc.GetString("sec-watch-no-reason"); - } -} diff --git a/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchUi.cs b/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchUi.cs deleted file mode 100644 index da5ff825b91..00000000000 --- a/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchUi.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Content.Client.UserInterface.Fragments; -using Content.Shared.CartridgeLoader; -using Content.Shared.CartridgeLoader.Cartridges; -using Robust.Client.UserInterface; - -namespace Content.Client.DeltaV.CartridgeLoader.Cartridges; - -public sealed partial class SecWatchUi : UIFragment -{ - private SecWatchUiFragment? _fragment; - - public override Control GetUIFragmentRoot() - { - return _fragment!; - } - - public override void Setup(BoundUserInterface ui, EntityUid? owner) - { - _fragment = new SecWatchUiFragment(); - } - - public override void UpdateState(BoundUserInterfaceState state) - { - if (state is SecWatchUiState cast) - _fragment?.UpdateState(cast); - } -} diff --git a/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchUiFragment.xaml b/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchUiFragment.xaml deleted file mode 100644 index 7fb2c42debc..00000000000 --- a/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchUiFragment.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - diff --git a/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchUiFragment.xaml.cs b/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchUiFragment.xaml.cs deleted file mode 100644 index ad152840529..00000000000 --- a/Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchUiFragment.xaml.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Content.Shared.CartridgeLoader.Cartridges; -using Robust.Client.AutoGenerated; -using Robust.Client.UserInterface.Controls; -using Robust.Client.UserInterface.XAML; - -namespace Content.Client.DeltaV.CartridgeLoader.Cartridges; - -[GenerateTypedNameReferences] -public sealed partial class SecWatchUiFragment : BoxContainer -{ - public SecWatchUiFragment() - { - RobustXamlLoader.Load(this); - } - - public void UpdateState(SecWatchUiState state) - { - NoEntries.Visible = state.Entries.Count == 0; - Entries.RemoveAllChildren(); - foreach (var entry in state.Entries) - { - Entries.AddChild(new SecWatchEntryControl(entry)); - } - } -} diff --git a/Content.Client/Psionics/GlimmerMonitor/GlimmerMonitorUi.cs b/Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUi.cs similarity index 92% rename from Content.Client/Psionics/GlimmerMonitor/GlimmerMonitorUi.cs rename to Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUi.cs index 0d8accb9f86..0b5fc7ad38c 100644 --- a/Content.Client/Psionics/GlimmerMonitor/GlimmerMonitorUi.cs +++ b/Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUi.cs @@ -1,11 +1,10 @@ using Robust.Client.GameObjects; using Robust.Client.UserInterface; -using Content.Client.Psionics.UI; using Content.Client.UserInterface.Fragments; using Content.Shared.CartridgeLoader.Cartridges; using Content.Shared.CartridgeLoader; -namespace Content.Client.Psionics.GlimmerMonitor; +namespace Content.Client.Nyanotrasen.CartridgeLoader.Cartridges; public sealed partial class GlimmerMonitorUi : UIFragment { diff --git a/Content.Client/Psionics/GlimmerMonitor/GlimmerMonitorUiFragment.xaml b/Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUiFragment.xaml similarity index 87% rename from Content.Client/Psionics/GlimmerMonitor/GlimmerMonitorUiFragment.xaml rename to Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUiFragment.xaml index ade0720696b..119a1831e6e 100644 --- a/Content.Client/Psionics/GlimmerMonitor/GlimmerMonitorUiFragment.xaml +++ b/Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUiFragment.xaml @@ -1,9 +1,8 @@ -