]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Content update for UI prediction (#27214)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fri, 26 Apr 2024 08:16:24 +0000 (18:16 +1000)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2024 08:16:24 +0000 (18:16 +1000)
* Content update for UI refactor

* Big update

* Sharing

* Remaining content updates

* First big update

* Prototype updates

* AUGH

* Fix UI comp ref

* Cleanup

- Fix predicted message, fix item slots, fix interaction range check.

* Fix regressions

* Make this predictive

idk why it wasn't.

* Fix slime merge

* Merge conflict

* Fix merge

279 files changed:
Content.Client/Administration/Components/HeadstandComponent.cs
Content.Client/Administration/Components/KillSignComponent.cs
Content.Client/Audio/Jukebox/JukeboxSystem.cs
Content.Client/Extinguisher/FireExtinguisherComponent.cs
Content.Client/PDA/PdaBoundUserInterface.cs
Content.Client/Paper/PaperComponent.cs
Content.Client/Power/ActivatableUIRequiresPowerSystem.cs [new file with mode: 0644]
Content.Client/Storage/StorageBoundUserInterface.cs
Content.Client/Storage/Systems/StorageSystem.cs
Content.Client/Strip/StrippableSystem.cs
Content.Client/UserInterface/Systems/Storage/StorageUIController.cs
Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs
Content.IntegrationTests/Tests/Power/PowerTest.cs
Content.Server/Access/Systems/AccessOverriderSystem.cs
Content.Server/Access/Systems/AgentIDCardSystem.cs
Content.Server/Access/Systems/IdCardConsoleSystem.cs
Content.Server/Administration/Components/HeadstandComponent.cs
Content.Server/Administration/Components/KillSignComponent.cs
Content.Server/Administration/Systems/AdminVerbSystem.cs
Content.Server/Advertise/EntitySystems/SpeakOnUIClosedSystem.cs
Content.Server/Ame/EntitySystems/AmeControllerSystem.cs
Content.Server/Anomaly/AnomalySystem.Generator.cs
Content.Server/Anomaly/AnomalySystem.Scanner.cs
Content.Server/Arcade/BlockGame/BlockGame.Ui.cs
Content.Server/Arcade/BlockGame/BlockGame.cs
Content.Server/Arcade/BlockGame/BlockGameArcadeComponent.cs
Content.Server/Arcade/BlockGame/BlockGameArcadeSystem.cs
Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs
Content.Server/Arcade/SpaceVillainGame/SpaceVillainGame.Ui.cs
Content.Server/Atmos/EntitySystems/GasAnalyzerSystem.cs
Content.Server/Atmos/EntitySystems/GasTankSystem.cs
Content.Server/Atmos/Monitor/Components/AirAlarmComponent.cs
Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs
Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs
Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs
Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs
Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs
Content.Server/Atmos/Portable/SpaceHeaterSystem.cs
Content.Server/Audio/Jukebox/JukeboxSystem.cs
Content.Server/Bed/Cryostorage/CryostorageSystem.cs
Content.Server/Cargo/Systems/CargoSystem.Bounty.cs
Content.Server/Cargo/Systems/CargoSystem.Orders.cs
Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs
Content.Server/CartridgeLoader/CartridgeLoaderSystem.cs
Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs
Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs
Content.Server/Cloning/CloningConsoleSystem.cs
Content.Server/Clothing/Systems/ChameleonClothingSystem.cs
Content.Server/Communications/CommunicationsConsoleSystem.cs
Content.Server/Configurable/ConfigurationSystem.cs
Content.Server/Crayon/CrayonSystem.cs
Content.Server/CrewManifest/CrewManifestSystem.cs
Content.Server/CriminalRecords/Systems/CriminalRecordsConsoleSystem.cs
Content.Server/DeviceLinking/Systems/SignalTimerSystem.cs
Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs
Content.Server/Disposal/Mailing/MailingUnitSystem.cs
Content.Server/Disposal/Tube/DisposalTubeSystem.cs
Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs
Content.Server/Doors/Electronics/Systems/DoorElectronicsSystem.cs
Content.Server/Extinguisher/FireExtinguisherComponent.cs
Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs
Content.Server/Fax/FaxSystem.cs
Content.Server/Forensics/Systems/ForensicScannerSystem.cs
Content.Server/Gateway/Systems/GatewaySystem.cs
Content.Server/Gravity/GravityGeneratorSystem.cs
Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.Modifier.cs
Content.Server/Instruments/InstrumentComponent.cs
Content.Server/Instruments/InstrumentSystem.cs
Content.Server/Interaction/InteractionSystem.cs
Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs
Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs
Content.Server/Labels/Label/HandLabelerSystem.cs
Content.Server/Lathe/LatheSystem.cs
Content.Server/Lock/EntitySystems/ActivatableUIRequiresLockSystem.cs
Content.Server/MagicMirror/MagicMirrorSystem.cs
Content.Server/MassMedia/Systems/NewsSystem.cs
Content.Server/Mech/Systems/MechSystem.cs
Content.Server/Medical/CrewMonitoring/CrewMonitoringConsoleSystem.cs
Content.Server/Medical/CryoPodSystem.cs
Content.Server/Medical/HealthAnalyzerSystem.cs
Content.Server/Nuke/NukeSystem.cs
Content.Server/NukeOps/WarDeclaratorSystem.cs
Content.Server/PAI/PAISystem.cs
Content.Server/PDA/PdaSystem.cs
Content.Server/PDA/Ringer/RingerSystem.cs
Content.Server/Paper/PaperComponent.cs
Content.Server/Paper/PaperSystem.cs
Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs
Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.Parts.cs
Content.Server/ParticleAccelerator/Wires/ParticleAcceleratorLimiterWireAction.cs
Content.Server/ParticleAccelerator/Wires/ParticleAcceleratorStrengthWireAction.cs
Content.Server/ParticleAccelerator/Wires/ParticleAcceleratorToggleWireAction.cs
Content.Server/Pinpointer/NavMapSystem.cs
Content.Server/Pinpointer/StationMapSystem.cs
Content.Server/Power/Components/ActivatableUIRequiresPowerComponent.cs [deleted file]
Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs
Content.Server/Power/EntitySystems/ApcSystem.cs
Content.Server/Power/EntitySystems/PowerMonitoringConsoleSystem.cs
Content.Server/Power/Generator/PortableGeneratorSystem.cs
Content.Server/PowerCell/PowerCellSystem.cs
Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs
Content.Server/Research/Systems/ResearchSystem.Client.cs
Content.Server/Research/Systems/ResearchSystem.Console.cs
Content.Server/Research/TechnologyDisk/Systems/DiskConsoleSystem.cs
Content.Server/Salvage/SalvageSystem.ExpeditionConsole.cs
Content.Server/Salvage/SalvageSystem.Magnet.cs
Content.Server/SensorMonitoring/SensorMonitoringConsoleComponent.cs
Content.Server/SensorMonitoring/SensorMonitoringConsoleSystem.UI.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs
Content.Server/Shuttles/Systems/RadarConsoleSystem.cs
Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs
Content.Server/Shuttles/Systems/ShuttleSystem.IFF.cs
Content.Server/Silicons/Borgs/BorgSystem.Ui.cs
Content.Server/Silicons/Laws/SiliconLawSystem.cs
Content.Server/Solar/EntitySystems/PowerSolarControlConsoleSystem.cs
Content.Server/StationRecords/Systems/GeneralStationRecordConsoleSystem.cs
Content.Server/Storage/EntitySystems/StorageSystem.cs
Content.Server/Store/Systems/StoreSystem.Ui.cs
Content.Server/Store/Systems/StoreSystem.cs
Content.Server/Strip/StrippableSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMonitorSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraRouterSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs
Content.Server/Thief/Systems/ThiefUndeterminedBackpackSystem.cs
Content.Server/UserInterface/IntrinsicUIComponent.cs
Content.Server/UserInterface/IntrinsicUISystem.cs
Content.Server/VendingMachines/VendingMachineSystem.cs
Content.Server/VoiceMask/VoiceMaskSystem.cs
Content.Server/Wires/WiresSystem.cs
Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs
Content.Shared/Administration/Components/SharedHeadstandComponent.cs
Content.Shared/Administration/Components/SharedKillSignComponent.cs
Content.Shared/Chemistry/EntitySystems/SolutionTransferSystem.cs
Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs
Content.Shared/Content.Shared.csproj
Content.Shared/Extinguisher/SharedFireExtinguisherComponent.cs
Content.Shared/Interaction/SharedInteractionSystem.cs
Content.Shared/Paper/SharedPaperComponent.cs
Content.Shared/Power/Components/ActivatableUIRequiresPowerComponent.cs [new file with mode: 0644]
Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs
Content.Shared/Storage/StorageComponent.cs
Content.Shared/UserInterface/ActivatableUIComponent.cs [moved from Content.Server/UserInterface/ActivatableUIComponent.cs with 87% similarity]
Content.Shared/UserInterface/ActivatableUIEvents.cs
Content.Shared/UserInterface/ActivatableUIRequiresPowerCellComponent.cs [moved from Content.Server/UserInterface/ActivatableUIRequiresPowerCellComponent.cs with 65% similarity]
Content.Shared/UserInterface/ActivatableUISystem.Power.cs [moved from Content.Server/UserInterface/ActivatableUISystem.Power.cs with 82% similarity]
Content.Shared/UserInterface/ActivatableUISystem.cs [moved from Content.Server/UserInterface/ActivatableUISystem.cs with 81% similarity]
Resources/Prototypes/Catalog/Fills/Paper/manuals.yml
Resources/Prototypes/Entities/Clothing/Back/backpacks.yml
Resources/Prototypes/Entities/Clothing/Back/specific.yml
Resources/Prototypes/Entities/Clothing/Belt/base_clothingbelt.yml
Resources/Prototypes/Entities/Clothing/Ears/specific.yml
Resources/Prototypes/Entities/Clothing/Eyes/specific.yml
Resources/Prototypes/Entities/Clothing/Hands/gloves.yml
Resources/Prototypes/Entities/Clothing/Hands/specific.yml
Resources/Prototypes/Entities/Clothing/Head/hats.yml
Resources/Prototypes/Entities/Clothing/Head/specific.yml
Resources/Prototypes/Entities/Clothing/Masks/specific.yml
Resources/Prototypes/Entities/Clothing/Neck/specific.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/base_clothingouter.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/specific.yml
Resources/Prototypes/Entities/Clothing/Shoes/magboots.yml
Resources/Prototypes/Entities/Clothing/Shoes/specific.yml
Resources/Prototypes/Entities/Clothing/Uniforms/specific.yml
Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml
Resources/Prototypes/Entities/Mobs/NPCs/animals.yml
Resources/Prototypes/Entities/Mobs/NPCs/behonker.yml
Resources/Prototypes/Entities/Mobs/NPCs/pets.yml
Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml
Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml
Resources/Prototypes/Entities/Mobs/NPCs/space.yml
Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml
Resources/Prototypes/Entities/Mobs/Player/guardian.yml
Resources/Prototypes/Entities/Mobs/Species/base.yml
Resources/Prototypes/Entities/Mobs/Species/slime.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cups.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_special.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/trash_drinks.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/bowl.yml
Resources/Prototypes/Entities/Objects/Devices/Electronics/door.yml
Resources/Prototypes/Entities/Objects/Devices/Syndicate_Gadgets/war_declarator.yml
Resources/Prototypes/Entities/Objects/Devices/forensic_scanner.yml
Resources/Prototypes/Entities/Objects/Devices/pda.yml
Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml
Resources/Prototypes/Entities/Objects/Devices/station_map.yml
Resources/Prototypes/Entities/Objects/Fun/Instruments/base_instruments.yml
Resources/Prototypes/Entities/Objects/Fun/candy_bucket.yml
Resources/Prototypes/Entities/Objects/Fun/crayons.yml
Resources/Prototypes/Entities/Objects/Fun/pai.yml
Resources/Prototypes/Entities/Objects/Misc/books.yml
Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
Resources/Prototypes/Entities/Objects/Misc/paper.yml
Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml
Resources/Prototypes/Entities/Objects/Specific/Chapel/bibles.yml
Resources/Prototypes/Entities/Objects/Specific/Chapel/urn.yml
Resources/Prototypes/Entities/Objects/Specific/Kitchen/foodcarts.yml
Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml
Resources/Prototypes/Entities/Objects/Specific/Medical/handheld_crew_monitor.yml
Resources/Prototypes/Entities/Objects/Specific/Medical/healthanalyzer.yml
Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml
Resources/Prototypes/Entities/Objects/Specific/Service/barber.yml
Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/item_artifacts.yml
Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/structure_artifacts.yml
Resources/Prototypes/Entities/Objects/Specific/atmos.yml
Resources/Prototypes/Entities/Objects/Specific/chemical-containers.yml
Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml
Resources/Prototypes/Entities/Objects/Specific/chemistry-vials.yml
Resources/Prototypes/Entities/Objects/Specific/chemistry.yml
Resources/Prototypes/Entities/Objects/Specific/syndicate.yml
Resources/Prototypes/Entities/Objects/Tools/access_configurator.yml
Resources/Prototypes/Entities/Objects/Tools/bucket.yml
Resources/Prototypes/Entities/Objects/Tools/cowtools.yml
Resources/Prototypes/Entities/Objects/Tools/gas_tanks.yml
Resources/Prototypes/Entities/Objects/Tools/hand_labeler.yml
Resources/Prototypes/Entities/Objects/Tools/handheld_mass_scanner.yml
Resources/Prototypes/Entities/Objects/Tools/jetpacks.yml
Resources/Prototypes/Entities/Objects/Tools/spray_painter.yml
Resources/Prototypes/Entities/Objects/Tools/toolbox.yml
Resources/Prototypes/Entities/Objects/Tools/tools.yml
Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/watergun.yml
Resources/Prototypes/Entities/Objects/base_item.yml
Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml
Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml
Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml
Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml
Resources/Prototypes/Entities/Structures/Doors/Shutter/shutters.yml
Resources/Prototypes/Entities/Structures/Doors/Windoors/base_structurewindoors.yml
Resources/Prototypes/Entities/Structures/Furniture/bookshelf.yml
Resources/Prototypes/Entities/Structures/Furniture/dresser.yml
Resources/Prototypes/Entities/Structures/Furniture/toilet.yml
Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml
Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml
Resources/Prototypes/Entities/Structures/Machines/Computers/techdiskterminal.yml
Resources/Prototypes/Entities/Structures/Machines/Medical/cryo_pod.yml
Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml
Resources/Prototypes/Entities/Structures/Machines/bombs.yml
Resources/Prototypes/Entities/Structures/Machines/chem_master.yml
Resources/Prototypes/Entities/Structures/Machines/fax_machine.yml
Resources/Prototypes/Entities/Structures/Machines/flatpacker.yml
Resources/Prototypes/Entities/Structures/Machines/gateway.yml
Resources/Prototypes/Entities/Structures/Machines/gravity_generator.yml
Resources/Prototypes/Entities/Structures/Machines/jukebox.yml
Resources/Prototypes/Entities/Structures/Machines/lathe.yml
Resources/Prototypes/Entities/Structures/Machines/microwave.yml
Resources/Prototypes/Entities/Structures/Machines/nuke.yml
Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml
Resources/Prototypes/Entities/Structures/Machines/research.yml
Resources/Prototypes/Entities/Structures/Machines/salvage.yml
Resources/Prototypes/Entities/Structures/Machines/surveillance_camera_routers.yml
Resources/Prototypes/Entities/Structures/Machines/vending_machines.yml
Resources/Prototypes/Entities/Structures/Machines/wireless_surveillance_camera.yml
Resources/Prototypes/Entities/Structures/Piping/Atmospherics/binary.yml
Resources/Prototypes/Entities/Structures/Piping/Atmospherics/portable.yml
Resources/Prototypes/Entities/Structures/Piping/Atmospherics/trinary.yml
Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml
Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml
Resources/Prototypes/Entities/Structures/Piping/Disposal/units.yml
Resources/Prototypes/Entities/Structures/Power/Generation/PA/control_box.yml
Resources/Prototypes/Entities/Structures/Power/Generation/ame.yml
Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml
Resources/Prototypes/Entities/Structures/Power/apc.yml
Resources/Prototypes/Entities/Structures/Specific/Janitor/janicart.yml
Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml
Resources/Prototypes/Entities/Structures/Storage/filing_cabinets.yml
Resources/Prototypes/Entities/Structures/Storage/ore_box.yml
Resources/Prototypes/Entities/Structures/Wallmounts/air_alarm.yml
Resources/Prototypes/Entities/Structures/Wallmounts/fire_alarm.yml
Resources/Prototypes/Entities/Structures/Wallmounts/intercom.yml
Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml
Resources/Prototypes/Entities/Structures/Wallmounts/monitors_televisions.yml
Resources/Prototypes/Entities/Structures/Wallmounts/noticeboard.yml
Resources/Prototypes/Entities/Structures/Wallmounts/station_map.yml
Resources/Prototypes/Entities/Structures/Wallmounts/surveillance_camera.yml
Resources/Prototypes/Entities/Structures/Wallmounts/timer.yml
Resources/Prototypes/Entities/Structures/cryopod.yml
Resources/Prototypes/XenoArch/Effects/utility_effects.yml

index d95e74576bfd0a9136d297652159bb3eb95da4d9..a4e3bfc5aaf42f0c9fda79f3e802c4c0bfb9e29e 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.GameStates;
 
 namespace Content.Client.Administration.Components;
 
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent]
 public sealed partial class HeadstandComponent : SharedHeadstandComponent
 {
 
index 1cf47b93ff503cfa66c37f462dc73bcf890c51d8..91c44ef3f27567a90d78e63ee2ee0f63f777f739 100644 (file)
@@ -3,6 +3,5 @@ using Robust.Shared.GameStates;
 
 namespace Content.Client.Administration.Components;
 
-[NetworkedComponent, RegisterComponent]
-public sealed partial class KillSignComponent : SharedKillSignComponent
-{ }
+[RegisterComponent]
+public sealed partial class KillSignComponent : SharedKillSignComponent;
index 53bde82a7843acf8eaf8d1f2389e9400719dc252..dd4a5bbb9b0ec7e7a93afe30bfbcff2ae57e2228 100644 (file)
@@ -11,6 +11,7 @@ public sealed class JukeboxSystem : SharedJukeboxSystem
     [Dependency] private readonly IPrototypeManager _protoManager = default!;
     [Dependency] private readonly AnimationPlayerSystem _animationPlayer = default!;
     [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
+    [Dependency] private readonly SharedUserInterfaceSystem _uiSystem = default!;
 
     public override void Initialize()
     {
@@ -35,13 +36,10 @@ public sealed class JukeboxSystem : SharedJukeboxSystem
 
         var query = AllEntityQuery<JukeboxComponent, UserInterfaceComponent>();
 
-        while (query.MoveNext(out _, out var ui))
+        while (query.MoveNext(out var uid, out _, out var ui))
         {
-            if (!ui.OpenInterfaces.TryGetValue(JukeboxUiKey.Key, out var baseBui) ||
-                baseBui is not JukeboxBoundUserInterface bui)
-            {
+            if (!_uiSystem.TryGetOpenUi<JukeboxBoundUserInterface>((uid, ui), JukeboxUiKey.Key, out var bui))
                 continue;
-            }
 
             bui.PopulateMusic();
         }
@@ -49,15 +47,9 @@ public sealed class JukeboxSystem : SharedJukeboxSystem
 
     private void OnJukeboxAfterState(Entity<JukeboxComponent> ent, ref AfterAutoHandleStateEvent args)
     {
-        if (!TryComp(ent, out UserInterfaceComponent? ui))
+        if (!_uiSystem.TryGetOpenUi<JukeboxBoundUserInterface>(ent.Owner, JukeboxUiKey.Key, out var bui))
             return;
 
-        if (!ui.OpenInterfaces.TryGetValue(JukeboxUiKey.Key, out var baseBui) ||
-            baseBui is not JukeboxBoundUserInterface bui)
-        {
-            return;
-        }
-
         bui.Reload();
     }
 
index 126c172924b0c8e37e28a1a051291902fda52e06..324b05a93d493133198d57895e939089d9fad152 100644 (file)
@@ -3,7 +3,5 @@ using Robust.Shared.GameStates;
 
 namespace Content.Client.Extinguisher;
 
-[NetworkedComponent, RegisterComponent]
-public sealed partial class FireExtinguisherComponent : SharedFireExtinguisherComponent
-{
-}
+[RegisterComponent]
+public sealed partial class FireExtinguisherComponent : SharedFireExtinguisherComponent;
index ef9d6e8b9beb37652f2dccbcb08fa754408fcee8..07352b512b0e035bc3afb73b4a61fe0a53ba7f48 100644 (file)
@@ -21,7 +21,6 @@ namespace Content.Client.PDA
         protected override void Open()
         {
             base.Open();
-            SendMessage(new PdaRequestUpdateInterfaceMessage());
             _menu = new PdaMenu();
             _menu.OpenCenteredLeft();
             _menu.OnClose += Close;
@@ -32,17 +31,17 @@ namespace Content.Client.PDA
 
             _menu.EjectIdButton.OnPressed += _ =>
             {
-                SendMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaIdSlotId));
+                SendPredictedMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaIdSlotId));
             };
 
             _menu.EjectPenButton.OnPressed += _ =>
             {
-                SendMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPenSlotId));
+                SendPredictedMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPenSlotId));
             };
 
             _menu.EjectPaiButton.OnPressed += _ =>
             {
-                SendMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPaiSlotId));
+                SendPredictedMessage(new ItemSlotButtonPressedEvent(PdaComponent.PdaPaiSlotId));
             };
 
             _menu.ActivateMusicButton.OnPressed += _ =>
index d197cd3721b53afba18753a70dba22cd557474fa..1dc827bf7e6784c85b750ea4f7873a6f488bef20 100644 (file)
@@ -1,9 +1,6 @@
 using Content.Shared.Paper;
-using Robust.Shared.GameStates;
 
 namespace Content.Client.Paper;
 
-[NetworkedComponent, RegisterComponent]
-public sealed partial class PaperComponent : SharedPaperComponent
-{
-}
+[RegisterComponent]
+public sealed partial class PaperComponent : SharedPaperComponent;
diff --git a/Content.Client/Power/ActivatableUIRequiresPowerSystem.cs b/Content.Client/Power/ActivatableUIRequiresPowerSystem.cs
new file mode 100644 (file)
index 0000000..60ed8d8
--- /dev/null
@@ -0,0 +1,21 @@
+using Content.Shared.Power.Components;
+using Content.Shared.UserInterface;
+using Content.Shared.Wires;
+
+namespace Content.Client.Power;
+
+public sealed class ActivatableUIRequiresPowerSystem : EntitySystem
+{
+    public override void Initialize()
+    {
+        base.Initialize();
+
+        SubscribeLocalEvent<ActivatableUIRequiresPowerComponent, ActivatableUIOpenAttemptEvent>(OnActivate);
+    }
+
+    private void OnActivate(EntityUid uid, ActivatableUIRequiresPowerComponent component, ActivatableUIOpenAttemptEvent args)
+    {
+        // Client can't predict the power properly at the moment so rely upon the server to do it.
+        args.Cancel();
+    }
+}
index f7fdbb83675ad1f8d5852142010968b40115c0c6..899df30f7fc01dea868e20937480302923eb79b1 100644 (file)
@@ -17,6 +17,14 @@ public sealed class StorageBoundUserInterface : BoundUserInterface
         _storage = _entManager.System<StorageSystem>();
     }
 
+    protected override void Open()
+    {
+        base.Open();
+
+        if (_entManager.TryGetComponent<StorageComponent>(Owner, out var comp))
+            _storage.OpenStorageWindow((Owner, comp));
+    }
+
     protected override void Dispose(bool disposing)
     {
         base.Dispose(disposing);
@@ -25,16 +33,5 @@ public sealed class StorageBoundUserInterface : BoundUserInterface
 
         _storage.CloseStorageWindow(Owner);
     }
-
-    protected override void ReceiveMessage(BoundUserInterfaceMessage message)
-    {
-        base.ReceiveMessage(message);
-
-        if (message is StorageModifyWindowMessage)
-        {
-            if (_entManager.TryGetComponent<StorageComponent>(Owner, out var comp))
-                _storage.OpenStorageWindow((Owner, comp));
-        }
-    }
 }
 
index 2728bfa9e8972383b30d0e5eafabce4888ff2e56..8bf0dcd98129df76c1b21570acbb264912f08b63 100644 (file)
@@ -111,7 +111,7 @@ public sealed class StorageSystem : SharedStorageSystem
         if (!Resolve(entity, ref entity.Comp, false))
             return;
 
-        if (entity.Comp.OpenInterfaces.GetValueOrDefault(StorageComponent.StorageUiKey.Key) is not { } bui)
+        if (entity.Comp.ClientOpenInterfaces.GetValueOrDefault(StorageComponent.StorageUiKey.Key) is not { } bui)
             return;
 
         bui.Close();
index c5083d2204670c7c477105a4f8f98280aea09ad8..23f38e9d51b653a9d8a6341fc0901f98528c067e 100644 (file)
@@ -35,7 +35,7 @@ public sealed class StrippableSystem : SharedStrippableSystem
         if (!TryComp(uid, out UserInterfaceComponent? uiComp))
             return;
 
-        foreach (var ui in uiComp.OpenInterfaces.Values)
+        foreach (var ui in uiComp.ClientOpenInterfaces.Values)
         {
             if (ui is StrippableBoundUserInterface stripUi)
                 stripUi.DirtyMenu();
index b865b54dd0eaf68c7c2be63d60dea05a6b6f57b9..346469d29dab6012f20c8829e419132018e0363b 100644 (file)
@@ -262,7 +262,7 @@ public sealed class StorageUIController : UIController, IOnSystemChanged<Storage
         }
         else if (args.Function == ContentKeyFunctions.ActivateItemInWorld)
         {
-            _entity.EntityNetManager?.SendSystemNetworkMessage(
+            _entity.RaisePredictiveEvent(
                 new InteractInventorySlotEvent(_entity.GetNetEntity(control.Entity), altInteract: false));
             args.Handle();
         }
index d45290c8664a13ee42c31d3d43eed38478d229be..95cf8a06dfa5613bf20c5347a0f550e7e02a6c43 100644 (file)
@@ -820,7 +820,7 @@ public abstract partial class InteractionTest
             return false;
         }
 
-        if (!ui.OpenInterfaces.TryGetValue(key, out bui))
+        if (!ui.ClientOpenInterfaces.TryGetValue(key, out bui))
         {
             if (shouldSucceed)
                 Assert.Fail($"Entity {SEntMan.ToPrettyString(SEntMan.GetEntity(target.Value))} does not have an open bui with key {key.GetType()}.{key}.");
index a6af3e6a65bd6780b1edb7f82ae4660baa766b60..a94e94489c0990b13ccee604dd4acc98d532dbf6 100644 (file)
@@ -143,8 +143,8 @@ namespace Content.IntegrationTests.Tests.Power
     anchored: true
   - type: UserInterface
     interfaces:
-    - key: enum.ApcUiKey.Key
-      type: ApcBoundUserInterface
+      enum.ApcUiKey.Key:
+        type: ApcBoundUserInterface
   - type: AccessReader
     access: [['Engineering']]
 
index 25f2e4c1b04dacdb6838f65568fa5fb9694bd0c3..bc038fe4ff02a7d67158e2dfa6a8bbf8afc44c97 100644 (file)
@@ -68,16 +68,13 @@ public sealed class AccessOverriderSystem : SharedAccessOverriderSystem
 
     private void OnDoAfter(EntityUid uid, AccessOverriderComponent component, AccessOverriderDoAfterEvent args)
     {
-        if (!TryComp(args.User, out ActorComponent? actor))
-            return;
-
         if (args.Handled || args.Cancelled)
             return;
 
         if (args.Args.Target != null)
         {
             component.TargetAccessReaderId = args.Args.Target.Value;
-            _userInterface.TryOpen(uid, AccessOverriderUiKey.Key, actor.PlayerSession);
+            _userInterface.OpenUi(uid, AccessOverriderUiKey.Key, args.User);
             UpdateUserInterface(uid, component, args);
         }
 
@@ -94,7 +91,7 @@ public sealed class AccessOverriderSystem : SharedAccessOverriderSystem
 
     private void OnWriteToTargetAccessReaderIdMessage(EntityUid uid, AccessOverriderComponent component, WriteToTargetAccessReaderIdMessage args)
     {
-        if (args.Session.AttachedEntity is not { Valid: true } player)
+        if (args.Actor is not { Valid: true } player)
             return;
 
         TryWriteToTargetAccessReaderId(uid, args.AccessList, player, component);
@@ -154,22 +151,19 @@ public sealed class AccessOverriderSystem : SharedAccessOverriderSystem
             targetLabel,
             targetLabelColor);
 
-        _userInterface.TrySetUiState(uid, AccessOverriderUiKey.Key, newState);
+        _userInterface.SetUiState(uid, AccessOverriderUiKey.Key, newState);
     }
 
     private List<ProtoId<AccessLevelPrototype>> ConvertAccessHashSetsToList(List<HashSet<ProtoId<AccessLevelPrototype>>> accessHashsets)
     {
-        List<ProtoId<AccessLevelPrototype>> accessList = new List<ProtoId<AccessLevelPrototype>>();
+        var accessList = new List<ProtoId<AccessLevelPrototype>>();
+
+        if (accessHashsets.Count <= 0)
+            return accessList;
 
-        if (accessHashsets != null && accessHashsets.Any())
+        foreach (var hashSet in accessHashsets)
         {
-            foreach (HashSet<ProtoId<AccessLevelPrototype>> hashSet in accessHashsets)
-            {
-                foreach (ProtoId<AccessLevelPrototype> hash in hashSet.ToArray())
-                {
-                    accessList.Add(hash);
-                }
-            }
+            accessList.AddRange(hashSet);
         }
 
         return accessList;
index bd4d3b3f2330d77734eb059cdb795b1175e9a6e0..2c4425ec105cdeea77dae28f66a6160636516777 100644 (file)
@@ -61,14 +61,14 @@ namespace Content.Server.Access.Systems
 
         private void AfterUIOpen(EntityUid uid, AgentIDCardComponent component, AfterActivatableUIOpenEvent args)
         {
-            if (!_uiSystem.TryGetUi(uid, AgentIDCardUiKey.Key, out var ui))
+            if (!_uiSystem.HasUi(uid, AgentIDCardUiKey.Key))
                 return;
 
             if (!TryComp<IdCardComponent>(uid, out var idCard))
                 return;
 
             var state = new AgentIDCardBoundUserInterfaceState(idCard.FullName ?? "", idCard.JobTitle ?? "", component.Icons);
-            _uiSystem.SetUiState(ui, state, args.Session);
+            _uiSystem.SetUiState(uid, AgentIDCardUiKey.Key, state);
         }
 
         private void OnJobChanged(EntityUid uid, AgentIDCardComponent comp, AgentIDCardJobChangedMessage args)
index db8b9d036e863d9909432254e0916280792f5a6a..e680b0c6f4071d10c64137011da112badafd3be6 100644 (file)
@@ -41,7 +41,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
 
     private void OnWriteToTargetIdMessage(EntityUid uid, IdCardConsoleComponent component, WriteToTargetIdMessage args)
     {
-        if (args.Session.AttachedEntity is not { Valid: true } player)
+        if (args.Actor is not { Valid: true } player)
             return;
 
         TryWriteToTargetId(uid, args.FullName, args.JobTitle, args.AccessList, args.JobPrototype, player, component);
@@ -104,7 +104,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
                 Name(targetId));
         }
 
-        _userInterface.TrySetUiState(uid, IdCardConsoleUiKey.Key, newState);
+        _userInterface.SetUiState(uid, IdCardConsoleUiKey.Key, newState);
     }
 
     /// <summary>
index 8472b5ad368569667528fbeeecc040fb9e4aa3c9..2ab097fad49946bcaed504fe00c8140627407645 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.GameStates;
 
 namespace Content.Server.Administration.Components;
 
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent]
 public sealed partial class HeadstandComponent : SharedHeadstandComponent
 {
 
index e29ce202ddaf070d3451eb723c27425e25df168c..11479c32fc4bdd4c90406d3d2fd6bbdc9adf1cae 100644 (file)
@@ -3,6 +3,5 @@ using Robust.Shared.GameStates;
 
 namespace Content.Server.Administration.Components;
 
-[NetworkedComponent, RegisterComponent]
-public sealed partial class KillSignComponent : SharedKillSignComponent
-{ }
+[RegisterComponent]
+public sealed partial class KillSignComponent : SharedKillSignComponent;
index f5b237b4492afb6f92f93b7800b2299cbf35b313..5bb75b4c99c17019d979af5e177a40e1422c7d39 100644 (file)
@@ -463,7 +463,7 @@ namespace Content.Server.Administration.Systems
                     Text = Loc.GetString("configure-verb-get-data-text"),
                     Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/settings.svg.192dpi.png")),
                     Category = VerbCategory.Debug,
-                    Act = () => _uiSystem.TryOpen(args.Target, ConfigurationUiKey.Key, actor.PlayerSession)
+                    Act = () => _uiSystem.OpenUi(args.Target, ConfigurationUiKey.Key, actor.PlayerSession)
                 };
                 args.Verbs.Add(verb);
             }
index 048f59b8d33b7cb5a992c6d47f5d990ced5d6e67..232b4b7edab520535ac80848f7bdcdf455143dd2 100644 (file)
@@ -4,6 +4,7 @@ using Content.Server.UserInterface;
 using Content.Shared.Advertise;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
+using ActivatableUIComponent = Content.Shared.UserInterface.ActivatableUIComponent;
 
 namespace Content.Server.Advertise;
 
index 5bf78bde857675feaed4190419376d8c0ce4143e..1b323d664378271a0bea5a041c97d16f626528ee 100644 (file)
@@ -129,11 +129,11 @@ public sealed class AmeControllerSystem : EntitySystem
         if (!Resolve(uid, ref controller))
             return;
 
-        if (!_userInterfaceSystem.TryGetUi(uid, AmeControllerUiKey.Key, out var bui))
+        if (!_userInterfaceSystem.HasUi(uid, AmeControllerUiKey.Key))
             return;
 
         var state = GetUiState(uid, controller);
-        _userInterfaceSystem.SetUiState(bui, state);
+        _userInterfaceSystem.SetUiState(uid, AmeControllerUiKey.Key, state);
 
         controller.NextUIUpdate = _gameTiming.CurTime + controller.UpdateUIPeriod;
     }
@@ -324,7 +324,7 @@ public sealed class AmeControllerSystem : EntitySystem
 
     private void OnUiButtonPressed(EntityUid uid, AmeControllerComponent comp, UiButtonPressedMessage msg)
     {
-        var user = msg.Session.AttachedEntity;
+        var user = msg.Actor;
         if (!Exists(user))
             return;
 
@@ -334,7 +334,7 @@ public sealed class AmeControllerSystem : EntitySystem
             _ => true,
         };
 
-        if (!PlayerCanUseController(uid, user!.Value, needsPower, comp))
+        if (!PlayerCanUseController(uid, user, needsPower, comp))
             return;
 
         _audioSystem.PlayPvs(comp.ClickSound, uid, AudioParams.Default.WithVolume(-2f));
index 7aa1a8935f36e83905e0c6dd326b8dd110b4df5b..056a985cbe2040d98245b8ebb33ba1a45ad42756 100644 (file)
@@ -61,7 +61,7 @@ public sealed partial class AnomalySystem
         var materialAmount = _material.GetMaterialAmount(uid, component.RequiredMaterial);
 
         var state = new AnomalyGeneratorUserInterfaceState(component.CooldownEndTime, materialAmount, component.MaterialPerAnomaly);
-        _ui.TrySetUiState(uid, AnomalyGeneratorUiKey.Key, state);
+        _ui.SetUiState(uid, AnomalyGeneratorUiKey.Key, state);
     }
 
     public void TryGeneratorCreateAnomaly(EntityUid uid, AnomalyGeneratorComponent? component = null)
index bce508903d0f40b7f1ee8ce7646869bee8c0446c..39c0d08b55e1950a5c167b2f32c86618bfae7ede 100644 (file)
@@ -31,7 +31,8 @@ public sealed partial class AnomalySystem
         {
             if (component.ScannedAnomaly != args.Anomaly)
                 continue;
-            _ui.TryCloseAll(uid, AnomalyScannerUiKey.Key);
+
+            _ui.CloseUi(uid, AnomalyScannerUiKey.Key);
         }
     }
 
@@ -108,7 +109,7 @@ public sealed partial class AnomalySystem
         Popup.PopupEntity(Loc.GetString("anomaly-scanner-component-scan-complete"), uid);
         UpdateScannerWithNewAnomaly(uid, args.Args.Target.Value, component);
 
-        if (TryComp<ActorComponent>(args.Args.User, out var actor)) _ui.TryOpen(uid, AnomalyScannerUiKey.Key, actor.PlayerSession);
+        _ui.OpenUi(uid, AnomalyScannerUiKey.Key, args.User);
 
         args.Handled = true;
     }
@@ -123,7 +124,7 @@ public sealed partial class AnomalySystem
             nextPulse = anomalyComponent.NextPulseTime;
 
         var state = new AnomalyScannerUserInterfaceState(GetScannerMessage(component), nextPulse);
-        _ui.TrySetUiState(uid, AnomalyScannerUiKey.Key, state);
+        _ui.SetUiState(uid, AnomalyScannerUiKey.Key, state);
     }
 
     public void UpdateScannerWithNewAnomaly(EntityUid scanner, EntityUid anomaly, AnomalyScannerComponent? scannerComp = null, AnomalyComponent? anomalyComp = null)
index ef69600783b5c5df6bb4401ebd5e3e361b7b6696..cd22f1f6d31a8ee651cea818ed7fda55afa8e84e 100644 (file)
@@ -157,39 +157,37 @@ public sealed partial class BlockGame
     /// <param name="message">The message to broadcase to all players/spectators.</param>
     private void SendMessage(BoundUserInterfaceMessage message)
     {
-        if (_uiSystem.TryGetUi(_owner, BlockGameUiKey.Key, out var bui))
-            _uiSystem.SendUiMessage(bui, message);
+        _uiSystem.ServerSendUiMessage(_entityManager.GetEntity(message.Entity), BlockGameUiKey.Key, message);
     }
 
     /// <summary>
     /// Handles sending a message to a specific player/spectator.
     /// </summary>
     /// <param name="message">The message to send to a specific player/spectator.</param>
-    /// <param name="session">The target recipient.</param>
-    private void SendMessage(BoundUserInterfaceMessage message, ICommonSession session)
+    /// <param name="actor">The target recipient.</param>
+    private void SendMessage(BoundUserInterfaceMessage message, EntityUid actor)
     {
-        if (_uiSystem.TryGetUi(_owner, BlockGameUiKey.Key, out var bui))
-            _uiSystem.TrySendUiMessage(bui, message, session);
+        _uiSystem.ServerSendUiMessage(_entityManager.GetEntity(message.Entity), BlockGameUiKey.Key, message, actor);
     }
 
     /// <summary>
     /// Handles sending the current state of the game to a player that has just opened the UI.
     /// </summary>
-    /// <param name="session">The target recipient.</param>
-    public void UpdateNewPlayerUI(ICommonSession session)
+    /// <param name="actor">The target recipient.</param>
+    public void UpdateNewPlayerUI(EntityUid actor)
     {
         if (_gameOver)
         {
-            SendMessage(new BlockGameMessages.BlockGameGameOverScreenMessage(Points, _highScorePlacement?.LocalPlacement, _highScorePlacement?.GlobalPlacement), session);
+            SendMessage(new BlockGameMessages.BlockGameGameOverScreenMessage(Points, _highScorePlacement?.LocalPlacement, _highScorePlacement?.GlobalPlacement), actor);
             return;
         }
 
         if (Paused)
-            SendMessage(new BlockGameMessages.BlockGameSetScreenMessage(BlockGameMessages.BlockGameScreen.Pause, Started), session);
+            SendMessage(new BlockGameMessages.BlockGameSetScreenMessage(BlockGameMessages.BlockGameScreen.Pause, Started), actor);
         else
-            SendMessage(new BlockGameMessages.BlockGameSetScreenMessage(BlockGameMessages.BlockGameScreen.Game, Started), session);
+            SendMessage(new BlockGameMessages.BlockGameSetScreenMessage(BlockGameMessages.BlockGameScreen.Game, Started), actor);
 
-        FullUpdate(session);
+        FullUpdate(actor);
     }
 
     /// <summary>
@@ -209,14 +207,14 @@ public sealed partial class BlockGame
     /// Handles broadcasting the full player-visible game state to a specific player/spectator.
     /// </summary>
     /// <param name="session">The target recipient.</param>
-    private void FullUpdate(ICommonSession session)
+    private void FullUpdate(EntityUid actor)
     {
-        UpdateFieldUI(session);
-        SendNextPieceUpdate(session);
-        SendHoldPieceUpdate(session);
-        SendLevelUpdate(session);
-        SendPointsUpdate(session);
-        SendHighscoreUpdate(session);
+        UpdateFieldUI(actor);
+        SendNextPieceUpdate(actor);
+        SendHoldPieceUpdate(actor);
+        SendLevelUpdate(actor);
+        SendPointsUpdate(actor);
+        SendHighscoreUpdate(actor);
     }
 
     /// <summary>
@@ -234,14 +232,13 @@ public sealed partial class BlockGame
     /// <summary>
     /// Handles broadcasting the current location of all of the blocks in the playfield + the active piece to a specific player/spectator.
     /// </summary>
-    /// <param name="session">The target recipient.</param>
-    public void UpdateFieldUI(ICommonSession session)
+    public void UpdateFieldUI(EntityUid actor)
     {
         if (!Started)
             return;
 
         var computedField = ComputeField();
-        SendMessage(new BlockGameMessages.BlockGameVisualUpdateMessage(computedField.ToArray(), BlockGameMessages.BlockGameVisualType.GameField), session);
+        SendMessage(new BlockGameMessages.BlockGameVisualUpdateMessage(computedField.ToArray(), BlockGameMessages.BlockGameVisualType.GameField), actor);
     }
 
     /// <summary>
@@ -282,10 +279,9 @@ public sealed partial class BlockGame
     /// <summary>
     /// Broadcasts the state of the next queued piece to a specific viewer.
     /// </summary>
-    /// <param name="session">The target recipient.</param>
-    private void SendNextPieceUpdate(ICommonSession session)
+    private void SendNextPieceUpdate(EntityUid actor)
     {
-        SendMessage(new BlockGameMessages.BlockGameVisualUpdateMessage(NextPiece.BlocksForPreview(), BlockGameMessages.BlockGameVisualType.NextBlock), session);
+        SendMessage(new BlockGameMessages.BlockGameVisualUpdateMessage(NextPiece.BlocksForPreview(), BlockGameMessages.BlockGameVisualType.NextBlock), actor);
     }
 
     /// <summary>
@@ -302,13 +298,12 @@ public sealed partial class BlockGame
     /// <summary>
     /// Broadcasts the state of the currently held piece to a specific viewer.
     /// </summary>
-    /// <param name="session">The target recipient.</param>
-    private void SendHoldPieceUpdate(ICommonSession session)
+    private void SendHoldPieceUpdate(EntityUid actor)
     {
         if (HeldPiece.HasValue)
-            SendMessage(new BlockGameMessages.BlockGameVisualUpdateMessage(HeldPiece.Value.BlocksForPreview(), BlockGameMessages.BlockGameVisualType.HoldBlock), session);
+            SendMessage(new BlockGameMessages.BlockGameVisualUpdateMessage(HeldPiece.Value.BlocksForPreview(), BlockGameMessages.BlockGameVisualType.HoldBlock), actor);
         else
-            SendMessage(new BlockGameMessages.BlockGameVisualUpdateMessage(Array.Empty<BlockGameBlock>(), BlockGameMessages.BlockGameVisualType.HoldBlock), session);
+            SendMessage(new BlockGameMessages.BlockGameVisualUpdateMessage(Array.Empty<BlockGameBlock>(), BlockGameMessages.BlockGameVisualType.HoldBlock), actor);
     }
 
     /// <summary>
@@ -322,10 +317,9 @@ public sealed partial class BlockGame
     /// <summary>
     /// Broadcasts the current game level to a specific viewer.
     /// </summary>
-    /// <param name="session">The target recipient.</param>
-    private void SendLevelUpdate(ICommonSession session)
+    private void SendLevelUpdate(EntityUid actor)
     {
-        SendMessage(new BlockGameMessages.BlockGameLevelUpdateMessage(Level), session);
+        SendMessage(new BlockGameMessages.BlockGameLevelUpdateMessage(Level), actor);
     }
 
     /// <summary>
@@ -339,10 +333,9 @@ public sealed partial class BlockGame
     /// <summary>
     /// Broadcasts the current game score to a specific viewer.
     /// </summary>
-    /// <param name="session">The target recipient.</param>
-    private void SendPointsUpdate(ICommonSession session)
+    private void SendPointsUpdate(EntityUid actor)
     {
-        SendMessage(new BlockGameMessages.BlockGameScoreUpdateMessage(Points), session);
+        SendMessage(new BlockGameMessages.BlockGameScoreUpdateMessage(Points), actor);
     }
 
     /// <summary>
@@ -356,9 +349,8 @@ public sealed partial class BlockGame
     /// <summary>
     /// Broadcasts the current game high score positions to a specific viewer.
     /// </summary>
-    /// <param name="session">The target recipient.</param>
-    private void SendHighscoreUpdate(ICommonSession session)
+    private void SendHighscoreUpdate(EntityUid actor)
     {
-        SendMessage(new BlockGameMessages.BlockGameHighScoreUpdateMessage(_arcadeSystem.GetLocalHighscores(), _arcadeSystem.GetGlobalHighscores()), session);
+        SendMessage(new BlockGameMessages.BlockGameHighScoreUpdateMessage(_arcadeSystem.GetLocalHighscores(), _arcadeSystem.GetGlobalHighscores()), actor);
     }
 }
index 3af1828d56468a2d1300523c8fb81b75741e055c..82063b6443fcf0e7d728136f03933a2c13a82121 100644 (file)
@@ -9,8 +9,8 @@ public sealed partial class BlockGame
 {
     [Dependency] private readonly IEntityManager _entityManager = default!;
     [Dependency] private readonly IRobustRandom _random = default!;
-    private readonly ArcadeSystem _arcadeSystem = default!;
-    private readonly UserInterfaceSystem _uiSystem = default!;
+    private readonly ArcadeSystem _arcadeSystem;
+    private readonly UserInterfaceSystem _uiSystem;
 
     /// <summary>
     /// What entity is currently hosting this game of NT-BG.
@@ -78,7 +78,7 @@ public sealed partial class BlockGame
         _gameOver = true;
 
         if (_entityManager.TryGetComponent<BlockGameArcadeComponent>(_owner, out var cabinet)
-        && _entityManager.TryGetComponent<MetaDataComponent>(cabinet.Player?.AttachedEntity, out var meta))
+        && _entityManager.TryGetComponent<MetaDataComponent>(cabinet.Player, out var meta))
         {
             _highScorePlacement = _arcadeSystem.RegisterHighScore(meta.EntityName, Points);
             SendHighscoreUpdate();
index 5613d9154441a5908b61317176be1f8aba3e6e2b..75952b0a33b97ac19459323b4d875480aa38a4ff 100644 (file)
@@ -13,10 +13,10 @@ public sealed partial class BlockGameArcadeComponent : Component
     /// <summary>
     /// The player currently playing the active session of NT-BG.
     /// </summary>
-    public ICommonSession? Player = null;
+    public EntityUid? Player = null;
 
     /// <summary>
     /// The players currently viewing (but not playing) the active session of NT-BG.
     /// </summary>
-    public readonly List<ICommonSession> Spectators = new();
+    public readonly List<EntityUid> Spectators = new();
 }
index ad65c5cca6ba11375447f9859878a332f8adff53..561cad8d7eed464f0f08b89c2eb4ecbf63a47e10 100644 (file)
@@ -37,14 +37,12 @@ public sealed class BlockGameArcadeSystem : EntitySystem
         }
     }
 
-    private void UpdatePlayerStatus(EntityUid uid, ICommonSession session, PlayerBoundUserInterface? bui = null, BlockGameArcadeComponent? blockGame = null)
+    private void UpdatePlayerStatus(EntityUid uid, EntityUid actor, BlockGameArcadeComponent? blockGame = null)
     {
         if (!Resolve(uid, ref blockGame))
             return;
-        if (bui == null && !_uiSystem.TryGetUi(uid, BlockGameUiKey.Key, out bui))
-            return;
 
-        _uiSystem.TrySendUiMessage(bui, new BlockGameMessages.BlockGameUserStatusMessage(blockGame.Player == session), session);
+        _uiSystem.ServerSendUiMessage(uid, BlockGameUiKey.Key, new BlockGameMessages.BlockGameUserStatusMessage(blockGame.Player == actor), actor);
     }
 
     private void OnComponentInit(EntityUid uid, BlockGameArcadeComponent component, ComponentInit args)
@@ -54,33 +52,21 @@ public sealed class BlockGameArcadeSystem : EntitySystem
 
     private void OnAfterUIOpen(EntityUid uid, BlockGameArcadeComponent component, AfterActivatableUIOpenEvent args)
     {
-        if (!TryComp<ActorComponent>(args.User, out var actor))
-            return;
-        if (!_uiSystem.TryGetUi(uid, BlockGameUiKey.Key, out var bui))
-            return;
-
-        var session = actor.PlayerSession;
-        if (!bui.SubscribedSessions.Contains(session))
-            return;
-
         if (component.Player == null)
-            component.Player = session;
+            component.Player = args.Actor;
         else
-            component.Spectators.Add(session);
+            component.Spectators.Add(args.Actor);
 
-        UpdatePlayerStatus(uid, session, bui, component);
-        component.Game?.UpdateNewPlayerUI(session);
+        UpdatePlayerStatus(uid, args.Actor, component);
+        component.Game?.UpdateNewPlayerUI(args.Actor);
     }
 
     private void OnAfterUiClose(EntityUid uid, BlockGameArcadeComponent component, BoundUIClosedEvent args)
     {
-        if (args.Session is not { } session)
-            return;
-
-        if (component.Player != session)
+        if (component.Player != args.Actor)
         {
-            component.Spectators.Remove(session);
-            UpdatePlayerStatus(uid, session, blockGame: component);
+            component.Spectators.Remove(args.Actor);
+            UpdatePlayerStatus(uid, args.Actor, blockGame: component);
             return;
         }
 
@@ -88,11 +74,11 @@ public sealed class BlockGameArcadeSystem : EntitySystem
         if (component.Spectators.Count > 0)
         {
             component.Player = component.Spectators[0];
-            component.Spectators.Remove(component.Player);
-            UpdatePlayerStatus(uid, component.Player, blockGame: component);
+            component.Spectators.Remove(component.Player.Value);
+            UpdatePlayerStatus(uid, component.Player.Value, blockGame: component);
         }
 
-        UpdatePlayerStatus(uid, temp, blockGame: component);
+        UpdatePlayerStatus(uid, temp.Value, blockGame: component);
     }
 
     private void OnBlockPowerChanged(EntityUid uid, BlockGameArcadeComponent component, ref PowerChangedEvent args)
@@ -100,8 +86,7 @@ public sealed class BlockGameArcadeSystem : EntitySystem
         if (args.Powered)
             return;
 
-        if (_uiSystem.TryGetUi(uid, BlockGameUiKey.Key, out var bui))
-            _uiSystem.CloseAll(bui);
+        _uiSystem.CloseUi(uid, BlockGameUiKey.Key);
         component.Player = null;
         component.Spectators.Clear();
     }
@@ -112,7 +97,7 @@ public sealed class BlockGameArcadeSystem : EntitySystem
             return;
         if (!BlockGameUiKey.Key.Equals(msg.UiKey))
             return;
-        if (msg.Session != component.Player)
+        if (msg.Actor != component.Player)
             return;
 
         if (msg.PlayerAction == BlockGamePlayerAction.NewGame)
index f60d88ebf78bba237a83aa06bf3b2f2329d908e8..f7758f11f17d0c7859dcd5b73b8fdb50e21b4494 100644 (file)
@@ -90,12 +90,10 @@ public sealed partial class SpaceVillainArcadeSystem : EntitySystem
                 _audioSystem.PlayPvs(component.NewGameSound, uid, AudioParams.Default.WithVolume(-4f));
 
                 component.Game = new SpaceVillainGame(uid, component, this);
-                if (_uiSystem.TryGetUi(uid, SpaceVillainArcadeUiKey.Key, out var bui))
-                    _uiSystem.SendUiMessage(bui, component.Game.GenerateMetaDataMessage());
+                _uiSystem.ServerSendUiMessage(uid, SpaceVillainArcadeUiKey.Key, component.Game.GenerateMetaDataMessage());
                 break;
             case PlayerAction.RequestData:
-                if (_uiSystem.TryGetUi(uid, SpaceVillainArcadeUiKey.Key, out bui))
-                    _uiSystem.SendUiMessage(bui, component.Game.GenerateMetaDataMessage());
+                _uiSystem.ServerSendUiMessage(uid, SpaceVillainArcadeUiKey.Key, component.Game.GenerateMetaDataMessage());
                 break;
         }
     }
@@ -110,7 +108,6 @@ public sealed partial class SpaceVillainArcadeSystem : EntitySystem
         if (TryComp<ApcPowerReceiverComponent>(uid, out var power) && power.Powered)
             return;
 
-        if (_uiSystem.TryGetUi(uid, SpaceVillainArcadeUiKey.Key, out var bui))
-            _uiSystem.CloseAll(bui);
+        _uiSystem.CloseUi(uid, SpaceVillainArcadeUiKey.Key);
     }
 }
index 890e9888a798e1a7aebbf42a38cb0a4811ec69ee..ebcfb8e3f642ad73a2e040405b156f734da16b0e 100644 (file)
@@ -9,8 +9,7 @@ public sealed partial class SpaceVillainGame
     /// </summary>
     private void UpdateUi(EntityUid uid, bool metadata = false)
     {
-        if (_uiSystem.TryGetUi(uid, SpaceVillainArcadeUiKey.Key, out var bui))
-            _uiSystem.SendUiMessage(bui, metadata ? GenerateMetaDataMessage() : GenerateUpdateMessage());
+        _uiSystem.ServerSendUiMessage(uid, SpaceVillainArcadeUiKey.Key, metadata ? GenerateMetaDataMessage() : GenerateUpdateMessage());
     }
 
     private void UpdateUi(EntityUid uid, string message1, string message2, bool metadata = false)
index 1f5ca80935285f637e0cac1587d62c5a024d8c78..15e1dde4ecfcc727f2fd1831db1e6e38c13be4fc 100644 (file)
@@ -118,8 +118,7 @@ namespace Content.Server.Atmos.EntitySystems
             if (!Resolve(uid, ref component))
                 return;
 
-            if (user != null && TryComp<ActorComponent>(user, out var actor))
-                _userInterface.TryClose(uid, GasAnalyzerUiKey.Key, actor.PlayerSession);
+            _userInterface.CloseUi(uid, GasAnalyzerUiKey.Key, user);
 
             component.Enabled = false;
             Dirty(uid, component);
@@ -132,8 +131,6 @@ namespace Content.Server.Atmos.EntitySystems
         /// </summary>
         private void OnDisabledMessage(EntityUid uid, GasAnalyzerComponent component, GasAnalyzerDisableMessage message)
         {
-            if (message.Session.AttachedEntity is not { Valid: true })
-                return;
             DisableAnalyzer(uid, component);
         }
 
@@ -142,10 +139,7 @@ namespace Content.Server.Atmos.EntitySystems
             if (!Resolve(uid, ref component, false))
                 return;
 
-            if (!TryComp<ActorComponent>(user, out var actor))
-                return;
-
-            _userInterface.TryOpen(uid, GasAnalyzerUiKey.Key, actor.PlayerSession);
+            _userInterface.OpenUi(uid, GasAnalyzerUiKey.Key, user);
         }
 
         /// <summary>
@@ -242,7 +236,7 @@ namespace Content.Server.Atmos.EntitySystems
             if (gasMixList.Count == 0)
                 return false;
 
-            _userInterface.TrySendUiMessage(uid, GasAnalyzerUiKey.Key,
+            _userInterface.ServerSendUiMessage(uid, GasAnalyzerUiKey.Key,
                 new GasAnalyzerUserMessage(gasMixList.ToArray(),
                     component.Target != null ? Name(component.Target.Value) : string.Empty,
                     GetNetEntity(component.Target) ?? NetEntity.Invalid,
index dd84756e45d035e5ef4f9e1bb068ca8566c87620..07594820fcc409eed7991cc9b4cb803f13d07752 100644 (file)
@@ -75,7 +75,7 @@ namespace Content.Server.Atmos.EntitySystems
         public void UpdateUserInterface(Entity<GasTankComponent> ent, bool initialUpdate = false)
         {
             var (owner, component) = ent;
-            _ui.TrySetUiState(owner, SharedGasTankUiKey.Key,
+            _ui.SetUiState(owner, SharedGasTankUiKey.Key,
                 new GasTankBoundUserInterfaceState
                 {
                     TankPressure = component.Air?.Pressure ?? 0,
index 7030d607a6e566ad83bb87a4c37a53bc381b33cf..93f704fe21bdae4dca4760e1025d0c43f4d3612b 100644 (file)
@@ -24,8 +24,6 @@ public sealed partial class AirAlarmComponent : Component
     public readonly Dictionary<string, GasVentScrubberData> ScrubberData = new();
     public readonly Dictionary<string, AtmosSensorData> SensorData = new();
 
-    public HashSet<NetUserId> ActivePlayers = new();
-
     public bool CanSync = true;
 
     /// <summary>
index 2922d0796a9bde888327044397ee2168f5f630d8..881f54512a166e3407da53a0cac7c7b9538dcd86 100644 (file)
@@ -223,8 +223,7 @@ public sealed class AirAlarmSystem : EntitySystem
 
     private void OnClose(EntityUid uid, AirAlarmComponent component, BoundUIClosedEvent args)
     {
-        component.ActivePlayers.Remove(args.Session.UserId);
-        if (component.ActivePlayers.Count == 0)
+        if (!_ui.IsUiOpen(uid, SharedAirAlarmInterfaceKey.Key))
             RemoveActiveInterface(uid);
     }
 
@@ -247,9 +246,6 @@ public sealed class AirAlarmSystem : EntitySystem
 
     private void OnActivate(EntityUid uid, AirAlarmComponent component, ActivateInWorldEvent args)
     {
-        if (!TryComp<ActorComponent>(args.User, out var actor))
-            return;
-
         if (TryComp<WiresPanelComponent>(uid, out var panel) && panel.Open)
         {
             args.Handled = false;
@@ -259,10 +255,7 @@ public sealed class AirAlarmSystem : EntitySystem
         if (!this.IsPowered(uid, EntityManager))
             return;
 
-        var ui = _ui.GetUiOrNull(uid, SharedAirAlarmInterfaceKey.Key);
-        if (ui != null)
-            _ui.OpenUi(ui, actor.PlayerSession);
-        component.ActivePlayers.Add(actor.PlayerSession.UserId);
+        _ui.OpenUi(uid, SharedAirAlarmInterfaceKey.Key, args.User);
         AddActiveInterface(uid);
         SyncAllDevices(uid);
         UpdateUI(uid, component);
@@ -270,7 +263,7 @@ public sealed class AirAlarmSystem : EntitySystem
 
     private void OnResyncAll(EntityUid uid, AirAlarmComponent component, AirAlarmResyncAllDevicesMessage args)
     {
-        if (!AccessCheck(uid, args.Session.AttachedEntity, component))
+        if (!AccessCheck(uid, args.Actor, component))
         {
             return;
         }
@@ -285,7 +278,7 @@ public sealed class AirAlarmSystem : EntitySystem
 
     private void OnUpdateAlarmMode(EntityUid uid, AirAlarmComponent component, AirAlarmUpdateAlarmModeMessage args)
     {
-        if (AccessCheck(uid, args.Session.AttachedEntity, component))
+        if (AccessCheck(uid, args.Actor, component))
         {
             var addr = string.Empty;
             if (TryComp<DeviceNetworkComponent>(uid, out var netConn))
@@ -309,7 +302,7 @@ public sealed class AirAlarmSystem : EntitySystem
 
     private void OnUpdateThreshold(EntityUid uid, AirAlarmComponent component, AirAlarmUpdateAlarmThresholdMessage args)
     {
-        if (AccessCheck(uid, args.Session.AttachedEntity, component))
+        if (AccessCheck(uid, args.Actor, component))
             SetThreshold(uid, args.Address, args.Type, args.Threshold, args.Gas);
         else
             UpdateUI(uid, component);
@@ -317,7 +310,7 @@ public sealed class AirAlarmSystem : EntitySystem
 
     private void OnUpdateDeviceData(EntityUid uid, AirAlarmComponent component, AirAlarmUpdateDeviceDataMessage args)
     {
-        if (AccessCheck(uid, args.Session.AttachedEntity, component)
+        if (AccessCheck(uid, args.Actor, component)
             && _deviceList.ExistsInDeviceList(uid, args.Address))
         {
             SetDeviceData(uid, args.Address, args.Data);
@@ -330,7 +323,7 @@ public sealed class AirAlarmSystem : EntitySystem
 
     private void OnCopyDeviceData(EntityUid uid, AirAlarmComponent component, AirAlarmCopyDeviceDataMessage args)
     {
-        if (!AccessCheck(uid, args.Session.AttachedEntity, component))
+        if (!AccessCheck(uid, args.Actor, component))
         {
            UpdateUI(uid, component);
             return;
@@ -377,7 +370,7 @@ public sealed class AirAlarmSystem : EntitySystem
 
     private void OnAtmosAlarm(EntityUid uid, AirAlarmComponent component, AtmosAlarmEvent args)
     {
-        if (component.ActivePlayers.Count != 0)
+        if (_ui.IsUiOpen(uid, SharedAirAlarmInterfaceKey.Key))
         {
             SyncAllDevices(uid);
         }
@@ -571,7 +564,7 @@ public sealed class AirAlarmSystem : EntitySystem
     /// </summary>
     private void ForceCloseAllInterfaces(EntityUid uid)
     {
-        _ui.TryCloseAll(uid, SharedAirAlarmInterfaceKey.Key);
+        _ui.CloseUi(uid, SharedAirAlarmInterfaceKey.Key);
     }
 
     private void OnAtmosUpdate(EntityUid uid, AirAlarmComponent alarm, ref AtmosDeviceUpdateEvent args)
@@ -639,7 +632,7 @@ public sealed class AirAlarmSystem : EntitySystem
             highestAlarm = AtmosAlarmType.Normal;
         }
 
-        _ui.TrySetUiState(
+        _ui.SetUiState(
             uid,
             SharedAirAlarmInterfaceKey.Key,
             new AirAlarmUIState(devNet.Address, deviceCount, pressure, temperature, dataToSend, alarm.CurrentMode, alarm.CurrentTab, highestAlarm.Value, alarm.AutoMode));
index af25d04df922c06c62b3687a18a2a55fa62aacda..83b7b67ba46a53b185d8a684e5e38c2b5ed2b707 100644 (file)
@@ -98,7 +98,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
             UpdateAppearance(uid, pump);
 
             DirtyUI(uid, pump);
-            _userInterfaceSystem.TryCloseAll(uid, GasPressurePumpUiKey.Key);
+            _userInterfaceSystem.CloseUi(uid, GasPressurePumpUiKey.Key);
         }
 
         private void OnPumpActivate(EntityUid uid, GasPressurePumpComponent pump, ActivateInWorldEvent args)
@@ -108,7 +108,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
 
             if (Transform(uid).Anchored)
             {
-                _userInterfaceSystem.TryOpen(uid, GasPressurePumpUiKey.Key, actor.PlayerSession);
+                _userInterfaceSystem.OpenUi(uid, GasPressurePumpUiKey.Key, actor.PlayerSession);
                 DirtyUI(uid, pump);
             }
             else
@@ -123,7 +123,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
         {
             pump.Enabled = args.Enabled;
             _adminLogger.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
-                $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
+                $"{ToPrettyString(args.Actor):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
             DirtyUI(uid, pump);
             UpdateAppearance(uid, pump);
         }
@@ -132,7 +132,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
         {
             pump.TargetPressure = Math.Clamp(args.Pressure, 0f, Atmospherics.MaxOutputPressure);
             _adminLogger.Add(LogType.AtmosPressureChanged, LogImpact.Medium,
-                $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the pressure on {ToPrettyString(uid):device} to {args.Pressure}kPa");
+                $"{ToPrettyString(args.Actor):player} set the pressure on {ToPrettyString(uid):device} to {args.Pressure}kPa");
             DirtyUI(uid, pump);
 
         }
@@ -142,7 +142,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
             if (!Resolve(uid, ref pump))
                 return;
 
-            _userInterfaceSystem.TrySetUiState(uid, GasPressurePumpUiKey.Key,
+            _userInterfaceSystem.SetUiState(uid, GasPressurePumpUiKey.Key,
                 new GasPressurePumpBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(uid).EntityName, pump.TargetPressure, pump.Enabled));
         }
 
index e4767c4061a7c366531bd4d8808558c05e746d12..cbcd1f4fa3bd85fe36fe8b8028f0a6676fe22cd1 100644 (file)
@@ -128,7 +128,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
             UpdateAppearance(uid, pump);
 
             DirtyUI(uid, pump);
-            _userInterfaceSystem.TryCloseAll(uid, GasVolumePumpUiKey.Key);
+            _userInterfaceSystem.CloseUi(uid, GasVolumePumpUiKey.Key);
         }
 
         private void OnPumpActivate(EntityUid uid, GasVolumePumpComponent pump, ActivateInWorldEvent args)
@@ -138,7 +138,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
 
             if (Transform(uid).Anchored)
             {
-                _userInterfaceSystem.TryOpen(uid, GasVolumePumpUiKey.Key, actor.PlayerSession);
+                _userInterfaceSystem.OpenUi(uid, GasVolumePumpUiKey.Key, actor.PlayerSession);
                 DirtyUI(uid, pump);
             }
             else
@@ -153,7 +153,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
         {
             pump.Enabled = args.Enabled;
             _adminLogger.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
-                $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
+                $"{ToPrettyString(args.Actor):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
             DirtyUI(uid, pump);
             UpdateAppearance(uid, pump);
         }
@@ -162,7 +162,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
         {
             pump.TransferRate = Math.Clamp(args.TransferRate, 0f, pump.MaxTransferRate);
             _adminLogger.Add(LogType.AtmosVolumeChanged, LogImpact.Medium,
-                $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the transfer rate on {ToPrettyString(uid):device} to {args.TransferRate}");
+                $"{ToPrettyString(args.Actor):player} set the transfer rate on {ToPrettyString(uid):device} to {args.TransferRate}");
             DirtyUI(uid, pump);
         }
 
@@ -171,7 +171,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
             if (!Resolve(uid, ref pump))
                 return;
 
-            _userInterfaceSystem.TrySetUiState(uid, GasVolumePumpUiKey.Key,
+            _userInterfaceSystem.SetUiState(uid, GasVolumePumpUiKey.Key,
                 new GasVolumePumpBoundUserInterfaceState(Name(uid), pump.TransferRate, pump.Enabled));
         }
 
index c0c2b930f6910bcda712865ffce09c687e778715..007d304e98e7c6c7dec06b45206fb998575a6895 100644 (file)
@@ -94,7 +94,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             _ambientSoundSystem.SetAmbience(uid, false);
 
             DirtyUI(uid, filter);
-            _userInterfaceSystem.TryCloseAll(uid, GasFilterUiKey.Key);
+            _userInterfaceSystem.CloseUi(uid, GasFilterUiKey.Key);
         }
 
         private void OnFilterActivate(EntityUid uid, GasFilterComponent filter, ActivateInWorldEvent args)
@@ -104,7 +104,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
 
             if (EntityManager.GetComponent<TransformComponent>(uid).Anchored)
             {
-                _userInterfaceSystem.TryOpen(uid, GasFilterUiKey.Key, actor.PlayerSession);
+                _userInterfaceSystem.OpenUi(uid, GasFilterUiKey.Key, actor.PlayerSession);
                 DirtyUI(uid, filter);
             }
             else
@@ -120,7 +120,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             if (!Resolve(uid, ref filter))
                 return;
 
-            _userInterfaceSystem.TrySetUiState(uid, GasFilterUiKey.Key,
+            _userInterfaceSystem.SetUiState(uid, GasFilterUiKey.Key,
                 new GasFilterBoundUserInterfaceState(MetaData(uid).EntityName, filter.TransferRate, filter.Enabled, filter.FilteredGas));
         }
 
@@ -136,7 +136,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
         {
             filter.Enabled = args.Enabled;
             _adminLogger.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
-                $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
+                $"{ToPrettyString(args.Actor):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
             DirtyUI(uid, filter);
             UpdateAppearance(uid, filter);
         }
@@ -145,7 +145,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
         {
             filter.TransferRate = Math.Clamp(args.Rate, 0f, filter.MaxTransferRate);
             _adminLogger.Add(LogType.AtmosVolumeChanged, LogImpact.Medium,
-                $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the transfer rate on {ToPrettyString(uid):device} to {args.Rate}");
+                $"{ToPrettyString(args.Actor):player} set the transfer rate on {ToPrettyString(uid):device} to {args.Rate}");
             DirtyUI(uid, filter);
 
         }
@@ -158,7 +158,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
                 {
                     filter.FilteredGas = parsedGas;
                     _adminLogger.Add(LogType.AtmosFilterChanged, LogImpact.Medium,
-                        $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the filter on {ToPrettyString(uid):device} to {parsedGas.ToString()}");
+                        $"{ToPrettyString(args.Actor):player} set the filter on {ToPrettyString(uid):device} to {parsedGas.ToString()}");
                     DirtyUI(uid, filter);
                 }
                 else
@@ -170,7 +170,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             {
                 filter.FilteredGas = null;
                 _adminLogger.Add(LogType.AtmosFilterChanged, LogImpact.Medium,
-                    $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the filter on {ToPrettyString(uid):device} to none");
+                    $"{ToPrettyString(args.Actor):player} set the filter on {ToPrettyString(uid):device} to none");
                 DirtyUI(uid, filter);
             }
         }
index 4d7fc134c70fa7012d4618d47cd687d7ede0197d..4ab8572843b345bbf84fba6430f5f7bdf4d21551 100644 (file)
@@ -134,7 +134,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
 
             DirtyUI(uid, mixer);
             UpdateAppearance(uid, mixer);
-            _userInterfaceSystem.TryCloseAll(uid, GasFilterUiKey.Key);
+            _userInterfaceSystem.CloseUi(uid, GasFilterUiKey.Key);
         }
 
         private void OnMixerActivate(EntityUid uid, GasMixerComponent mixer, ActivateInWorldEvent args)
@@ -144,7 +144,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
 
             if (Transform(uid).Anchored)
             {
-                _userInterfaceSystem.TryOpen(uid, GasMixerUiKey.Key, actor.PlayerSession);
+                _userInterfaceSystem.OpenUi(uid, GasMixerUiKey.Key, actor.PlayerSession);
                 DirtyUI(uid, mixer);
             }
             else
@@ -160,7 +160,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             if (!Resolve(uid, ref mixer))
                 return;
 
-            _userInterfaceSystem.TrySetUiState(uid, GasMixerUiKey.Key,
+            _userInterfaceSystem.SetUiState(uid, GasMixerUiKey.Key,
                 new GasMixerBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(uid).EntityName, mixer.TargetPressure, mixer.Enabled, mixer.InletOneConcentration));
         }
 
@@ -176,7 +176,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
         {
             mixer.Enabled = args.Enabled;
             _adminLogger.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
-                $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
+                $"{ToPrettyString(args.Actor):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
             DirtyUI(uid, mixer);
             UpdateAppearance(uid, mixer);
         }
@@ -185,7 +185,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
         {
             mixer.TargetPressure = Math.Clamp(args.Pressure, 0f, mixer.MaxTargetPressure);
             _adminLogger.Add(LogType.AtmosPressureChanged, LogImpact.Medium,
-                $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the pressure on {ToPrettyString(uid):device} to {args.Pressure}kPa");
+                $"{ToPrettyString(args.Actor):player} set the pressure on {ToPrettyString(uid):device} to {args.Pressure}kPa");
             DirtyUI(uid, mixer);
         }
 
@@ -196,7 +196,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             mixer.InletOneConcentration = nodeOne;
             mixer.InletTwoConcentration = 1.0f - mixer.InletOneConcentration;
             _adminLogger.Add(LogType.AtmosRatioChanged, LogImpact.Medium,
-                $"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the ratio on {EntityManager.ToPrettyString(uid):device} to {mixer.InletOneConcentration}:{mixer.InletTwoConcentration}");
+                $"{EntityManager.ToPrettyString(args.Actor):player} set the ratio on {EntityManager.ToPrettyString(uid):device} to {mixer.InletOneConcentration}:{mixer.InletTwoConcentration}");
             DirtyUI(uid, mixer);
         }
 
index bdc9e76538143423971ae5c0a44a919168541c35..e279db09aaf848fa0f6dd860416a4f32487ebd43 100644 (file)
@@ -96,7 +96,7 @@ public sealed class GasCanisterSystem : EntitySystem
             tankPressure = tankComponent.Air.Pressure;
         }
 
-        _ui.TrySetUiState(uid, GasCanisterUiKey.Key,
+        _ui.SetUiState(uid, GasCanisterUiKey.Key,
             new GasCanisterBoundUserInterfaceState(Name(uid),
                 canister.Air.Pressure, portStatus, tankLabel, tankPressure, canister.ReleasePressure,
                 canister.ReleaseValve, canister.MinReleasePressure, canister.MaxReleasePressure));
@@ -104,19 +104,19 @@ public sealed class GasCanisterSystem : EntitySystem
 
     private void OnHoldingTankEjectMessage(EntityUid uid, GasCanisterComponent canister, GasCanisterHoldingTankEjectMessage args)
     {
-        if (canister.GasTankSlot.Item == null || args.Session.AttachedEntity == null)
+        if (canister.GasTankSlot.Item == null)
             return;
 
         var item = canister.GasTankSlot.Item;
-        _slots.TryEjectToHands(uid, canister.GasTankSlot, args.Session.AttachedEntity);
-        _adminLogger.Add(LogType.CanisterTankEjected, LogImpact.Medium, $"Player {ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} ejected tank {ToPrettyString(item):tank} from {ToPrettyString(uid):canister}");
+        _slots.TryEjectToHands(uid, canister.GasTankSlot, args.Actor);
+        _adminLogger.Add(LogType.CanisterTankEjected, LogImpact.Medium, $"Player {ToPrettyString(args.Actor):player} ejected tank {ToPrettyString(item):tank} from {ToPrettyString(uid):canister}");
     }
 
     private void OnCanisterChangeReleasePressure(EntityUid uid, GasCanisterComponent canister, GasCanisterChangeReleasePressureMessage args)
     {
         var pressure = Math.Clamp(args.Pressure, canister.MinReleasePressure, canister.MaxReleasePressure);
 
-        _adminLogger.Add(LogType.CanisterPressure, LogImpact.Medium, $"{ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} set the release pressure on {ToPrettyString(uid):canister} to {args.Pressure}");
+        _adminLogger.Add(LogType.CanisterPressure, LogImpact.Medium, $"{ToPrettyString(args.Actor):player} set the release pressure on {ToPrettyString(uid):canister} to {args.Pressure}");
 
         canister.ReleasePressure = pressure;
         DirtyUI(uid, canister);
@@ -129,14 +129,14 @@ public sealed class GasCanisterSystem : EntitySystem
         impact = canister.GasTankSlot.HasItem ? LogImpact.Medium : LogImpact.High;
 
         var containedGasDict = new Dictionary<Gas, float>();
-        var containedGasArray = Gas.GetValues(typeof(Gas));
+        var containedGasArray = Enum.GetValues(typeof(Gas));
 
         for (int i = 0; i < containedGasArray.Length; i++)
         {
             containedGasDict.Add((Gas)i, canister.Air[i]);
         }
 
-        _adminLogger.Add(LogType.CanisterValve, impact, $"{ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} set the valve on {ToPrettyString(uid):canister} to {args.Valve:valveState} while it contained [{string.Join(", ", containedGasDict)}]");
+        _adminLogger.Add(LogType.CanisterValve, impact, $"{ToPrettyString(args.Actor):player} set the valve on {ToPrettyString(uid):canister} to {args.Valve:valveState} while it contained [{string.Join(", ", containedGasDict)}]");
 
         canister.ReleaseValve = args.Valve;
         DirtyUI(uid, canister);
@@ -212,7 +212,7 @@ public sealed class GasCanisterSystem : EntitySystem
         if (args.Handled)
             return;
 
-        _ui.TryOpen(uid, GasCanisterUiKey.Key, actor.PlayerSession);
+        _ui.OpenUi(uid, GasCanisterUiKey.Key, actor.PlayerSession);
         args.Handled = true;
     }
 
@@ -224,7 +224,7 @@ public sealed class GasCanisterSystem : EntitySystem
         if (CheckLocked(uid, component, args.User))
             return;
 
-        _ui.TryOpen(uid, GasCanisterUiKey.Key, actor.PlayerSession);
+        _ui.OpenUi(uid, GasCanisterUiKey.Key, actor.PlayerSession);
         args.Handled = true;
     }
 
index 9b61044f03eb82f8a9c0fc6b7081debb62de8999..827ba0bda5cd9a084f85c7569d969633e699a8e6 100644 (file)
@@ -144,7 +144,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
         private void OnToggleMessage(EntityUid uid, GasThermoMachineComponent thermoMachine, GasThermomachineToggleMessage args)
         {
             var powerState = _power.TogglePower(uid);
-            _adminLogger.Add(LogType.AtmosPowerChanged, $"{ToPrettyString(args.Session.AttachedEntity)} turned {(powerState ? "On" : "Off")} {ToPrettyString(uid)}");
+            _adminLogger.Add(LogType.AtmosPowerChanged, $"{ToPrettyString(args.Actor)} turned {(powerState ? "On" : "Off")} {ToPrettyString(uid)}");
             DirtyUI(uid, thermoMachine);
         }
 
@@ -155,7 +155,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
             else
                 thermoMachine.TargetTemperature = MathF.Max(args.Temperature, thermoMachine.MinTemperature);
             thermoMachine.TargetTemperature = MathF.Max(thermoMachine.TargetTemperature, Atmospherics.TCMB);
-            _adminLogger.Add(LogType.AtmosTemperatureChanged, $"{ToPrettyString(args.Session.AttachedEntity)} set temperature on {ToPrettyString(uid)} to {thermoMachine.TargetTemperature}");
+            _adminLogger.Add(LogType.AtmosTemperatureChanged, $"{ToPrettyString(args.Actor)} set temperature on {ToPrettyString(uid)} to {thermoMachine.TargetTemperature}");
             DirtyUI(uid, thermoMachine);
         }
 
@@ -168,8 +168,8 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
             if (!Resolve(uid, ref powerReceiver))
                 return;
 
-            _userInterfaceSystem.TrySetUiState(uid, ThermomachineUiKey.Key,
-                new GasThermomachineBoundUserInterfaceState(thermoMachine.MinTemperature, thermoMachine.MaxTemperature, thermoMachine.TargetTemperature, !powerReceiver.PowerDisabled, IsHeater(thermoMachine)), null, ui);
+            _userInterfaceSystem.SetUiState(uid, ThermomachineUiKey.Key,
+                new GasThermomachineBoundUserInterfaceState(thermoMachine.MinTemperature, thermoMachine.MaxTemperature, thermoMachine.TargetTemperature, !powerReceiver.PowerDisabled, IsHeater(thermoMachine)));
         }
 
         private void OnExamined(EntityUid uid, GasThermoMachineComponent thermoMachine, ExaminedEvent args)
index fff15f696c46d17b1abc630040e8709533da028d..cbf63f54043164b713bf110538a6ed317210801a 100644 (file)
@@ -163,7 +163,7 @@ public sealed class SpaceHeaterSystem : EntitySystem
         {
             return;
         }
-        _userInterfaceSystem.TrySetUiState(uid, SpaceHeaterUiKey.Key,
+        _userInterfaceSystem.SetUiState(uid, SpaceHeaterUiKey.Key,
             new SpaceHeaterBoundUserInterfaceState(spaceHeater.MinTemperature, spaceHeater.MaxTemperature, thermoMachine.TargetTemperature, !powerReceiver.PowerDisabled, spaceHeater.Mode, spaceHeater.PowerLevel));
     }
 
index bfb9b2099a4253cbfca3c79e7e70417d2b849927..cc9235e3d7a41ad65e5309390995c23f7be8b815 100644 (file)
@@ -5,6 +5,7 @@ using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Audio.Components;
 using Robust.Shared.Audio.Systems;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using JukeboxComponent = Content.Shared.Audio.Jukebox.JukeboxComponent;
 
@@ -66,8 +67,11 @@ public sealed class JukeboxSystem : SharedJukeboxSystem
 
     private void OnJukeboxSetTime(EntityUid uid, JukeboxComponent component, JukeboxSetTimeMessage args)
     {
-        var offset = (args.Session.Channel.Ping * 1.5f) / 1000f;
-        Audio.SetPlaybackPosition(component.AudioStream, args.SongTime + offset);
+        if (TryComp(args.Actor, out ActorComponent? actorComp))
+        {
+            var offset = actorComp.PlayerSession.Channel.Ping * 1.5f / 1000f;
+            Audio.SetPlaybackPosition(component.AudioStream, args.SongTime + offset);
+        }
     }
 
     private void OnPowerChanged(Entity<JukeboxComponent> entity, ref PowerChangedEvent args)
index 2e7f8c4235ad41ae542bbf9cc6f0008e74deed56..1369fa20f11560ad1048b37ae3e9291033196ddd 100644 (file)
@@ -79,9 +79,7 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
     private void OnRemoveItemBuiMessage(Entity<CryostorageComponent> ent, ref CryostorageRemoveItemBuiMessage args)
     {
         var (_, comp) = ent;
-        if (args.Session.AttachedEntity is not { } attachedEntity)
-            return;
-
+        var attachedEntity = args.Actor;
         var cryoContained = GetEntity(args.StoredEntity);
 
         if (!comp.StoredPlayers.Contains(cryoContained) || !IsInPausedMap(cryoContained))
@@ -114,6 +112,7 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
         AdminLog.Add(LogType.Action, LogImpact.High,
             $"{ToPrettyString(attachedEntity):player} removed item {ToPrettyString(entity)} from cryostorage-contained player " +
             $"{ToPrettyString(cryoContained):player}, stored in cryostorage {ToPrettyString(ent)}");
+
         _container.TryRemoveFromContainer(entity.Value);
         _transform.SetCoordinates(entity.Value, Transform(attachedEntity).Coordinates);
         _hands.PickupOrDrop(attachedEntity, entity.Value);
@@ -122,8 +121,8 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
 
     private void UpdateCryostorageUIState(Entity<CryostorageComponent> ent)
     {
-        var state = new CryostorageBuiState(GetAllContainedData(ent).ToList());
-        _ui.TrySetUiState(ent, CryostorageUIKey.Key, state);
+        var state = new CryostorageBuiState(GetAllContainedData(ent));
+        _ui.SetUiState(ent.Owner, CryostorageUIKey.Key, state);
     }
 
     private void OnPlayerSpawned(Entity<CryostorageContainedComponent> ent, ref PlayerSpawnCompleteEvent args)
@@ -293,12 +292,17 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
             _chatManager.ChatMessageToOne(ChatChannel.Server, msg, msg, uid, false, actor.PlayerSession.Channel);
     }
 
-    private IEnumerable<CryostorageContainedPlayerData> GetAllContainedData(Entity<CryostorageComponent> ent)
+    private List<CryostorageContainedPlayerData> GetAllContainedData(Entity<CryostorageComponent> ent)
     {
+        var data = new List<CryostorageContainedPlayerData>();
+        data.EnsureCapacity(ent.Comp.StoredPlayers.Count);
+
         foreach (var contained in ent.Comp.StoredPlayers)
         {
-            yield return GetContainedData(contained);
+            data.Add(GetContainedData(contained));
         }
+
+        return data;
     }
 
     private CryostorageContainedPlayerData GetContainedData(EntityUid uid)
index 22e5c67e1759aaea8829a8c61aa604220c82ed2f..e132e4f12a368ee28b055da5a9e9e4d0ddf85e0d 100644 (file)
@@ -52,7 +52,7 @@ public sealed partial class CargoSystem
             return;
 
         var untilNextSkip = bountyDb.NextSkipTime - _timing.CurTime;
-        _uiSystem.TrySetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(bountyDb.Bounties, untilNextSkip));
+        _uiSystem.SetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(bountyDb.Bounties, untilNextSkip));
     }
 
     private void OnPrintLabelMessage(EntityUid uid, CargoBountyConsoleComponent component, BountyPrintLabelMessage args)
@@ -83,7 +83,7 @@ public sealed partial class CargoSystem
         if (!TryGetBountyFromId(station, args.BountyId, out var bounty))
             return;
 
-        if (args.Session.AttachedEntity is not { Valid: true } mob)
+        if (args.Actor is not { Valid: true } mob)
             return;
 
         if (TryComp<AccessReaderComponent>(uid, out var accessReaderComponent) &&
@@ -99,7 +99,7 @@ public sealed partial class CargoSystem
         FillBountyDatabase(station);
         db.NextSkipTime = _timing.CurTime + db.SkipDelay;
         var untilNextSkip = db.NextSkipTime - _timing.CurTime;
-        _uiSystem.TrySetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(db.Bounties, untilNextSkip));
+        _uiSystem.SetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(db.Bounties, untilNextSkip));
         _audio.PlayPvs(component.SkipSound, uid);
     }
 
@@ -462,10 +462,12 @@ public sealed partial class CargoSystem
         {
             if (_station.GetOwningStation(uid) is not { } station ||
                 !TryComp<StationCargoBountyDatabaseComponent>(station, out var db))
+            {
                 continue;
+            }
 
             var untilNextSkip = db.NextSkipTime - _timing.CurTime;
-            _uiSystem.TrySetUiState(uid, CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(db.Bounties, untilNextSkip), ui: ui);
+            _uiSystem.SetUiState((uid, ui), CargoConsoleUiKey.Bounty, new CargoBountyConsoleState(db.Bounties, untilNextSkip));
         }
     }
 
index 13a1d3d565bb1e711e3bc3d6e10067d7069f3ae5..63556d2fbd73dd7be22a51a90b37f62e8d4ff35f 100644 (file)
@@ -102,12 +102,12 @@ namespace Content.Server.Cargo.Systems
 
         private void OnApproveOrderMessage(EntityUid uid, CargoOrderConsoleComponent component, CargoConsoleApproveOrderMessage args)
         {
-            if (args.Session.AttachedEntity is not { Valid: true } player)
+            if (args.Actor is not { Valid: true } player)
                 return;
 
             if (!_accessReaderSystem.IsAllowed(player, uid))
             {
-                ConsolePopup(args.Session, Loc.GetString("cargo-console-order-not-allowed"));
+                ConsolePopup(args.Actor, Loc.GetString("cargo-console-order-not-allowed"));
                 PlayDenySound(uid, component);
                 return;
             }
@@ -119,7 +119,7 @@ namespace Content.Server.Cargo.Systems
                 !TryComp(station, out StationDataComponent? stationData) ||
                 !TryGetOrderDatabase(station, out var orderDatabase))
             {
-                ConsolePopup(args.Session, Loc.GetString("cargo-console-station-not-found"));
+                ConsolePopup(args.Actor, Loc.GetString("cargo-console-station-not-found"));
                 PlayDenySound(uid, component);
                 return;
             }
@@ -134,7 +134,7 @@ namespace Content.Server.Cargo.Systems
             // Invalid order
             if (!_protoMan.HasIndex<EntityPrototype>(order.ProductId))
             {
-                ConsolePopup(args.Session, Loc.GetString("cargo-console-invalid-product"));
+                ConsolePopup(args.Actor, Loc.GetString("cargo-console-invalid-product"));
                 PlayDenySound(uid, component);
                 return;
             }
@@ -145,7 +145,7 @@ namespace Content.Server.Cargo.Systems
             // Too many orders, avoid them getting spammed in the UI.
             if (amount >= capacity)
             {
-                ConsolePopup(args.Session, Loc.GetString("cargo-console-too-many"));
+                ConsolePopup(args.Actor, Loc.GetString("cargo-console-too-many"));
                 PlayDenySound(uid, component);
                 return;
             }
@@ -156,7 +156,7 @@ namespace Content.Server.Cargo.Systems
             if (cappedAmount != order.OrderQuantity)
             {
                 order.OrderQuantity = cappedAmount;
-                ConsolePopup(args.Session, Loc.GetString("cargo-console-snip-snip"));
+                ConsolePopup(args.Actor, Loc.GetString("cargo-console-snip-snip"));
                 PlayDenySound(uid, component);
             }
 
@@ -165,7 +165,7 @@ namespace Content.Server.Cargo.Systems
             // Not enough balance
             if (cost > bank.Balance)
             {
-                ConsolePopup(args.Session, Loc.GetString("cargo-console-insufficient-funds", ("cost", cost)));
+                ConsolePopup(args.Actor, Loc.GetString("cargo-console-insufficient-funds", ("cost", cost)));
                 PlayDenySound(uid, component);
                 return;
             }
@@ -180,7 +180,7 @@ namespace Content.Server.Cargo.Systems
 
                 if (ev.FulfillmentEntity == null)
                 {
-                    ConsolePopup(args.Session, Loc.GetString("cargo-console-unfulfilled"));
+                    ConsolePopup(args.Actor, Loc.GetString("cargo-console-unfulfilled"));
                     PlayDenySound(uid, component);
                     return;
                 }
@@ -200,7 +200,7 @@ namespace Content.Server.Cargo.Systems
                 ("approverJob", approverJob),
                 ("cost", cost));
             _radio.SendRadioMessage(uid, message, component.AnnouncementChannel, uid, escapeMarkup: false);
-            ConsolePopup(args.Session, Loc.GetString("cargo-console-trade-station", ("destination", MetaData(ev.FulfillmentEntity.Value).EntityName)));
+            ConsolePopup(args.Actor, Loc.GetString("cargo-console-trade-station", ("destination", MetaData(ev.FulfillmentEntity.Value).EntityName)));
 
             // Log order approval
             _adminLogger.Add(LogType.Action, LogImpact.Low,
@@ -271,7 +271,7 @@ namespace Content.Server.Cargo.Systems
 
         private void OnAddOrderMessage(EntityUid uid, CargoOrderConsoleComponent component, CargoConsoleAddOrderMessage args)
         {
-            if (args.Session.AttachedEntity is not { Valid: true } player)
+            if (args.Actor is not { Valid: true } player)
                 return;
 
             if (args.Amount <= 0)
@@ -319,9 +319,9 @@ namespace Content.Server.Cargo.Systems
                 !TryComp<StationCargoOrderDatabaseComponent>(station, out var orderDatabase) ||
                 !TryComp<StationBankAccountComponent>(station, out var bankAccount)) return;
 
-            if (_uiSystem.TryGetUi(consoleUid, CargoConsoleUiKey.Orders, out var bui))
+            if (_uiSystem.HasUi(consoleUid, CargoConsoleUiKey.Orders))
             {
-                _uiSystem.SetUiState(bui, new CargoConsoleInterfaceState(
+                _uiSystem.SetUiState(consoleUid, CargoConsoleUiKey.Orders, new CargoConsoleInterfaceState(
                     MetaData(station.Value).EntityName,
                     GetOutstandingOrderCount(orderDatabase),
                     orderDatabase.Capacity,
@@ -331,9 +331,9 @@ namespace Content.Server.Cargo.Systems
             }
         }
 
-        private void ConsolePopup(ICommonSession session, string text)
+        private void ConsolePopup(EntityUid actor, string text)
         {
-            _popup.PopupCursor(text, session);
+            _popup.PopupCursor(text, actor);
         }
 
         private void PlayDenySound(EntityUid uid, CargoOrderConsoleComponent component)
index aa2614cdb865c233dee109b655af19ea0932a3cf..e9f6d008229d321f51f76b0ea107ca0657e15c92 100644 (file)
@@ -54,21 +54,20 @@ public sealed partial class CargoSystem
 
     private void UpdatePalletConsoleInterface(EntityUid uid)
     {
-        var bui = _uiSystem.GetUi(uid, CargoPalletConsoleUiKey.Sale);
         if (Transform(uid).GridUid is not EntityUid gridUid)
         {
-            _uiSystem.SetUiState(bui,
+            _uiSystem.SetUiState(uid, CargoPalletConsoleUiKey.Sale,
             new CargoPalletConsoleInterfaceState(0, 0, false));
             return;
         }
         GetPalletGoods(gridUid, out var toSell, out var amount);
-        _uiSystem.SetUiState(bui,
+        _uiSystem.SetUiState(uid, CargoPalletConsoleUiKey.Sale,
             new CargoPalletConsoleInterfaceState((int) amount, toSell.Count, true));
     }
 
     private void OnPalletUIOpen(EntityUid uid, CargoPalletConsoleComponent component, BoundUIOpenedEvent args)
     {
-        var player = args.Session.AttachedEntity;
+        var player = args.Actor;
 
         if (player == null)
             return;
@@ -86,7 +85,7 @@ public sealed partial class CargoSystem
 
     private void OnPalletAppraise(EntityUid uid, CargoPalletConsoleComponent component, CargoPalletAppraiseMessage args)
     {
-        var player = args.Session.AttachedEntity;
+        var player = args.Actor;
 
         if (player == null)
             return;
@@ -108,8 +107,8 @@ public sealed partial class CargoSystem
         var orders = GetProjectedOrders(station ?? EntityUid.Invalid, orderDatabase, shuttle);
         var shuttleName = orderDatabase?.Shuttle != null ? MetaData(orderDatabase.Shuttle.Value).EntityName : string.Empty;
 
-        if (_uiSystem.TryGetUi(uid, CargoConsoleUiKey.Shuttle, out var bui))
-            _uiSystem.SetUiState(bui, new CargoShuttleConsoleBoundUserInterfaceState(
+        if (_uiSystem.HasUi(uid, CargoConsoleUiKey.Shuttle))
+            _uiSystem.SetUiState(uid, CargoConsoleUiKey.Shuttle, new CargoShuttleConsoleBoundUserInterfaceState(
                 station != null ? MetaData(station.Value).EntityName : Loc.GetString("cargo-shuttle-console-station-unknown"),
                 string.IsNullOrEmpty(shuttleName) ? Loc.GetString("cargo-shuttle-console-shuttle-not-found") : shuttleName,
                 orders
@@ -314,17 +313,16 @@ public sealed partial class CargoSystem
 
     private void OnPalletSale(EntityUid uid, CargoPalletConsoleComponent component, CargoPalletSellMessage args)
     {
-        var player = args.Session.AttachedEntity;
+        var player = args.Actor;
 
         if (player == null)
             return;
 
-        var bui = _uiSystem.GetUi(uid, CargoPalletConsoleUiKey.Sale);
         var xform = Transform(uid);
 
         if (xform.GridUid is not EntityUid gridUid)
         {
-            _uiSystem.SetUiState(bui,
+            _uiSystem.SetUiState(uid, CargoPalletConsoleUiKey.Sale,
             new CargoPalletConsoleInterfaceState(0, 0, false));
             return;
         }
index 4a76aef911f85407d64b22110782457c71062a50..7896a7822e2de31903aea836918b120b15d42e3f 100644 (file)
@@ -103,12 +103,12 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
         if (!Resolve(loaderUid, ref loader))
             return;
 
-        if (!_userInterfaceSystem.TryGetUi(loaderUid, loader.UiKey, out var ui))
+        if (!_userInterfaceSystem.HasUi(loaderUid, loader.UiKey))
             return;
 
         var programs = GetAvailablePrograms(loaderUid, loader);
         var state = new CartridgeLoaderUiState(programs, GetNetEntity(loader.ActiveProgram));
-        _userInterfaceSystem.SetUiState(ui, state, session);
+        _userInterfaceSystem.SetUiState(loaderUid, loader.UiKey, state);
     }
 
     /// <summary>
@@ -127,8 +127,8 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
         if (!Resolve(loaderUid, ref loader))
             return;
 
-        if (_userInterfaceSystem.TryGetUi(loaderUid, loader.UiKey, out var ui))
-            _userInterfaceSystem.SetUiState(ui, state, session);
+        if (_userInterfaceSystem.HasUi(loaderUid, loader.UiKey))
+            _userInterfaceSystem.SetUiState(loaderUid, loader.UiKey, state);
     }
 
     /// <summary>
index ab91044574957dc5c6abc11ac6235caed2c3937f..289db7598162e7e5d76e22257dd1893c70982adf 100644 (file)
@@ -80,7 +80,7 @@ namespace Content.Server.Chemistry.EntitySystems
                 chemMaster.Mode, BuildInputContainerInfo(inputContainer), BuildOutputContainerInfo(outputContainer),
                 bufferReagents, bufferCurrentVolume, chemMaster.PillType, chemMaster.PillDosageLimit, updateLabel);
 
-            _userInterfaceSystem.TrySetUiState(owner, ChemMasterUiKey.Key, state);
+            _userInterfaceSystem.SetUiState(owner, ChemMasterUiKey.Key, state);
         }
 
         private void OnSetModeMessage(Entity<ChemMasterComponent> chemMaster, ref ChemMasterSetModeMessage message)
@@ -179,7 +179,7 @@ namespace Content.Server.Chemistry.EntitySystems
 
         private void OnCreatePillsMessage(Entity<ChemMasterComponent> chemMaster, ref ChemMasterCreatePillsMessage message)
         {
-            var user = message.Session.AttachedEntity;
+            var user = message.Actor;
             var maybeContainer = _itemSlotsSystem.GetItemOrNull(chemMaster, SharedChemMaster.OutputSlotName);
             if (maybeContainer is not { Valid: true } container
                 || !TryComp(container, out StorageComponent? storage))
@@ -218,18 +218,9 @@ namespace Content.Server.Chemistry.EntitySystems
                 pill.PillType = chemMaster.Comp.PillType;
                 Dirty(item, pill);
 
-                if (user.HasValue)
-                {
-                    // Log pill creation by a user
-                    _adminLogger.Add(LogType.Action, LogImpact.Low,
-                        $"{ToPrettyString(user.Value):user} printed {ToPrettyString(item):pill} {SolutionContainerSystem.ToPrettyString(itemSolution.Comp.Solution)}");
-                }
-                else
-                {
-                    // Log pill creation by magic? This should never happen... right?
-                    _adminLogger.Add(LogType.Action, LogImpact.Low,
-                        $"Unknown printed {ToPrettyString(item):pill} {SolutionContainerSystem.ToPrettyString(itemSolution.Comp.Solution)}");
-                }
+                // Log pill creation by a user
+                _adminLogger.Add(LogType.Action, LogImpact.Low,
+                    $"{ToPrettyString(user):user} printed {ToPrettyString(item):pill} {SharedSolutionContainerSystem.ToPrettyString(itemSolution.Comp.Solution)}");
             }
 
             UpdateUiState(chemMaster);
@@ -238,7 +229,7 @@ namespace Content.Server.Chemistry.EntitySystems
 
         private void OnOutputToBottleMessage(Entity<ChemMasterComponent> chemMaster, ref ChemMasterOutputToBottleMessage message)
         {
-            var user = message.Session.AttachedEntity;
+            var user = message.Actor;
             var maybeContainer = _itemSlotsSystem.GetItemOrNull(chemMaster, SharedChemMaster.OutputSlotName);
             if (maybeContainer is not { Valid: true } container
                 || !_solutionContainerSystem.TryGetSolution(container, SharedChemMaster.BottleSolutionName, out var soln, out var solution))
@@ -260,18 +251,9 @@ namespace Content.Server.Chemistry.EntitySystems
             _labelSystem.Label(container, message.Label);
             _solutionContainerSystem.TryAddSolution(soln.Value, withdrawal);
 
-            if (user.HasValue)
-            {
-                // Log bottle creation by a user
-                _adminLogger.Add(LogType.Action, LogImpact.Low,
-                    $"{ToPrettyString(user.Value):user} bottled {ToPrettyString(container):bottle} {SolutionContainerSystem.ToPrettyString(solution)}");
-            }
-            else
-            {
-                // Log bottle creation by magic? This should never happen... right?
-                _adminLogger.Add(LogType.Action, LogImpact.Low,
-                    $"Unknown bottled {ToPrettyString(container):bottle} {SolutionContainerSystem.ToPrettyString(solution)}");
-            }
+            // Log bottle creation by a user
+            _adminLogger.Add(LogType.Action, LogImpact.Low,
+                $"{ToPrettyString(user):user} bottled {ToPrettyString(container):bottle} {SharedSolutionContainerSystem.ToPrettyString(solution)}");
 
             UpdateUiState(chemMaster);
             ClickSound(chemMaster);
index d6433da56a0f92dc55e5b1ff5702045c878a3e7d..3bcdd4b964f8d0c18cc1f8bd6730e706ced82cff 100644 (file)
@@ -62,7 +62,7 @@ namespace Content.Server.Chemistry.EntitySystems
             var inventory = GetInventory(reagentDispenser);
 
             var state = new ReagentDispenserBoundUserInterfaceState(outputContainerInfo, GetNetEntity(outputContainer), inventory, reagentDispenser.Comp.DispenseAmount);
-            _userInterfaceSystem.TrySetUiState(reagentDispenser, ReagentDispenserUiKey.Key, state);
+            _userInterfaceSystem.SetUiState(reagentDispenser.Owner, ReagentDispenserUiKey.Key, state);
         }
 
         private ContainerInfo? BuildOutputContainerInfo(EntityUid? container)
index 41768066392a8aeeef52963b363e7181a7697e29..950a6599a890bbecf0d6c8740bcc38c0f4613419 100644 (file)
@@ -135,17 +135,17 @@ namespace Content.Server.Cloning
 
         public void UpdateUserInterface(EntityUid consoleUid, CloningConsoleComponent consoleComponent)
         {
-            if (!_uiSystem.TryGetUi(consoleUid, CloningConsoleUiKey.Key, out var ui))
+            if (!_uiSystem.HasUi(consoleUid, CloningConsoleUiKey.Key))
                 return;
 
             if (!_powerReceiverSystem.IsPowered(consoleUid))
             {
-                _uiSystem.CloseAll(ui);
+                _uiSystem.CloseUis(consoleUid);
                 return;
             }
 
             var newState = GetUserInterfaceState(consoleComponent);
-            _uiSystem.SetUiState(ui, newState);
+            _uiSystem.SetUiState(consoleUid, CloningConsoleUiKey.Key, newState);
         }
 
         public void TryClone(EntityUid uid, EntityUid cloningPodUid, EntityUid scannerUid, CloningPodComponent? cloningPod = null, MedicalScannerComponent? scannerComp = null, CloningConsoleComponent? consoleComponent = null)
index 23b772d99c0df6dee73fb46459805275dfd42d98..feb3428884ce37e32cd94fbfffb145ab072f4377 100644 (file)
@@ -64,7 +64,7 @@ public sealed class ChameleonClothingSystem : SharedChameleonClothingSystem
             return;
 
         var state = new ChameleonBoundUserInterfaceState(component.Slot, component.Default);
-        _uiSystem.TrySetUiState(uid, ChameleonUiKey.Key, state);
+        _uiSystem.SetUiState(uid, ChameleonUiKey.Key, state);
     }
 
     /// <summary>
index 6475e1a6d733d6f1d85990f8d7ca30b52a8e4361..61a18fe3d524b1f6a2dc6128cc625c0eb4ceca3a 100644 (file)
@@ -82,8 +82,8 @@ namespace Content.Server.Communications
 
                 comp.UIUpdateAccumulator -= UIUpdateInterval;
 
-                if (_uiSystem.TryGetUi(uid, CommunicationsConsoleUiKey.Key, out var ui) && ui.SubscribedSessions.Count > 0)
-                    UpdateCommsConsoleInterface(uid, comp, ui);
+                if (_uiSystem.IsUiOpen(uid, CommunicationsConsoleUiKey.Key))
+                    UpdateCommsConsoleInterface(uid, comp);
             }
 
             base.Update(frameTime);
@@ -136,11 +136,8 @@ namespace Content.Server.Communications
         /// <summary>
         /// Updates the UI for a particular comms console.
         /// </summary>
-        public void UpdateCommsConsoleInterface(EntityUid uid, CommunicationsConsoleComponent comp, PlayerBoundUserInterface? ui = null)
+        public void UpdateCommsConsoleInterface(EntityUid uid, CommunicationsConsoleComponent comp)
         {
-            if (ui == null && !_uiSystem.TryGetUi(uid, CommunicationsConsoleUiKey.Key, out ui))
-                return;
-
             var stationUid = _stationSystem.GetOwningStation(uid);
             List<string>? levels = null;
             string currentLevel = default!;
@@ -168,7 +165,7 @@ namespace Content.Server.Communications
                 }
             }
 
-            _uiSystem.SetUiState(ui, new CommunicationsConsoleInterfaceState(
+            _uiSystem.SetUiState(uid, CommunicationsConsoleUiKey.Key, new CommunicationsConsoleInterfaceState(
                 CanAnnounce(comp),
                 CanCallOrRecall(comp),
                 levels,
@@ -219,12 +216,12 @@ namespace Content.Server.Communications
 
         private void OnSelectAlertLevelMessage(EntityUid uid, CommunicationsConsoleComponent comp, CommunicationsConsoleSelectAlertLevelMessage message)
         {
-            if (message.Session.AttachedEntity is not { Valid: true } mob)
+            if (message.Actor is not { Valid: true } mob)
                 return;
 
             if (!CanUse(mob, uid))
             {
-                _popupSystem.PopupCursor(Loc.GetString("comms-console-permission-denied"), message.Session, PopupType.Medium);
+                _popupSystem.PopupCursor(Loc.GetString("comms-console-permission-denied"), message.Actor, PopupType.Medium);
                 return;
             }
 
@@ -241,7 +238,7 @@ namespace Content.Server.Communications
             var maxLength = _cfg.GetCVar(CCVars.ChatMaxAnnouncementLength);
             var msg = SharedChatSystem.SanitizeAnnouncement(message.Message, maxLength);
             var author = Loc.GetString("comms-console-announcement-unknown-sender");
-            if (message.Session.AttachedEntity is { Valid: true } mob)
+            if (message.Actor is { Valid: true } mob)
             {
                 if (!CanAnnounce(comp))
                 {
@@ -250,7 +247,7 @@ namespace Content.Server.Communications
 
                 if (!CanUse(mob, uid))
                 {
-                    _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session);
+                    _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Actor);
                     return;
                 }
 
@@ -263,7 +260,7 @@ namespace Content.Server.Communications
             comp.AnnouncementCooldownRemaining = comp.Delay;
             UpdateCommsConsoleInterface(uid, comp);
 
-            var ev = new CommunicationConsoleAnnouncementEvent(uid, comp, msg, message.Session.AttachedEntity);
+            var ev = new CommunicationConsoleAnnouncementEvent(uid, comp, msg, message.Actor);
             RaiseLocalEvent(ref ev);
 
             // allow admemes with vv
@@ -275,15 +272,14 @@ namespace Content.Server.Communications
             {
                 _chatSystem.DispatchGlobalAnnouncement(msg, title, announcementSound: comp.Sound, colorOverride: comp.Color);
 
-                if (message.Session.AttachedEntity != null)
-                    _adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Session.AttachedEntity.Value):player} has sent the following global announcement: {msg}");
-
+                _adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Actor):player} has sent the following global announcement: {msg}");
                 return;
             }
+
             _chatSystem.DispatchStationAnnouncement(uid, msg, title, colorOverride: comp.Color);
 
-            if (message.Session.AttachedEntity != null)
-                _adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Session.AttachedEntity.Value):player} has sent the following station announcement: {msg}");
+            _adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Actor):player} has sent the following station announcement: {msg}");
+
         }
 
         private void OnBroadcastMessage(EntityUid uid, CommunicationsConsoleComponent component, CommunicationsConsoleBroadcastMessage message)
@@ -298,8 +294,7 @@ namespace Content.Server.Communications
 
             _deviceNetworkSystem.QueuePacket(uid, null, payload, net.TransmitFrequency);
 
-            if (message.Session.AttachedEntity != null)
-                _adminLogger.Add(LogType.DeviceNetwork, LogImpact.Low, $"{ToPrettyString(message.Session.AttachedEntity.Value):player} has sent the following broadcast: {message.Message:msg}");
+            _adminLogger.Add(LogType.DeviceNetwork, LogImpact.Low, $"{ToPrettyString(message.Actor):player} has sent the following broadcast: {message.Message:msg}");
         }
 
         private void OnCallShuttleMessage(EntityUid uid, CommunicationsConsoleComponent comp, CommunicationsConsoleCallEmergencyShuttleMessage message)
@@ -307,12 +302,11 @@ namespace Content.Server.Communications
             if (!CanCallOrRecall(comp))
                 return;
 
-            if (message.Session.AttachedEntity is not { Valid: true } mob)
-                return;
+            var mob = message.Actor;
 
             if (!CanUse(mob, uid))
             {
-                _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session);
+                _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Actor);
                 return;
             }
 
@@ -320,7 +314,7 @@ namespace Content.Server.Communications
             RaiseLocalEvent(ref ev);
             if (ev.Cancelled)
             {
-                _popupSystem.PopupEntity(ev.Reason ?? Loc.GetString("comms-console-shuttle-unavailable"), uid, message.Session);
+                _popupSystem.PopupEntity(ev.Reason ?? Loc.GetString("comms-console-shuttle-unavailable"), uid, message.Actor);
                 return;
             }
 
@@ -333,17 +327,14 @@ namespace Content.Server.Communications
             if (!CanCallOrRecall(comp))
                 return;
 
-            if (message.Session.AttachedEntity is not { Valid: true } mob)
-                return;
-
-            if (!CanUse(mob, uid))
+            if (!CanUse(message.Actor, uid))
             {
-                _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session);
+                _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Actor);
                 return;
             }
 
             _roundEndSystem.CancelRoundEndCountdown(uid);
-            _adminLogger.Add(LogType.Action, LogImpact.Extreme, $"{ToPrettyString(mob):player} has recalled the shuttle.");
+            _adminLogger.Add(LogType.Action, LogImpact.Extreme, $"{ToPrettyString(message.Actor):player} has recalled the shuttle.");
         }
     }
 
index eb31149ecae48ade3dd74f5e5dd4cf51f3764856..2683bf4e09551b8833585e4e8d447fbcc530c073 100644 (file)
@@ -30,10 +30,7 @@ public sealed class ConfigurationSystem : EntitySystem
         if (!TryComp(args.Used, out ToolComponent? tool) || !tool.Qualities.Contains(component.QualityNeeded))
             return;
 
-        if (!TryComp(args.User, out ActorComponent? actor))
-            return;
-
-        args.Handled = _uiSystem.TryOpen(uid, ConfigurationUiKey.Key, actor.PlayerSession);
+        args.Handled = _uiSystem.TryOpenUi(uid, ConfigurationUiKey.Key, args.User);
     }
 
     private void OnStartup(EntityUid uid, ConfigurationComponent component, ComponentStartup args)
@@ -43,8 +40,8 @@ public sealed class ConfigurationSystem : EntitySystem
 
     private void UpdateUi(EntityUid uid, ConfigurationComponent component)
     {
-        if (_uiSystem.TryGetUi(uid, ConfigurationUiKey.Key, out var ui))
-            _uiSystem.SetUiState(ui, new ConfigurationBoundUserInterfaceState(component.Config));
+        if (_uiSystem.HasUi(uid, ConfigurationUiKey.Key))
+            _uiSystem.SetUiState(uid, ConfigurationUiKey.Key, new ConfigurationBoundUserInterfaceState(component.Config));
     }
 
     private void OnUpdate(EntityUid uid, ConfigurationComponent component, ConfigurationUpdatedMessage args)
index 32bb96e9e2879f18d2c56cef6229d5fcd9dcb884..07a13d8a34a476a441ad876fe034743c0b3f6011 100644 (file)
@@ -90,19 +90,14 @@ public sealed class CrayonSystem : SharedCrayonSystem
         if (args.Handled)
             return;
 
-        if (!TryComp<ActorComponent>(args.User, out var actor) ||
-            !_uiSystem.TryGetUi(uid, SharedCrayonComponent.CrayonUiKey.Key, out var ui))
+        if (!_uiSystem.HasUi(uid, SharedCrayonComponent.CrayonUiKey.Key))
         {
             return;
         }
 
-        _uiSystem.ToggleUi(ui, actor.PlayerSession);
-        if (ui.SubscribedSessions.Contains(actor.PlayerSession))
-        {
-            // Tell the user interface the selected stuff
-            _uiSystem.SetUiState(ui, new CrayonBoundUserInterfaceState(component.SelectedState, component.SelectableColor, component.Color));
-        }
+        _uiSystem.TryToggleUi(uid, SharedCrayonComponent.CrayonUiKey.Key, args.User);
 
+        _uiSystem.SetUiState(uid, SharedCrayonComponent.CrayonUiKey.Key, new CrayonBoundUserInterfaceState(component.SelectedState, component.SelectableColor, component.Color));
         args.Handled = true;
     }
 
@@ -140,8 +135,8 @@ public sealed class CrayonSystem : SharedCrayonSystem
 
     private void OnCrayonDropped(EntityUid uid, CrayonComponent component, DroppedEvent args)
     {
-        if (TryComp<ActorComponent>(args.User, out var actor))
-            _uiSystem.TryClose(uid, SharedCrayonComponent.CrayonUiKey.Key, actor.PlayerSession);
+        // TODO: Use the existing event.
+        _uiSystem.CloseUi(uid, SharedCrayonComponent.CrayonUiKey.Key, args.User);
     }
 
     private void UseUpCrayon(EntityUid uid, EntityUid user)
index 8b4cbac5c156e7b7a0fd272a23604c7e05448ca6..e7424560159e2047be5ed0b6470e3c2256992c4c 100644 (file)
@@ -100,12 +100,12 @@ public sealed class CrewManifestSystem : EntitySystem
             return;
 
         var owningStation = _stationSystem.GetOwningStation(uid);
-        if (owningStation == null || ev.Session is not { } session)
+        if (owningStation == null || !TryComp(ev.Actor, out ActorComponent? actorComp))
         {
             return;
         }
 
-        CloseEui(owningStation.Value, session, uid);
+        CloseEui(owningStation.Value, actorComp.PlayerSession, uid);
     }
 
     /// <summary>
@@ -136,12 +136,12 @@ public sealed class CrewManifestSystem : EntitySystem
         {
             Log.Error(
                 "{User} tried to open crew manifest from wrong UI: {Key}. Correct owned is {ExpectedKey}",
-                msg.Session, msg.UiKey, component.OwnerKey);
+                msg.Actor, msg.UiKey, component.OwnerKey);
             return;
         }
 
         var owningStation = _stationSystem.GetOwningStation(uid);
-        if (owningStation == null || msg.Session is not { } session)
+        if (owningStation == null || !TryComp(msg.Actor, out ActorComponent? actorComp))
         {
             return;
         }
@@ -151,7 +151,7 @@ public sealed class CrewManifestSystem : EntitySystem
             return;
         }
 
-        OpenEui(owningStation.Value, session, uid);
+        OpenEui(owningStation.Value, actorComp.PlayerSession, uid);
     }
 
     /// <summary>
index fe53ea268c7a27c429cd365e6b66ed48d2a2a155..4389c68c0493cb1da461600578e1cb3a4fed2cf0 100644 (file)
@@ -77,7 +77,7 @@ public sealed class CriminalRecordsConsoleSystem : SharedCriminalRecordsConsoleS
             msg.Status == SecurityStatus.Suspected != (msg.Reason != null))
             return;
 
-        if (!CheckSelected(ent, msg.Session, out var mob, out var key))
+        if (!CheckSelected(ent, msg.Actor, out var mob, out var key))
             return;
 
         if (!_stationRecords.TryGetRecord<CriminalRecord>(key.Value, out var record) || record.Status == msg.Status)
@@ -150,7 +150,7 @@ public sealed class CriminalRecordsConsoleSystem : SharedCriminalRecordsConsoleS
 
     private void OnAddHistory(Entity<CriminalRecordsConsoleComponent> ent, ref CriminalRecordAddHistory msg)
     {
-        if (!CheckSelected(ent, msg.Session, out _, out var key))
+        if (!CheckSelected(ent, msg.Actor, out _, out var key))
             return;
 
         var line = msg.Line.Trim();
@@ -167,7 +167,7 @@ public sealed class CriminalRecordsConsoleSystem : SharedCriminalRecordsConsoleS
 
     private void OnDeleteHistory(Entity<CriminalRecordsConsoleComponent> ent, ref CriminalRecordDeleteHistory msg)
     {
-        if (!CheckSelected(ent, msg.Session, out _, out var key))
+        if (!CheckSelected(ent, msg.Actor, out _, out var key))
             return;
 
         if (!_criminalRecords.TryDeleteHistory(key.Value, msg.Index))
@@ -185,7 +185,7 @@ public sealed class CriminalRecordsConsoleSystem : SharedCriminalRecordsConsoleS
 
         if (!TryComp<StationRecordsComponent>(owningStation, out var stationRecords))
         {
-            _ui.TrySetUiState(uid, CriminalRecordsConsoleKey.Key, new CriminalRecordsConsoleState());
+            _ui.SetUiState(uid, CriminalRecordsConsoleKey.Key, new CriminalRecordsConsoleState());
             return;
         }
 
@@ -201,24 +201,22 @@ public sealed class CriminalRecordsConsoleSystem : SharedCriminalRecordsConsoleS
             state.SelectedKey = id;
         }
 
-        _ui.TrySetUiState(uid, CriminalRecordsConsoleKey.Key, state);
+        _ui.SetUiState(uid, CriminalRecordsConsoleKey.Key, state);
     }
 
     /// <summary>
     /// Boilerplate that most actions use, if they require that a record be selected.
     /// Obviously shouldn't be used for selecting records.
     /// </summary>
-    private bool CheckSelected(Entity<CriminalRecordsConsoleComponent> ent, ICommonSession session,
+    private bool CheckSelected(Entity<CriminalRecordsConsoleComponent> ent, EntityUid user,
         [NotNullWhen(true)] out EntityUid? mob, [NotNullWhen(true)] out StationRecordKey? key)
     {
         key = null;
         mob = null;
-        if (session.AttachedEntity is not { } user)
-            return false;
 
         if (!_access.IsAllowed(user, ent))
         {
-            _popup.PopupEntity(Loc.GetString("criminal-records-permission-denied"), ent, session);
+            _popup.PopupEntity(Loc.GetString("criminal-records-permission-denied"), ent, user);
             return false;
         }
 
index 0e214ee865a47433dab0495ee9e60fee7ecc98e8..14e0c75d9629c454de4b4736c509ae0dd2ae02d1 100644 (file)
@@ -48,9 +48,9 @@ public sealed class SignalTimerSystem : EntitySystem
     {
         var time = TryComp<ActiveSignalTimerComponent>(uid, out var active) ? active.TriggerTime : TimeSpan.Zero;
 
-        if (_ui.TryGetUi(uid, SignalTimerUiKey.Key, out var bui))
+        if (_ui.HasUi(uid, SignalTimerUiKey.Key))
         {
-            _ui.SetUiState(bui, new SignalTimerBoundUserInterfaceState(component.Label,
+            _ui.SetUiState(uid, SignalTimerUiKey.Key, new SignalTimerBoundUserInterfaceState(component.Label,
                 TimeSpan.FromSeconds(component.Delay).Minutes.ToString("D2"),
                 TimeSpan.FromSeconds(component.Delay).Seconds.ToString("D2"),
                 component.CanEditLabel,
@@ -70,9 +70,9 @@ public sealed class SignalTimerSystem : EntitySystem
         _audio.PlayPvs(signalTimer.DoneSound, uid);
         _signalSystem.InvokePort(uid, signalTimer.TriggerPort);
 
-        if (_ui.TryGetUi(uid, SignalTimerUiKey.Key, out var bui))
+        if (_ui.HasUi(uid, SignalTimerUiKey.Key))
         {
-            _ui.SetUiState(bui, new SignalTimerBoundUserInterfaceState(signalTimer.Label,
+            _ui.SetUiState(uid, SignalTimerUiKey.Key, new SignalTimerBoundUserInterfaceState(signalTimer.Label,
                 TimeSpan.FromSeconds(signalTimer.Delay).Minutes.ToString("D2"),
                 TimeSpan.FromSeconds(signalTimer.Delay).Seconds.ToString("D2"),
                 signalTimer.CanEditLabel,
@@ -117,10 +117,7 @@ public sealed class SignalTimerSystem : EntitySystem
     /// <param name="uid">The entity that is interacted with.</param>
     private bool IsMessageValid(EntityUid uid, BoundUserInterfaceMessage message)
     {
-        if (message.Session.AttachedEntity is not { Valid: true } mob)
-            return false;
-
-        if (!_accessReader.IsAllowed(mob, uid))
+        if (!_accessReader.IsAllowed(message.Actor, uid))
             return false;
 
         return true;
index 02c65381584649f105406449a3d01ae40949f4fc..b68f8a594b84f00cfd7468505a5531ea3228f294 100644 (file)
@@ -89,7 +89,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
                 continue;
 
             //The network configurator is a handheld device. There can only ever be an ui session open for the player holding the device.
-            _uiSystem.TryCloseAll(uid, NetworkConfiguratorUiKey.Configure);
+            _uiSystem.CloseUi(uid, NetworkConfiguratorUiKey.Configure);
         }
     }
 
@@ -215,7 +215,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
 
     private void OnComponentRemoved(EntityUid uid, DeviceListComponent component, ComponentRemove args)
     {
-        _uiSystem.TryCloseAll(uid, NetworkConfiguratorUiKey.Configure);
+        _uiSystem.CloseUi(uid, NetworkConfiguratorUiKey.Configure);
     }
 
     /// <summary>
@@ -433,7 +433,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
             return;
 
 
-        _uiSystem.TryOpen(configuratorUid, NetworkConfiguratorUiKey.Link, actor.PlayerSession);
+        _uiSystem.OpenUi(configuratorUid, NetworkConfiguratorUiKey.Link, actor.PlayerSession);
         configurator.DeviceLinkTarget = targetUid;
 
 
@@ -464,7 +464,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         var sinkAddress = Resolve(sinkUid, ref sinkNetworkComponent, false) ? sinkNetworkComponent.Address : "";
 
         var state = new DeviceLinkUserInterfaceState(sources, sinks, links, sourceAddress, sinkAddress, defaults);
-        _uiSystem.TrySetUiState(configuratorUid, NetworkConfiguratorUiKey.Link, state);
+        _uiSystem.SetUiState(configuratorUid, NetworkConfiguratorUiKey.Link, state);
     }
 
     /// <summary>
@@ -478,7 +478,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         if (Delay(configurator))
             return;
 
-        if (!targetUid.HasValue || !TryComp(userUid, out ActorComponent? actor) || !AccessCheck(targetUid.Value, userUid, configurator))
+        if (!targetUid.HasValue || !AccessCheck(targetUid.Value, userUid, configurator))
             return;
 
         if (!TryComp(targetUid, out DeviceListComponent? list))
@@ -488,14 +488,13 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         configurator.ActiveDeviceList = targetUid;
         Dirty(configuratorUid, configurator);
 
-        if (!_uiSystem.TryGetUi(configuratorUid, NetworkConfiguratorUiKey.Configure, out var bui))
-            return;
-
-        if (_uiSystem.OpenUi(bui, actor.PlayerSession))
-            _uiSystem.SetUiState(bui, new DeviceListUserInterfaceState(
+        if (_uiSystem.TryOpenUi(configuratorUid, NetworkConfiguratorUiKey.Configure, userUid))
+        {
+            _uiSystem.SetUiState(configuratorUid, NetworkConfiguratorUiKey.Configure, new DeviceListUserInterfaceState(
                 _deviceListSystem.GetDeviceList(configurator.ActiveDeviceList.Value)
                     .Select(v => (v.Key, MetaData(v.Value).EntityName)).ToHashSet()
             ));
+        }
     }
 
     /// <summary>
@@ -523,8 +522,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
             component.Devices.Remove(invalidDevice);
         }
 
-        if (_uiSystem.TryGetUi(uid, NetworkConfiguratorUiKey.List, out var bui))
-            _uiSystem.SetUiState(bui, new NetworkConfiguratorUserInterfaceState(devices));
+        _uiSystem.SetUiState(uid, NetworkConfiguratorUiKey.List, new NetworkConfiguratorUserInterfaceState(devices));
     }
 
     /// <summary>
@@ -565,10 +563,10 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
     /// </summary>
     private void OnRemoveDevice(EntityUid uid, NetworkConfiguratorComponent component, NetworkConfiguratorRemoveDeviceMessage args)
     {
-        if (component.Devices.TryGetValue(args.Address, out var removedDevice) && args.Session.AttachedEntity != null)
+        if (component.Devices.TryGetValue(args.Address, out var removedDevice))
         {
             _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
-                $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} removed buffered device {ToPrettyString(removedDevice):subject} from {ToPrettyString(uid):tool}");
+                $"{ToPrettyString(args.Actor):actor} removed buffered device {ToPrettyString(removedDevice):subject} from {ToPrettyString(uid):tool}");
         }
 
         component.Devices.Remove(args.Address);
@@ -583,10 +581,8 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
     /// </summary>
     private void OnClearDevice(EntityUid uid, NetworkConfiguratorComponent component, NetworkConfiguratorClearDevicesMessage args)
     {
-        if (args.Session.AttachedEntity != null)
-            _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
-                $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} cleared buffered devices from {ToPrettyString(uid):tool}");
-
+        _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
+            $"{ToPrettyString(args.Actor):actor} cleared buffered devices from {ToPrettyString(uid):tool}");
 
         ClearDevices(uid, component);
         UpdateListUiState(uid, component);
@@ -609,9 +605,8 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         if (!configurator.ActiveDeviceLink.HasValue || !configurator.DeviceLinkTarget.HasValue)
             return;
 
-        if (args.Session.AttachedEntity != null)
-            _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
-                $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} cleared links between {ToPrettyString(configurator.ActiveDeviceLink.Value):subject} and {ToPrettyString(configurator.DeviceLinkTarget.Value):subject2} with {ToPrettyString(uid):tool}");
+        _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
+            $"{ToPrettyString(args.Actor):actor} cleared links between {ToPrettyString(configurator.ActiveDeviceLink.Value):subject} and {ToPrettyString(configurator.DeviceLinkTarget.Value):subject2} with {ToPrettyString(uid):tool}");
 
         if (HasComp<DeviceLinkSourceComponent>(configurator.ActiveDeviceLink) && HasComp<DeviceLinkSinkComponent>(configurator.DeviceLinkTarget))
         {
@@ -649,7 +644,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         if (TryComp(configurator.ActiveDeviceLink, out DeviceLinkSourceComponent? activeSource) && TryComp(configurator.DeviceLinkTarget, out DeviceLinkSinkComponent? targetSink))
         {
             _deviceLinkSystem.ToggleLink(
-                args.Session.AttachedEntity,
+                args.Actor,
                 configurator.ActiveDeviceLink.Value,
                 configurator.DeviceLinkTarget.Value,
                 args.Source, args.Sink,
@@ -660,7 +655,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         else if (TryComp(configurator.DeviceLinkTarget, out DeviceLinkSourceComponent? targetSource) && TryComp(configurator.ActiveDeviceLink, out DeviceLinkSinkComponent? activeSink))
         {
             _deviceLinkSystem.ToggleLink(
-                args.Session.AttachedEntity,
+                args.Actor,
                 configurator.DeviceLinkTarget.Value,
                 configurator.ActiveDeviceLink.Value,
                 args.Source, args.Sink,
@@ -687,7 +682,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         if (TryComp(configurator.ActiveDeviceLink, out DeviceLinkSourceComponent? activeSource) && TryComp(configurator.DeviceLinkTarget, out DeviceLinkSinkComponent? targetSink))
         {
             _deviceLinkSystem.SaveLinks(
-                args.Session.AttachedEntity,
+                args.Actor,
                 configurator.ActiveDeviceLink.Value,
                 configurator.DeviceLinkTarget.Value,
                 args.Links,
@@ -705,7 +700,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         else if (TryComp(configurator.DeviceLinkTarget, out DeviceLinkSourceComponent? targetSource) && TryComp(configurator.ActiveDeviceLink, out DeviceLinkSinkComponent? activeSink))
         {
             _deviceLinkSystem.SaveLinks(
-                args.Session.AttachedEntity,
+                args.Actor,
                 configurator.DeviceLinkTarget.Value,
                 configurator.ActiveDeviceLink.Value,
                 args.Links,
@@ -735,29 +730,25 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         switch (args.ButtonKey)
         {
             case NetworkConfiguratorButtonKey.Set:
-                if (args.Session.AttachedEntity != null)
-                    _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
-                        $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} set device links to {ToPrettyString(component.ActiveDeviceList.Value):subject} with {ToPrettyString(uid):tool}");
+                _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
+                    $"{ToPrettyString(args.Actor):actor} set device links to {ToPrettyString(component.ActiveDeviceList.Value):subject} with {ToPrettyString(uid):tool}");
 
                 result = _deviceListSystem.UpdateDeviceList(component.ActiveDeviceList.Value, new HashSet<EntityUid>(component.Devices.Values));
                 break;
             case NetworkConfiguratorButtonKey.Add:
-                if (args.Session.AttachedEntity != null)
-                    _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
-                        $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} added device links to {ToPrettyString(component.ActiveDeviceList.Value):subject} with {ToPrettyString(uid):tool}");
+                _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
+                    $"{ToPrettyString(args.Actor):actor} added device links to {ToPrettyString(component.ActiveDeviceList.Value):subject} with {ToPrettyString(uid):tool}");
 
                 result = _deviceListSystem.UpdateDeviceList(component.ActiveDeviceList.Value, new HashSet<EntityUid>(component.Devices.Values), true);
                 break;
             case NetworkConfiguratorButtonKey.Clear:
-                if (args.Session.AttachedEntity != null)
-                    _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
-                        $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} cleared device links from {ToPrettyString(component.ActiveDeviceList.Value):subject} with {ToPrettyString(uid):tool}");
+                _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
+                    $"{ToPrettyString(args.Actor):actor} cleared device links from {ToPrettyString(component.ActiveDeviceList.Value):subject} with {ToPrettyString(uid):tool}");
                 result = _deviceListSystem.UpdateDeviceList(component.ActiveDeviceList.Value, new HashSet<EntityUid>());
                 break;
             case NetworkConfiguratorButtonKey.Copy:
-                if (args.Session.AttachedEntity != null)
-                    _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
-                        $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} copied devices from {ToPrettyString(component.ActiveDeviceList.Value):subject} to {ToPrettyString(uid):tool}");
+                _adminLogger.Add(LogType.DeviceLinking, LogImpact.Low,
+                    $"{ToPrettyString(args.Actor):actor} copied devices from {ToPrettyString(component.ActiveDeviceList.Value):subject} to {ToPrettyString(uid):tool}");
 
                 ClearDevices(uid, component);
 
@@ -783,8 +774,8 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
             _ => "error"
         };
 
-        _popupSystem.PopupCursor(Loc.GetString(resultText), args.Session, PopupType.Medium);
-        _uiSystem.TrySetUiState(
+        _popupSystem.PopupCursor(Loc.GetString(resultText), args.Actor, PopupType.Medium);
+        _uiSystem.SetUiState(
             uid,
             NetworkConfiguratorUiKey.Configure,
             new DeviceListUserInterfaceState(
index 001abad3dcd9264f6aa74e9d7869845e4103974e..8e9c9e4ba73a4551e31422c43b5f98e2cedc1bb3 100644 (file)
@@ -159,8 +159,7 @@ public sealed class MailingUnitSystem : EntitySystem
 
         args.Handled = true;
         UpdateTargetList(uid, component);
-        if (_userInterfaceSystem.TryGetUi(uid, MailingUnitUiKey.Key, out var bui))
-            _userInterfaceSystem.OpenUi(bui, actor.PlayerSession);
+        _userInterfaceSystem.OpenUi(uid, MailingUnitUiKey.Key, actor.PlayerSession);
     }
 
     /// <summary>
@@ -178,8 +177,7 @@ public sealed class MailingUnitSystem : EntitySystem
             return;
 
         var state = new MailingUnitBoundUserInterfaceState(component.DisposalUnitInterfaceState, component.Target, component.TargetList, component.Tag);
-        if (_userInterfaceSystem.TryGetUi(uid, MailingUnitUiKey.Key, out var bui))
-            _userInterfaceSystem.SetUiState(bui, state);
+        _userInterfaceSystem.SetUiState(uid, MailingUnitUiKey.Key, state);
     }
 
     private void OnTargetSelected(EntityUid uid, MailingUnitComponent component, TargetSelectedMessage args)
index 6c0bced53e0f7c4c8be0ebf2787b87bed19972f3..f0f6e9142c693dad44c403ea08beac11d716e8cd 100644 (file)
@@ -101,8 +101,9 @@ namespace Content.Server.Disposal.Tube
         /// <param name="msg">A user interface message from the client.</param>
         private void OnUiAction(EntityUid uid, DisposalRouterComponent router, SharedDisposalRouterComponent.UiActionMessage msg)
         {
-            if (!EntityManager.EntityExists(msg.Session.AttachedEntity))
+            if (!EntityManager.EntityExists(msg.Actor))
                 return;
+
             if (TryComp<PhysicsComponent>(uid, out var physBody) && physBody.BodyType != BodyType.Static)
                 return;
 
@@ -279,9 +280,9 @@ namespace Content.Server.Disposal.Tube
 
         private void OnOpenTaggerUI(EntityUid uid, DisposalTaggerComponent tagger, BoundUIOpenedEvent args)
         {
-            if (_uiSystem.TryGetUi(uid, DisposalTaggerUiKey.Key, out var bui))
+            if (_uiSystem.HasUi(uid, DisposalTaggerUiKey.Key))
             {
-                _uiSystem.SetUiState(bui,
+                _uiSystem.SetUiState(uid, DisposalTaggerUiKey.Key,
                     new DisposalTaggerUserInterfaceState(tagger.Tag));
             }
         }
@@ -292,13 +293,9 @@ namespace Content.Server.Disposal.Tube
         /// <returns>Returns a <see cref="SharedDisposalRouterComponent.DisposalRouterUserInterfaceState"/></returns>
         private void UpdateRouterUserInterface(EntityUid uid, DisposalRouterComponent router)
         {
-            var bui = _uiSystem.GetUiOrNull(uid, DisposalRouterUiKey.Key);
-            if (bui == null)
-                return;
-
             if (router.Tags.Count <= 0)
             {
-                _uiSystem.SetUiState(bui, new DisposalRouterUserInterfaceState(""));
+                _uiSystem.SetUiState(uid, DisposalRouterUiKey.Key, new DisposalRouterUserInterfaceState(""));
                 return;
             }
 
@@ -312,7 +309,7 @@ namespace Content.Server.Disposal.Tube
 
             taglist.Remove(taglist.Length - 2, 2);
 
-            _uiSystem.SetUiState(bui, new DisposalRouterUserInterfaceState(taglist.ToString()));
+            _uiSystem.SetUiState(uid, DisposalRouterUiKey.Key, new DisposalRouterUserInterfaceState(taglist.ToString()));
         }
 
         private void OnAnchorChange(EntityUid uid, DisposalTubeComponent component, ref AnchorStateChangedEvent args)
index ba84546258738b3f6bd80373176ea87a63d6c22b..21e152c1035f01e6ad5aff0d59951a898be22eb9 100644 (file)
@@ -219,7 +219,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
     #region UI Handlers
     private void OnUiButtonPressed(EntityUid uid, SharedDisposalUnitComponent component, SharedDisposalUnitComponent.UiButtonPressedMessage args)
     {
-        if (args.Session.AttachedEntity is not { Valid: true } player)
+        if (args.Actor is not { Valid: true } player)
         {
             return;
         }
@@ -235,7 +235,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
                 _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(player):player} hit flush button on {ToPrettyString(uid)}, it's now {(component.Engaged ? "on" : "off")}");
                 break;
             case SharedDisposalUnitComponent.UiButton.Power:
-                _power.TogglePower(uid, user: args.Session.AttachedEntity);
+                _power.TogglePower(uid, user: args.Actor);
                 break;
             default:
                 throw new ArgumentOutOfRangeException($"{ToPrettyString(player):player} attempted to hit a nonexistant button on {ToPrettyString(uid)}");
@@ -268,7 +268,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
         }
 
         args.Handled = true;
-        _ui.TryOpen(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, actor.PlayerSession);
+        _ui.OpenUi(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, actor.PlayerSession);
     }
 
     private void OnAfterInteractUsing(EntityUid uid, SharedDisposalUnitComponent component, AfterInteractUsingEvent args)
@@ -597,7 +597,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
         var compState = GetState(uid, component);
         var stateString = Loc.GetString($"disposal-unit-state-{compState}");
         var state = new SharedDisposalUnitComponent.DisposalUnitBoundUserInterfaceState(Name(uid), stateString, EstimatedFullPressure(uid, component), powered, component.Engaged);
-        _ui.TrySetUiState(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, state);
+        _ui.SetUiState(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, state);
 
         var stateUpdatedEvent = new DisposalUnitUIStateUpdatedEvent(state);
         RaiseLocalEvent(uid, stateUpdatedEvent);
@@ -802,10 +802,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
 
         QueueAutomaticEngage(uid, component);
 
-        if (TryComp(inserted, out ActorComponent? actor))
-        {
-            _ui.TryClose(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, actor.PlayerSession);
-        }
+        _ui.CloseUi(uid, SharedDisposalUnitComponent.DisposalUnitUiKey.Key, inserted);
 
         // Maybe do pullable instead? Eh still fine.
         Joints.RecursiveClearJoints(inserted);
index 56e8bd50b324576427e8a92d9b0d1637885f204d..af9ccadd91cf3141bfd03f32ecb8969b50365c4e 100644 (file)
@@ -39,7 +39,7 @@ public sealed class DoorElectronicsSystem : EntitySystem
         }
 
         var state = new DoorElectronicsConfigurationState(accesses);
-        _uiSystem.TrySetUiState(uid, DoorElectronicsConfigurationUiKey.Key, state);
+        _uiSystem.SetUiState(uid, DoorElectronicsConfigurationUiKey.Key, state);
     }
 
     private void OnChangeConfiguration(
index fe10b4a574a673a303c3c181157ec0000e8015b1..991fc76c62e3f8f9bec28740acbfa46c8ef8b122 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.GameStates;
 
 namespace Content.Server.Extinguisher;
 
-[NetworkedComponent, RegisterComponent]
+[RegisterComponent]
 [Access(typeof(FireExtinguisherSystem))]
 public sealed partial class FireExtinguisherComponent : SharedFireExtinguisherComponent
 {
index b51efc2f5e16878320c6a18b9f93bf0333f3a920..7b937cf0d818d2c3aa60e84d0c9cbfb01ca79f90 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Eye.Blinding.Components;
 using Content.Shared.Eye.Blinding.Systems;
 using Robust.Shared.Player;
 using Robust.Server.GameObjects;
+using Robust.Shared.Collections;
 
 namespace Content.Server.Eye.Blinding;
 
@@ -37,24 +38,19 @@ public sealed class ActivatableUIRequiresVisionSystem : EntitySystem
         if (!args.Blind)
             return;
 
-        if (!TryComp<ActorComponent>(uid, out var actor))
-            return;
-
-        var uiList = _userInterfaceSystem.GetAllUIsForSession(actor.PlayerSession);
-        if (uiList == null)
-            return;
-
-        Queue<PlayerBoundUserInterface> closeList = new(); // foreach collection modified moment
+        var toClose = new ValueList<(EntityUid Entity, Enum Key)>();
 
-        foreach (var ui in uiList)
+        foreach (var bui in _userInterfaceSystem.GetActorUis(uid))
         {
-            if (HasComp<ActivatableUIRequiresVisionComponent>(ui.Owner))
-                closeList.Enqueue(ui);
+            if (HasComp<ActivatableUIRequiresVisionComponent>(bui.Entity))
+            {
+                toClose.Add(bui);
+            }
         }
 
-        foreach (var ui in closeList)
+        foreach (var bui in toClose)
         {
-            _userInterfaceSystem.CloseUi(ui, actor.PlayerSession);
+            _userInterfaceSystem.CloseUi(bui.Entity, bui.Key, uid);
         }
     }
 }
index 3ff139466f5c5484b8ea0e8fca9b74928630913a..f492595444aae54635babbbd43d93b334e3d2118 100644 (file)
@@ -51,7 +51,7 @@ public sealed class FaxSystem : EntitySystem
     /// </summary>
     [ValidatePrototypeId<EntityPrototype>]
     private const string DefaultPaperPrototypeId = "Paper";
-    
+
     [ValidatePrototypeId<EntityPrototype>]
     private const string OfficePaperPrototypeId = "PaperOffice";
 
@@ -318,7 +318,7 @@ public sealed class FaxSystem : EntitySystem
 
     private void OnSendButtonPressed(EntityUid uid, FaxMachineComponent component, FaxSendMessage args)
     {
-        Send(uid, component, args.Session.AttachedEntity);
+        Send(uid, component, args.Actor);
     }
 
     private void OnRefreshButtonPressed(EntityUid uid, FaxMachineComponent component, FaxRefreshMessage args)
@@ -358,7 +358,7 @@ public sealed class FaxSystem : EntitySystem
                       component.SendTimeoutRemaining <= 0 &&
                       component.InsertingTimeRemaining <= 0;
         var state = new FaxUiState(component.FaxName, component.KnownFaxes, canSend, canCopy, isPaperInserted, component.DestinationFaxAddress);
-        _userInterface.TrySetUiState(uid, FaxUiKey.Key, state);
+        _userInterface.SetUiState(uid, FaxUiKey.Key, state);
     }
 
     /// <summary>
@@ -410,19 +410,15 @@ public sealed class FaxSystem : EntitySystem
             prototype = DefaultPaperPrototypeId;
 
         var name  = Loc.GetString("fax-machine-printed-paper-name");
-        
+
         var printout = new FaxPrintout(args.Content, name, prototype);
         component.PrintingQueue.Enqueue(printout);
         component.SendTimeoutRemaining += component.SendTimeout;
 
         UpdateUserInterface(uid, component);
 
-        if (args.Session.AttachedEntity != null)
-            _adminLogger.Add(LogType.Action, LogImpact.Low,
-                $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} added print job to {ToPrettyString(uid):tool} with text: {args.Content}");
-        else
-            _adminLogger.Add(LogType.Action, LogImpact.Low,
-                $"Someone added print job to {ToPrettyString(uid):tool} with text: {args.Content}");
+        _adminLogger.Add(LogType.Action, LogImpact.Low,
+            $"{ToPrettyString(args.Actor):actor} added print job to {ToPrettyString(uid):tool} with text: {args.Content}");
     }
 
     /// <summary>
@@ -457,9 +453,8 @@ public sealed class FaxSystem : EntitySystem
 
         UpdateUserInterface(uid, component);
 
-        if (args.Session.AttachedEntity != null)
-            _adminLogger.Add(LogType.Action, LogImpact.Low,
-                $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} added copy job to {ToPrettyString(uid):tool} with text: {ToPrettyString(component.PaperSlot.Item):subject}");
+        _adminLogger.Add(LogType.Action, LogImpact.Low,
+            $"{ToPrettyString(args.Actor):actor} added copy job to {ToPrettyString(uid):tool} with text: {ToPrettyString(component.PaperSlot.Item):subject}");
     }
 
     /// <summary>
index 729b7304fad7ae1939901a63fe3bec14efe4df0d..5e2a562577d96fd9c0006a59f32bab3c3e670a3d 100644 (file)
@@ -52,8 +52,7 @@ namespace Content.Server.Forensics
                 component.PrintCooldown,
                 component.PrintReadyAt);
 
-            if (!_uiSystem.TrySetUiState(uid, ForensicScannerUiKey.Key, state))
-                Log.Warning($"{ToPrettyString(uid)} was unable to set UI state.");
+            _uiSystem.SetUiState(uid, ForensicScannerUiKey.Key, state);
         }
 
         private void OnDoAfter(EntityUid uid, ForensicScannerComponent component, DoAfterEvent args)
@@ -163,23 +162,14 @@ namespace Content.Server.Forensics
 
         private void OpenUserInterface(EntityUid user, Entity<ForensicScannerComponent> scanner)
         {
-            if (!TryComp<ActorComponent>(user, out var actor))
-                return;
-
             UpdateUserInterface(scanner, scanner.Comp);
 
-            _uiSystem.TryOpen(scanner, ForensicScannerUiKey.Key, actor.PlayerSession);
+            _uiSystem.OpenUi(scanner.Owner, ForensicScannerUiKey.Key, user);
         }
 
         private void OnPrint(EntityUid uid, ForensicScannerComponent component, ForensicScannerPrintMessage args)
         {
-            if (!args.Session.AttachedEntity.HasValue)
-            {
-                Log.Warning($"{ToPrettyString(uid)} got OnPrint without Session.AttachedEntity");
-                return;
-            }
-
-            var user = args.Session.AttachedEntity.Value;
+            var user = args.Actor;
 
             if (_gameTiming.CurTime < component.PrintReadyAt)
             {
@@ -191,7 +181,7 @@ namespace Content.Server.Forensics
 
             // Spawn a piece of paper.
             var printed = EntityManager.SpawnEntity(component.MachineOutput, Transform(uid).Coordinates);
-            _handsSystem.PickupOrDrop(args.Session.AttachedEntity, printed, checkActionBlocker: false);
+            _handsSystem.PickupOrDrop(args.Actor, printed, checkActionBlocker: false);
 
             if (!HasComp<PaperComponent>(printed))
             {
@@ -240,9 +230,6 @@ namespace Content.Server.Forensics
 
         private void OnClear(EntityUid uid, ForensicScannerComponent component, ForensicScannerClearMessage args)
         {
-            if (!args.Session.AttachedEntity.HasValue)
-                return;
-
             component.Fingerprints = new();
             component.Fibers = new();
             component.DNAs = new();
index 7ebc751dd2d39b743e1f4e31d56d2a0beb897869..6ed28d71a763cc3b9c093e329c4668157fe7f410 100644 (file)
@@ -129,7 +129,7 @@ public sealed class GatewaySystem : EntitySystem
             unlockTime
         );
 
-        _ui.TrySetUiState(uid, GatewayUiKey.Key, state);
+        _ui.SetUiState(uid, GatewayUiKey.Key, state);
     }
 
     private void UpdateAppearance(EntityUid uid)
@@ -139,12 +139,14 @@ public sealed class GatewaySystem : EntitySystem
 
     private void OnOpenPortal(EntityUid uid, GatewayComponent comp, GatewayOpenPortalMessage args)
     {
-        if (args.Session.AttachedEntity == null || GetNetEntity(uid) == args.Destination ||
+        if (GetNetEntity(uid) == args.Destination ||
             !comp.Enabled || !comp.Interactable)
+        {
             return;
+        }
 
         // if the gateway has an access reader check it before allowing opening
-        var user = args.Session.AttachedEntity.Value;
+        var user = args.Actor;
         if (CheckAccess(user, uid, comp))
             return;
 
index b0c4bb56ff375353e930d3a5cfa597074645f4ad..8e4da75fac8221cd27489147766ca7f1148e4ecf 100644 (file)
@@ -131,13 +131,13 @@ namespace Content.Server.Gravity
         }
 
         private void SetSwitchedOn(EntityUid uid, GravityGeneratorComponent component, bool on,
-            ApcPowerReceiverComponent? powerReceiver = null, ICommonSession? session = null)
+            ApcPowerReceiverComponent? powerReceiver = null, EntityUid? user = null)
         {
             if (!Resolve(uid, ref powerReceiver))
                 return;
 
-            if (session is { AttachedEntity: { } })
-                _adminLogger.Add(LogType.Action, on ? LogImpact.Medium : LogImpact.High, $"{session:player} set ${ToPrettyString(uid):target} to {(on ? "on" : "off")}");
+            if (user != null)
+                _adminLogger.Add(LogType.Action, on ? LogImpact.Medium : LogImpact.High, $"{ToPrettyString(user)} set ${ToPrettyString(uid):target} to {(on ? "on" : "off")}");
 
             component.SwitchedOn = on;
             UpdatePowerState(component, powerReceiver);
@@ -154,7 +154,7 @@ namespace Content.Server.Gravity
         private void UpdateUI(Entity<GravityGeneratorComponent, ApcPowerReceiverComponent> ent, float chargeRate)
         {
             var (_, component, powerReceiver) = ent;
-            if (!_uiSystem.IsUiOpen(ent, SharedGravityGeneratorComponent.GravityGeneratorUiKey.Key))
+            if (!_uiSystem.IsUiOpen(ent.Owner, SharedGravityGeneratorComponent.GravityGeneratorUiKey.Key))
                 return;
 
             var chargeTarget = chargeRate < 0 ? 0 : component.MaxCharge;
@@ -189,8 +189,8 @@ namespace Content.Server.Gravity
                 chargeEta
             );
 
-            _uiSystem.TrySetUiState(
-                ent,
+            _uiSystem.SetUiState(
+                ent.Owner,
                 SharedGravityGeneratorComponent.GravityGeneratorUiKey.Key,
                 state);
 
@@ -209,9 +209,6 @@ namespace Content.Server.Gravity
 
         private void OnInteractHand(EntityUid uid, GravityGeneratorComponent component, InteractHandEvent args)
         {
-            if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
-                return;
-
             ApcPowerReceiverComponent? powerReceiver = default!;
             if (!Resolve(uid, ref powerReceiver))
                 return;
@@ -220,7 +217,7 @@ namespace Content.Server.Gravity
             if (!component.Intact || powerReceiver.PowerReceived < component.IdlePowerUse)
                 return;
 
-            _uiSystem.TryOpen(uid, SharedGravityGeneratorComponent.GravityGeneratorUiKey.Key, actor.PlayerSession);
+            _uiSystem.OpenUi(uid, SharedGravityGeneratorComponent.GravityGeneratorUiKey.Key, args.User);
             component.NeedUIUpdate = true;
         }
 
@@ -287,7 +284,7 @@ namespace Content.Server.Gravity
             GravityGeneratorComponent component,
             SharedGravityGeneratorComponent.SwitchGeneratorMessage args)
         {
-            SetSwitchedOn(uid, component, args.On, session:args.Session);
+            SetSwitchedOn(uid, component, args.On, user: args.Actor);
         }
     }
 }
index 336116e78b0ec9c47ceb131151f2bf2835c019cc..7744d161519fb42bd1fc13f0f750a5ef01745326 100644 (file)
@@ -32,8 +32,8 @@ public sealed partial class HumanoidAppearanceSystem
             Icon = new SpriteSpecifier.Rsi(new("/Textures/Mobs/Customization/reptilian_parts.rsi"), "tail_smooth"),
             Act = () =>
             {
-                _uiSystem.TryOpen(uid, HumanoidMarkingModifierKey.Key, actor.PlayerSession);
-                _uiSystem.TrySetUiState(
+                _uiSystem.OpenUi(uid, HumanoidMarkingModifierKey.Key, actor.PlayerSession);
+                _uiSystem.SetUiState(
                     uid,
                     HumanoidMarkingModifierKey.Key,
                     new HumanoidMarkingModifierState(component.MarkingSet, component.Species,
@@ -48,8 +48,7 @@ public sealed partial class HumanoidAppearanceSystem
     private void OnBaseLayersSet(EntityUid uid, HumanoidAppearanceComponent component,
         HumanoidMarkingModifierBaseLayersSetMessage message)
     {
-        if (message.Session is not { } player
-            || !_adminManager.HasAdminFlag(player, AdminFlags.Fun))
+        if (!_adminManager.HasAdminFlag(message.Actor, AdminFlags.Fun))
         {
             return;
         }
@@ -67,7 +66,7 @@ public sealed partial class HumanoidAppearanceSystem
 
         if (message.ResendState)
         {
-            _uiSystem.TrySetUiState(
+            _uiSystem.SetUiState(
                 uid,
                 HumanoidMarkingModifierKey.Key,
                 new HumanoidMarkingModifierState(component.MarkingSet, component.Species,
@@ -81,8 +80,7 @@ public sealed partial class HumanoidAppearanceSystem
     private void OnMarkingsSet(EntityUid uid, HumanoidAppearanceComponent component,
         HumanoidMarkingModifierMarkingSetMessage message)
     {
-        if (message.Session is not { } player
-            || !_adminManager.HasAdminFlag(player, AdminFlags.Fun))
+        if (!_adminManager.HasAdminFlag(message.Actor, AdminFlags.Fun))
         {
             return;
         }
@@ -92,7 +90,7 @@ public sealed partial class HumanoidAppearanceSystem
 
         if (message.ResendState)
         {
-            _uiSystem.TrySetUiState(
+            _uiSystem.SetUiState(
                 uid,
                 HumanoidMarkingModifierKey.Key,
                 new HumanoidMarkingModifierState(component.MarkingSet, component.Species,
index 1b7913386d2cc0c4243ee870231f5ec3f9c50a0d..db9dbb375bcaf87cdb1b77e46f689ef504738cc6 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Server.UserInterface;
 using Content.Shared.Instruments;
 using Robust.Shared.Player;
+using ActivatableUIComponent = Content.Shared.UserInterface.ActivatableUIComponent;
 
 namespace Content.Server.Instruments;
 
@@ -16,9 +17,9 @@ public sealed partial class InstrumentComponent : SharedInstrumentComponent
     [ViewVariables] public uint LastSequencerTick = 0;
 
     // TODO Instruments: Make this ECS
-    public ICommonSession? InstrumentPlayer =>
+    public EntityUid? InstrumentPlayer =>
         _entMan.GetComponentOrNull<ActivatableUIComponent>(Owner)?.CurrentSingleUser
-        ?? _entMan.GetComponentOrNull<ActorComponent>(Owner)?.PlayerSession;
+        ?? _entMan.GetComponentOrNull<ActorComponent>(Owner)?.PlayerSession.AttachedEntity;
 }
 
 [RegisterComponent]
index 8dd9644e3c5ef03d573310c8a710f6c1bc55fc90..f5a6713886de3fbd54aa02182ba03b4bba206360 100644 (file)
@@ -111,7 +111,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
         if (!TryComp(uid, out InstrumentComponent? instrument))
             return;
 
-        if (args.SenderSession != instrument.InstrumentPlayer)
+        if (args.SenderSession.AttachedEntity != instrument.InstrumentPlayer)
             return;
 
         instrument.Playing = true;
@@ -125,7 +125,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
         if (!TryComp(uid, out InstrumentComponent? instrument))
             return;
 
-        if (args.SenderSession != instrument.InstrumentPlayer)
+        if (args.SenderSession.AttachedEntity != instrument.InstrumentPlayer)
             return;
 
         Clean(uid, instrument);
@@ -142,7 +142,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
         if (!TryComp(uid, out InstrumentComponent? instrument))
             return;
 
-        if (args.SenderSession != instrument.InstrumentPlayer)
+        if (args.SenderSession.AttachedEntity != instrument.InstrumentPlayer)
             return;
 
         if (master != null)
@@ -174,7 +174,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
         if (!TryComp(uid, out InstrumentComponent? instrument))
             return;
 
-        if (args.SenderSession != instrument.InstrumentPlayer)
+        if (args.SenderSession.AttachedEntity != instrument.InstrumentPlayer)
             return;
 
         if (msg.Channel == RobustMidiEvent.PercussionChannel && !instrument.AllowPercussion)
@@ -194,8 +194,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
     private void OnBoundUIClosed(EntityUid uid, InstrumentComponent component, BoundUIClosedEvent args)
     {
         if (HasComp<ActiveInstrumentComponent>(uid)
-            && _bui.TryGetUi(uid, args.UiKey, out var bui)
-            && bui.SubscribedSessions.Count == 0)
+            && !_bui.IsUiOpen(uid, args.UiKey))
         {
             RemComp<ActiveInstrumentComponent>(uid);
         }
@@ -232,7 +231,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
         var instrumentQuery = EntityManager.GetEntityQuery<InstrumentComponent>();
 
         if (!TryComp(uid, out InstrumentComponent? originInstrument)
-            || originInstrument.InstrumentPlayer?.AttachedEntity is not {} originPlayer)
+            || originInstrument.InstrumentPlayer is not {} originPlayer)
             return Array.Empty<(NetEntity, string)>();
 
         // It's probably faster to get all possible active instruments than all entities in range
@@ -247,7 +246,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
                 continue;
 
             // We want to use the instrument player's name.
-            if (instrument.InstrumentPlayer?.AttachedEntity is not {} playerUid)
+            if (instrument.InstrumentPlayer is not {} playerUid)
                 continue;
 
             // Maybe a bit expensive but oh well GetBands is queued and has a timer anyway.
@@ -298,7 +297,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
             return;
 
         if (!instrument.Playing
-            || args.SenderSession != instrument.InstrumentPlayer
+            || args.SenderSession.AttachedEntity != instrument.InstrumentPlayer
             || instrument.InstrumentPlayer == null
             || args.SenderSession.AttachedEntity is not { } attached)
         {
@@ -374,8 +373,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
                 var entity = GetEntity(request.Entity);
 
                 var nearby = GetBands(entity);
-                _bui.TrySendUiMessage(entity, request.UiKey, new InstrumentBandResponseBuiMessage(nearby),
-                    request.Session);
+                _bui.ServerSendUiMessage(entity, request.UiKey, new InstrumentBandResponseBuiMessage(nearby), request.Actor);
             }
 
             _bandRequestQueue.Clear();
@@ -413,7 +411,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
                 (instrument.BatchesDropped >= MaxMidiBatchesDropped
                  || instrument.LaggedBatches >= MaxMidiLaggedBatches))
             {
-                if (instrument.InstrumentPlayer?.AttachedEntity is {Valid: true} mob)
+                if (instrument.InstrumentPlayer is {Valid: true} mob)
                 {
                     _stuns.TryParalyze(mob, TimeSpan.FromSeconds(1), true);
 
@@ -423,7 +421,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
 
                 // Just in case
                 Clean(uid);
-                _bui.TryCloseAll(uid, InstrumentUiKey.Key);
+                _bui.CloseUi(uid, InstrumentUiKey.Key);
             }
 
             instrument.Timer += frameTime;
@@ -437,13 +435,12 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
         }
     }
 
-    public void ToggleInstrumentUi(EntityUid uid, ICommonSession session, InstrumentComponent? component = null)
+    public void ToggleInstrumentUi(EntityUid uid, EntityUid actor, InstrumentComponent? component = null)
     {
         if (!Resolve(uid, ref component))
             return;
 
-        if (_bui.TryGetUi(uid, InstrumentUiKey.Key, out var bui))
-            _bui.ToggleUi(bui, session);
+        _bui.TryToggleUi(uid, InstrumentUiKey.Key, actor);
     }
 
     public override bool ResolveInstrument(EntityUid uid, ref SharedInstrumentComponent? component)
index 203781bcdaa4135e283119ba21d1ffdc45c6c024..4eac7e9ef1d4d6f329d12c8fbfa0eadeb85d6dc3 100644 (file)
@@ -16,13 +16,6 @@ namespace Content.Server.Interaction
         [Dependency] private readonly SharedContainerSystem _container = default!;
         [Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
 
-        public override void Initialize()
-        {
-            base.Initialize();
-
-            SubscribeLocalEvent<BoundUserInterfaceCheckRangeEvent>(HandleUserInterfaceRangeCheck);
-        }
-
         public override bool CanAccessViaStorage(EntityUid user, EntityUid target)
         {
             if (Deleted(target))
@@ -37,26 +30,8 @@ namespace Content.Server.Interaction
             if (storage.Container?.ID != container.ID)
                 return false;
 
-            if (!TryComp(user, out ActorComponent? actor))
-                return false;
-
             // we don't check if the user can access the storage entity itself. This should be handed by the UI system.
-            return _uiSystem.SessionHasOpenUi(container.Owner, StorageComponent.StorageUiKey.Key, actor.PlayerSession);
-        }
-
-        private void HandleUserInterfaceRangeCheck(ref BoundUserInterfaceCheckRangeEvent ev)
-        {
-            if (ev.Player.AttachedEntity is not { } user || ev.Result == BoundUserInterfaceRangeResult.Fail)
-                return;
-
-            if (InRangeUnobstructed(user, ev.Target, ev.UserInterface.InteractionRange))
-            {
-                ev.Result = BoundUserInterfaceRangeResult.Pass;
-            }
-            else
-            {
-                ev.Result = BoundUserInterfaceRangeResult.Fail;
-            }
+            return _uiSystem.IsUiOpen(container.Owner, StorageComponent.StorageUiKey.Key, user);
         }
     }
 }
index 212383c463a71438d9013bef7b5ef2f79d287625..fa5c5dad2ac531eaa881a8738fa23c06019abfe1 100644 (file)
@@ -79,7 +79,7 @@ namespace Content.Server.Kitchen.EntitySystems
 
             SubscribeLocalEvent<MicrowaveComponent, SignalReceivedEvent>(OnSignalReceived);
 
-            SubscribeLocalEvent<MicrowaveComponent, MicrowaveStartCookMessage>((u, c, m) => Wzhzhzh(u, c, m.Session.AttachedEntity));
+            SubscribeLocalEvent<MicrowaveComponent, MicrowaveStartCookMessage>((u, c, m) => Wzhzhzh(u, c, m.Actor));
             SubscribeLocalEvent<MicrowaveComponent, MicrowaveEjectMessage>(OnEjectMessage);
             SubscribeLocalEvent<MicrowaveComponent, MicrowaveEjectSolidIndexedMessage>(OnEjectIndex);
             SubscribeLocalEvent<MicrowaveComponent, MicrowaveSelectCookTimeMessage>(OnSelectTime);
@@ -355,11 +355,7 @@ namespace Content.Server.Kitchen.EntitySystems
 
         public void UpdateUserInterfaceState(EntityUid uid, MicrowaveComponent component)
         {
-            var ui = _userInterface.GetUiOrNull(uid, MicrowaveUiKey.Key);
-            if (ui == null)
-                return;
-
-            _userInterface.SetUiState(ui, new MicrowaveUpdateUserInterfaceState(
+            _userInterface.SetUiState(uid, MicrowaveUiKey.Key, new MicrowaveUpdateUserInterfaceState(
                 GetNetEntityArray(component.Storage.ContainedEntities.ToArray()),
                 HasComp<ActiveMicrowaveComponent>(uid),
                 component.CurrentCookTimeButtonIndex,
index e8ee4539860d612e16c0cb9d64cac6aa3282ed15..81001f0932e8f8e8fb7329f5abd79ae922a7402d 100644 (file)
@@ -127,7 +127,7 @@ namespace Content.Server.Kitchen.EntitySystems
                     _solutionContainersSystem.TryAddSolution(containerSoln.Value, solution);
                 }
 
-                _userInterfaceSystem.TrySendUiMessage(uid, ReagentGrinderUiKey.Key,
+                _userInterfaceSystem.ServerSendUiMessage(uid, ReagentGrinderUiKey.Key,
                     new ReagentGrinderWorkCompleteMessage());
 
                 UpdateUiState(uid);
@@ -228,7 +228,7 @@ namespace Content.Server.Kitchen.EntitySystems
                 GetNetEntityArray(inputContainer.ContainedEntities.ToArray()),
                 containerSolution?.Contents.ToArray()
             );
-            _userInterfaceSystem.TrySetUiState(uid, ReagentGrinderUiKey.Key, state);
+            _userInterfaceSystem.SetUiState(uid, ReagentGrinderUiKey.Key, state);
         }
 
         private void OnStartMessage(Entity<ReagentGrinderComponent> entity, ref ReagentGrinderStartMessage message)
@@ -305,7 +305,7 @@ namespace Content.Server.Kitchen.EntitySystems
 
             reagentGrinder.AudioStream = _audioSystem.PlayPvs(sound, uid,
                 AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier)).Value.Entity; //slightly higher pitched
-            _userInterfaceSystem.TrySendUiMessage(uid, ReagentGrinderUiKey.Key,
+            _userInterfaceSystem.ServerSendUiMessage(uid, ReagentGrinderUiKey.Key,
                 new ReagentGrinderWorkStartedMessage(program));
         }
 
index dc7b9de0f816941e71ede5cff97f2c3c99751f34..84c41b0db57e543b57a21866046d835ad8538321 100644 (file)
@@ -90,7 +90,7 @@ namespace Content.Server.Labels
 
         private void OnHandLabelerLabelChanged(EntityUid uid, HandLabelerComponent handLabeler, HandLabelerLabelChangedMessage args)
         {
-            if (args.Session.AttachedEntity is not {Valid: true} player)
+            if (args.Actor is not {Valid: true} player)
                 return;
 
             var label = args.Label.Trim();
@@ -109,7 +109,7 @@ namespace Content.Server.Labels
             if (!Resolve(uid, ref handLabeler))
                 return;
 
-            _userInterfaceSystem.TrySetUiState(uid, HandLabelerUiKey.Key,
+            _userInterfaceSystem.SetUiState(uid, HandLabelerUiKey.Key,
                 new HandLabelerBoundUserInterfaceState(handLabeler.AssignedLabel));
         }
     }
index 06d1b463ec3ac1bc24460c7c3f988142929fbaf7..f56737a5a5f4084aeef663588dc0ab4bda01c8c8 100644 (file)
@@ -226,11 +226,10 @@ namespace Content.Server.Lathe
             if (!Resolve(uid, ref component))
                 return;
 
-            var ui = _uiSys.GetUi(uid, LatheUiKey.Key);
             var producing = component.CurrentRecipe ?? component.Queue.FirstOrDefault();
 
             var state = new LatheUpdateState(GetAvailableRecipes(uid, component), component.Queue, producing);
-            _uiSys.SetUiState(ui, state);
+            _uiSys.SetUiState(uid, LatheUiKey.Key, state);
         }
 
         private void OnGetRecipes(EntityUid uid, TechnologyDatabaseComponent component, LatheGetRecipesEvent args)
@@ -337,10 +336,10 @@ namespace Content.Server.Lathe
                     else
                         break;
                 }
-                if (count > 0 && args.Session.AttachedEntity != null)
+                if (count > 0)
                 {
                     _adminLogger.Add(LogType.Action, LogImpact.Low,
-                        $"{ToPrettyString(args.Session.AttachedEntity.Value):player} queued {count} {recipe.Name} at {ToPrettyString(uid):lathe}");
+                        $"{ToPrettyString(args.Actor):player} queued {count} {recipe.Name} at {ToPrettyString(uid):lathe}");
                 }
             }
             TryStartProducing(uid, component);
index dfe398ebafa648b2654fb76e3cfe957b1cd6d2cb..04f8e2eb54cf389a758933e18d6310e8e86db58f 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Popups;
 using Content.Shared.UserInterface;
 using Content.Shared.Lock;
 using Content.Server.UserInterface;
+using ActivatableUISystem = Content.Shared.UserInterface.ActivatableUISystem;
 
 namespace Content.Server.Lock.EntitySystems;
 public sealed class ActivatableUIRequiresLockSystem : EntitySystem
index 9ffd9a07a9f325ee759d1c15bf6a633d7443d923..188ff40b020ce1548a8d0141b3562b623202d1e5 100644 (file)
@@ -32,7 +32,7 @@ public sealed class MagicMirrorSystem : EntitySystem
 
         Subs.BuiEvents<MagicMirrorComponent>(MagicMirrorUiKey.Key, subs =>
         {
-            subs.Event<BoundUIClosedEvent>(OnUIClosed);
+            subs.Event<BoundUIClosedEvent>(OnUiClosed);
             subs.Event<MagicMirrorSelectMessage>(OnMagicMirrorSelect);
             subs.Event<MagicMirrorChangeColorMessage>(OnTryMagicMirrorChangeColor);
             subs.Event<MagicMirrorAddSlotMessage>(OnTryMagicMirrorAddSlot);
@@ -62,10 +62,7 @@ public sealed class MagicMirrorSystem : EntitySystem
         if (!args.CanReach || args.Target == null)
             return;
 
-        if (!TryComp<ActorComponent>(args.User, out var actor))
-            return;
-
-        if (!_uiSystem.TryOpen(mirror.Owner, MagicMirrorUiKey.Key, actor.PlayerSession))
+        if (!_uiSystem.TryOpenUi(mirror.Owner, MagicMirrorUiKey.Key, args.User))
             return;
 
         UpdateInterface(mirror.Owner, args.Target.Value, mirror.Comp);
@@ -79,7 +76,7 @@ public sealed class MagicMirrorSystem : EntitySystem
 
     private void OnMagicMirrorSelect(EntityUid uid, MagicMirrorComponent component, MagicMirrorSelectMessage message)
     {
-        if (component.Target is not { } target || message.Session.AttachedEntity is not { } user)
+        if (component.Target is not { } target)
             return;
 
         _doAfterSystem.Cancel(component.DoAfter);
@@ -92,7 +89,7 @@ public sealed class MagicMirrorSystem : EntitySystem
             Marking = message.Marking,
         };
 
-        _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.SelectSlotTime, doAfter, uid, target: target, used: uid)
+        _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, message.Actor, component.SelectSlotTime, doAfter, uid, target: target, used: uid)
         {
             DistanceThreshold = SharedInteractionSystem.InteractionRange,
             BreakOnDamage = true,
@@ -134,7 +131,7 @@ public sealed class MagicMirrorSystem : EntitySystem
 
     private void OnTryMagicMirrorChangeColor(EntityUid uid, MagicMirrorComponent component, MagicMirrorChangeColorMessage message)
     {
-        if (component.Target is not { } target || message.Session.AttachedEntity is not { } user)
+        if (component.Target is not { } target)
             return;
 
         _doAfterSystem.Cancel(component.DoAfter);
@@ -147,7 +144,7 @@ public sealed class MagicMirrorSystem : EntitySystem
             Colors = message.Colors,
         };
 
-        _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.ChangeSlotTime, doAfter, uid, target: target, used: uid)
+        _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, message.Actor, component.ChangeSlotTime, doAfter, uid, target: target, used: uid)
         {
             BreakOnDamage = true,
             BreakOnMove = true,
@@ -187,7 +184,7 @@ public sealed class MagicMirrorSystem : EntitySystem
 
     private void OnTryMagicMirrorRemoveSlot(EntityUid uid, MagicMirrorComponent component, MagicMirrorRemoveSlotMessage message)
     {
-        if (component.Target is not { } target || message.Session.AttachedEntity is not { } user)
+        if (component.Target is not { } target)
             return;
 
         _doAfterSystem.Cancel(component.DoAfter);
@@ -199,7 +196,7 @@ public sealed class MagicMirrorSystem : EntitySystem
             Slot = message.Slot,
         };
 
-        _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.RemoveSlotTime, doAfter, uid, target: target, used: uid)
+        _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, message.Actor, component.RemoveSlotTime, doAfter, uid, target: target, used: uid)
         {
             DistanceThreshold = SharedInteractionSystem.InteractionRange,
             BreakOnDamage = true,
@@ -243,9 +240,6 @@ public sealed class MagicMirrorSystem : EntitySystem
         if (component.Target == null)
             return;
 
-        if (message.Session.AttachedEntity == null)
-            return;
-
         _doAfterSystem.Cancel(component.DoAfter);
         component.DoAfter = null;
 
@@ -254,7 +248,7 @@ public sealed class MagicMirrorSystem : EntitySystem
             Category = message.Category,
         };
 
-        _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, message.Session.AttachedEntity.Value, component.AddSlotTime, doAfter, uid, target: component.Target.Value, used: uid)
+        _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, message.Actor, component.AddSlotTime, doAfter, uid, target: component.Target.Value, used: uid)
         {
             BreakOnDamage = true,
             BreakOnMove = true,
@@ -316,10 +310,10 @@ public sealed class MagicMirrorSystem : EntitySystem
             humanoid.MarkingSet.PointsLeft(MarkingCategories.FacialHair) + facialHair.Count);
 
         component.Target = targetUid;
-        _uiSystem.TrySetUiState(mirrorUid, MagicMirrorUiKey.Key, state);
+        _uiSystem.SetUiState(mirrorUid, MagicMirrorUiKey.Key, state);
     }
 
-    private void OnUIClosed(Entity<MagicMirrorComponent> ent, ref BoundUIClosedEvent args)
+    private void OnUiClosed(Entity<MagicMirrorComponent> ent, ref BoundUIClosedEvent args)
     {
         ent.Comp.Target = null;
     }
index 2b18b57ff8b10dd4dc9d79a3884d91cef9d1efb8..0fb5d4239494953e30d4da7cc0c726c191ad5705 100644 (file)
@@ -92,15 +92,12 @@ public sealed class NewsSystem : SharedNewsSystem
         if (msg.ArticleNum >= articles.Count)
             return;
 
-        if (msg.Session.AttachedEntity is not { } actor)
-            return;
-
         var article = articles[msg.ArticleNum];
-        if (CheckDeleteAccess(article, ent, actor))
+        if (CheckDeleteAccess(article, ent, msg.Actor))
         {
             _adminLogger.Add(
                 LogType.Chat, LogImpact.Medium,
-                $"{ToPrettyString(actor):actor} deleted news article {article.Title} by {article.Author}: {article.Content}"
+                $"{ToPrettyString(msg.Actor):actor} deleted news article {article.Title} by {article.Author}: {article.Content}"
                 );
 
             articles.RemoveAt(msg.ArticleNum);
@@ -138,14 +135,11 @@ public sealed class NewsSystem : SharedNewsSystem
         if (!TryGetArticles(ent, out var articles))
             return;
 
-        if (msg.Session.AttachedEntity is not { } author)
-            return;
-
-        if (!_accessReader.FindStationRecordKeys(author, out _))
+        if (!_accessReader.FindStationRecordKeys(msg.Actor, out _))
             return;
 
         string? authorName = null;
-        if (_idCardSystem.TryFindIdCard(author, out var idCard))
+        if (_idCardSystem.TryFindIdCard(msg.Actor, out var idCard))
             authorName = idCard.Comp.FullName;
 
         var title = msg.Title.Trim();
@@ -164,7 +158,7 @@ public sealed class NewsSystem : SharedNewsSystem
         _adminLogger.Add(
             LogType.Chat,
             LogImpact.Medium,
-            $"{ToPrettyString(author):actor} created news article {article.Title} by {article.Author}: {article.Content}"
+            $"{ToPrettyString(msg.Actor):actor} created news article {article.Title} by {article.Author}: {article.Content}"
             );
 
         articles.Add(article);
@@ -248,14 +242,14 @@ public sealed class NewsSystem : SharedNewsSystem
 
     private void UpdateWriterUi(Entity<NewsWriterComponent> ent)
     {
-        if (!_ui.TryGetUi(ent, NewsWriterUiKey.Key, out var ui))
+        if (!_ui.HasUi(ent, NewsWriterUiKey.Key))
             return;
 
         if (!TryGetArticles(ent, out var articles))
             return;
 
         var state = new NewsWriterBoundUserInterfaceState(articles.ToArray(), ent.Comp.PublishEnabled, ent.Comp.NextPublish);
-        _ui.SetUiState(ui, state);
+        _ui.SetUiState(ent.Owner, NewsWriterUiKey.Key, state);
     }
 
     private void UpdateReaderUi(Entity<NewsReaderCartridgeComponent> ent, EntityUid loaderUid)
index 9e546dc33fe78367a8bef810989e074478b1f2f5..53c6c62cdb8193aabed8fae0f05e721a8732045d 100644 (file)
@@ -303,15 +303,14 @@ public sealed partial class MechSystem : SharedMechSystem
         {
             EquipmentStates = ev.States
         };
-        var ui = _ui.GetUi(uid, MechUiKey.Key);
-        _ui.SetUiState(ui, state);
+        _ui.SetUiState(uid, MechUiKey.Key, state);
     }
 
     public override void BreakMech(EntityUid uid, MechComponent? component = null)
     {
         base.BreakMech(uid, component);
 
-        _ui.TryCloseAll(uid, MechUiKey.Key);
+        _ui.CloseUi(uid, MechUiKey.Key);
         _actionBlocker.UpdateCanMove(uid);
     }
 
index ff02b9cbdfe926583495e98a070e72503f4b2873..a53df6dbae9f038d78252ccc7b14f4cd37aa1292 100644 (file)
@@ -58,7 +58,7 @@ public sealed class CrewMonitoringConsoleSystem : EntitySystem
         if (!Resolve(uid, ref component))
             return;
 
-        if (!_uiSystem.TryGetUi(uid, CrewMonitoringUIKey.Key, out var bui))
+        if (!_uiSystem.IsUiOpen(uid, CrewMonitoringUIKey.Key))
             return;
 
         // The grid must have a NavMapComponent to visualize the map in the UI
@@ -69,6 +69,6 @@ public sealed class CrewMonitoringConsoleSystem : EntitySystem
 
         // Update all sensors info
         var allSensors = component.ConnectedSensors.Values.ToList();
-        _uiSystem.SetUiState(bui, new CrewMonitoringState(allSensors));
+        _uiSystem.SetUiState(uid, CrewMonitoringUIKey.Key, new CrewMonitoringState(allSensors));
     }
 }
index 02e8cebbe064727b1d7f470b9f11970b4210cd81..71921f44fda20fcb48ac549f3b3cc10f001f47a6 100644 (file)
@@ -193,7 +193,8 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem
             healthAnalyzer.ScannedEntity = entity.Comp.BodyContainer.ContainedEntity;
         }
 
-        _userInterfaceSystem.TrySendUiMessage(
+        // TODO: This should be a state my dude
+        _userInterfaceSystem.ServerSendUiMessage(
             entity.Owner,
             HealthAnalyzerUiKey.Key,
             new HealthAnalyzerScannedUserMessage(GetNetEntity(entity.Comp.BodyContainer.ContainedEntity),
@@ -246,7 +247,7 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem
         else
         {
             RemComp<ActiveCryoPodComponent>(entity);
-            _uiSystem.TryCloseAll(entity.Owner, HealthAnalyzerUiKey.Key);
+            _uiSystem.CloseUi(entity.Owner, HealthAnalyzerUiKey.Key);
         }
         UpdateAppearance(entity.Owner, entity.Comp);
     }
@@ -297,7 +298,7 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem
         }
 
         // if body is ejected - no need to display health-analyzer
-        _uiSystem.TryCloseAll(cryoPod.Owner, HealthAnalyzerUiKey.Key);
+        _uiSystem.CloseUi(cryoPod.Owner, HealthAnalyzerUiKey.Key);
     }
 
     #endregion
index 4988608327afd01e1b37a582676a29ec8e2fe4f4..7282ea197c988728775f29031054f801d39b60e0 100644 (file)
@@ -128,10 +128,10 @@ public sealed class HealthAnalyzerSystem : EntitySystem
 
     private void OpenUserInterface(EntityUid user, EntityUid analyzer)
     {
-        if (!TryComp<ActorComponent>(user, out var actor) || !_uiSystem.TryGetUi(analyzer, HealthAnalyzerUiKey.Key, out var ui))
+        if (!_uiSystem.HasUi(analyzer, HealthAnalyzerUiKey.Key))
             return;
 
-        _uiSystem.OpenUi(ui, actor.PlayerSession);
+        _uiSystem.OpenUi(analyzer, HealthAnalyzerUiKey.Key, user);
     }
 
     /// <summary>
@@ -172,7 +172,7 @@ public sealed class HealthAnalyzerSystem : EntitySystem
     /// <param name="scanMode">True makes the UI show ACTIVE, False makes the UI show INACTIVE</param>
     public void UpdateScannedUser(EntityUid healthAnalyzer, EntityUid target, bool scanMode)
     {
-        if (!_uiSystem.TryGetUi(healthAnalyzer, HealthAnalyzerUiKey.Key, out var ui))
+        if (!_uiSystem.HasUi(healthAnalyzer, HealthAnalyzerUiKey.Key))
             return;
 
         if (!HasComp<DamageableComponent>(target))
@@ -194,9 +194,7 @@ public sealed class HealthAnalyzerSystem : EntitySystem
             bleeding = bloodstream.BleedAmount > 0;
         }
 
-
-
-        _uiSystem.SendUiMessage(ui, new HealthAnalyzerScannedUserMessage(
+        _uiSystem.ServerSendUiMessage(healthAnalyzer, HealthAnalyzerUiKey.Key, new HealthAnalyzerScannedUserMessage(
             GetNetEntity(target),
             bodyTemperature,
             bloodAmount,
index c996f05ec4abbc5633baba97625365268e3e5e65..b72be0b46c97a2b7b7dcb33e75f194ac114f0ed6 100644 (file)
@@ -187,7 +187,7 @@ public sealed class NukeSystem : EntitySystem
                     continue;
 
                 var msg = Loc.GetString("nuke-component-cant-anchor-floor");
-                _popups.PopupEntity(msg, uid, args.Session, PopupType.MediumCaution);
+                _popups.PopupEntity(msg, uid, args.Actor, PopupType.MediumCaution);
 
                 return;
             }
@@ -243,10 +243,7 @@ public sealed class NukeSystem : EntitySystem
 
         else
         {
-            if (args.Session.AttachedEntity is not { } user)
-                return;
-
-            DisarmBombDoafter(uid, user, component);
+            DisarmBombDoafter(uid, args.Actor, component);
         }
     }
 
@@ -366,8 +363,7 @@ public sealed class NukeSystem : EntitySystem
         if (!Resolve(uid, ref component))
             return;
 
-        var ui = _ui.GetUiOrNull(uid, NukeUiKey.Key);
-        if (ui == null)
+        if (!_ui.HasUi(uid, NukeUiKey.Key))
             return;
 
         var anchored = Transform(uid).Anchored;
@@ -388,7 +384,7 @@ public sealed class NukeSystem : EntitySystem
             CooldownTime = (int) component.CooldownTime
         };
 
-        _ui.SetUiState(ui, state);
+        _ui.SetUiState(uid, NukeUiKey.Key, state);
     }
 
     private void PlayNukeKeypadSound(EntityUid uid, int number, NukeComponent? component = null)
index bcc0b9c0ea6ee82d109e2cdfc7efbea0a09a4ace..a2d74e16b32848e6a53f448502f320084329255d 100644 (file)
@@ -55,9 +55,6 @@ public sealed class WarDeclaratorSystem : EntitySystem
 
     private void OnActivated(Entity<WarDeclaratorComponent> ent, ref WarDeclaratorActivateMessage args)
     {
-        if (args.Session.AttachedEntity is not {} playerEntity)
-            return;
-
         var ev = new WarDeclaredEvent(ent.Comp.CurrentStatus, ent);
         RaiseLocalEvent(ref ev);
 
@@ -75,7 +72,7 @@ public sealed class WarDeclaratorSystem : EntitySystem
         {
             var title = Loc.GetString(ent.Comp.SenderTitle);
             _chat.DispatchGlobalAnnouncement(ent.Comp.Message, title, true, ent.Comp.Sound, ent.Comp.Color);
-            _adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(playerEntity):player} has declared war with this text: {ent.Comp.Message}");
+            _adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(args.Actor):player} has declared war with this text: {ent.Comp.Message}");
         }
 
         UpdateUI(ent, ev.Status);
@@ -83,8 +80,8 @@ public sealed class WarDeclaratorSystem : EntitySystem
 
     private void UpdateUI(Entity<WarDeclaratorComponent> ent, WarConditionStatus? status = null)
     {
-        _userInterfaceSystem.TrySetUiState(
-            ent,
+        _userInterfaceSystem.SetUiState(
+            ent.Owner,
             WarDeclaratorUiKey.Key,
             new WarDeclaratorBoundUserInterfaceState(status, ent.Comp.DisableAt, ent.Comp.ShuttleDisabledTime));
     }
index e9505b5e6fd2343a3f744ef9535d3155191a6607..091afb155767fceedcf2dbe3addf64819647e3d8 100644 (file)
@@ -102,13 +102,15 @@ public sealed class PAISystem : SharedPAISystem
     {
         //  Close the instrument interface if it was open
         //  before closing
-        if (HasComp<ActiveInstrumentComponent>(uid) && TryComp<ActorComponent>(uid, out var actor))
+        if (HasComp<ActiveInstrumentComponent>(uid))
         {
-            _instrumentSystem.ToggleInstrumentUi(uid, actor.PlayerSession);
+            _instrumentSystem.ToggleInstrumentUi(uid, uid);
         }
 
         //  Stop instrument
-        if (TryComp<InstrumentComponent>(uid, out var instrument)) _instrumentSystem.Clean(uid, instrument);
+        if (TryComp<InstrumentComponent>(uid, out var instrument))
+            _instrumentSystem.Clean(uid, instrument);
+
         if (TryComp<MetaDataComponent>(uid, out var metadata))
         {
             var proto = metadata.EntityPrototype;
index a3436071969ef504ca564fa05b0062f758478c5b..0b86fe29ed8740b3b6562ab303e173c281be4b3e 100644 (file)
@@ -41,6 +41,7 @@ namespace Content.Server.PDA
             SubscribeLocalEvent<PdaComponent, LightToggleEvent>(OnLightToggle);
 
             // UI Events:
+            SubscribeLocalEvent<PdaComponent, BoundUIOpenedEvent>(OnPdaOpen);
             SubscribeLocalEvent<PdaComponent, PdaRequestUpdateInterfaceMessage>(OnUiMessage);
             SubscribeLocalEvent<PdaComponent, PdaToggleFlashlightMessage>(OnUiMessage);
             SubscribeLocalEvent<PdaComponent, PdaShowRingtoneMessage>(OnUiMessage);
@@ -145,7 +146,7 @@ namespace Content.Server.PDA
             if (!Resolve(uid, ref pda, false))
                 return;
 
-            if (!_ui.TryGetUi(uid, PdaUiKey.Key, out var ui))
+            if (!_ui.HasUi(uid, PdaUiKey.Key))
                 return;
 
             var address = GetDeviceNetAddress(uid);
@@ -182,7 +183,15 @@ namespace Content.Server.PDA
                 hasInstrument,
                 address);
 
-            _ui.SetUiState(ui, state);
+            _ui.SetUiState(uid, PdaUiKey.Key, state);
+        }
+
+        private void OnPdaOpen(Entity<PdaComponent> ent, ref BoundUIOpenedEvent args)
+        {
+            if (!PdaUiKey.Key.Equals(args.UiKey))
+                return;
+
+            UpdatePdaUi(ent.Owner, ent.Comp);
         }
 
         private void OnUiMessage(EntityUid uid, PdaComponent pda, PdaRequestUpdateInterfaceMessage msg)
@@ -208,7 +217,7 @@ namespace Content.Server.PDA
                 return;
 
             if (HasComp<RingerComponent>(uid))
-                _ringer.ToggleRingerUI(uid, msg.Session);
+                _ringer.ToggleRingerUI(uid, msg.Actor);
         }
 
         private void OnUiMessage(EntityUid uid, PdaComponent pda, PdaShowMusicMessage msg)
@@ -217,7 +226,7 @@ namespace Content.Server.PDA
                 return;
 
             if (TryComp<InstrumentComponent>(uid, out var instrument))
-                _instrument.ToggleInstrumentUi(uid, msg.Session, instrument);
+                _instrument.ToggleInstrumentUi(uid, msg.Actor, instrument);
         }
 
         private void OnUiMessage(EntityUid uid, PdaComponent pda, PdaShowUplinkMessage msg)
@@ -227,7 +236,7 @@ namespace Content.Server.PDA
 
             // check if its locked again to prevent malicious clients opening locked uplinks
             if (TryComp<StoreComponent>(uid, out var store) && IsUnlocked(uid))
-                _store.ToggleUi(msg.Session.AttachedEntity!.Value, uid, store);
+                _store.ToggleUi(msg.Actor, uid, store);
         }
 
         private void OnUiMessage(EntityUid uid, PdaComponent pda, PdaLockUplinkMessage msg)
index f95725873ae844a759873151ceef3c665a172518..a10544d696638188d67939d1a03c06afd5834105 100644 (file)
@@ -81,7 +81,10 @@ namespace Content.Server.PDA.Ringer
 
         private void OnSetRingtone(EntityUid uid, RingerComponent ringer, RingerSetRingtoneMessage args)
         {
-            ref var lastSetAt = ref CollectionsMarshal.GetValueRefOrAddDefault(_lastSetRingtoneAt, args.Session.UserId, out var exists);
+            if (!TryComp(args.Actor, out ActorComponent? actorComp))
+                return;
+
+            ref var lastSetAt = ref CollectionsMarshal.GetValueRefOrAddDefault(_lastSetRingtoneAt, actorComp.PlayerSession.UserId, out var exists);
 
             // Delay on the client is 0.333, 0.25 is still enough and gives some leeway in case of small time differences
             if (exists && lastSetAt > _gameTiming.CurTime - TimeSpan.FromMilliseconds(250))
@@ -111,7 +114,7 @@ namespace Content.Server.PDA.Ringer
 
                 // can't keep store open after locking it
                 if (!uplink.Unlocked)
-                    _ui.TryCloseAll(uid, StoreUiKey.Key);
+                    _ui.CloseUi(uid, StoreUiKey.Key);
 
                 // no saving the code to prevent meta click set on sus guys pda -> wewlad
                 args.Handled = true;
@@ -130,7 +133,7 @@ namespace Content.Server.PDA.Ringer
                 return;
 
             uplink.Unlocked = false;
-            _ui.TryCloseAll(uid, StoreUiKey.Key);
+            _ui.CloseUi(uid, StoreUiKey.Key);
         }
 
         public void RandomizeRingtone(EntityUid uid, RingerComponent ringer, MapInitEvent args)
@@ -181,14 +184,12 @@ namespace Content.Server.PDA.Ringer
 
         private void UpdateRingerUserInterface(EntityUid uid, RingerComponent ringer, bool isPlaying)
         {
-            if (_ui.TryGetUi(uid, RingerUiKey.Key, out var bui))
-                _ui.SetUiState(bui, new RingerUpdateState(isPlaying, ringer.Ringtone));
+            _ui.SetUiState(uid, RingerUiKey.Key, new RingerUpdateState(isPlaying, ringer.Ringtone));
         }
 
-        public bool ToggleRingerUI(EntityUid uid, ICommonSession session)
+        public bool ToggleRingerUI(EntityUid uid, EntityUid actor)
         {
-            if (_ui.TryGetUi(uid, RingerUiKey.Key, out var bui))
-                _ui.ToggleUi(bui, session);
+            _ui.TryToggleUi(uid, RingerUiKey.Key, actor);
             return true;
         }
 
index 3cf011e34dff843a83867b4aa89d9cb4f83ba9c3..6c379eea2bc565a09d0702b357c1035c952ef1a7 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.GameStates;
 
 namespace Content.Server.Paper;
 
-[NetworkedComponent, RegisterComponent]
+[RegisterComponent]
 public sealed partial class PaperComponent : SharedPaperComponent
 {
     public PaperAction Mode;
index c582b82e2c07d34f47a04701254e774388ef1572..d10d04cfb9a9f4386d4ed2dbe65a9bc3dcb4c176 100644 (file)
@@ -67,11 +67,7 @@ namespace Content.Server.Paper
         private void BeforeUIOpen(EntityUid uid, PaperComponent paperComp, BeforeActivatableUIOpenEvent args)
         {
             paperComp.Mode = PaperAction.Read;
-
-            if (!TryComp<ActorComponent>(args.User, out var actor))
-                return;
-
-            UpdateUserInterface(uid, paperComp, actor.PlayerSession);
+            UpdateUserInterface(uid, paperComp);
         }
 
         private void OnExamined(EntityUid uid, PaperComponent paperComp, ExaminedEvent args)
@@ -108,12 +104,10 @@ namespace Content.Server.Paper
             {
                 var writeEvent = new PaperWriteEvent(uid, args.User);
                 RaiseLocalEvent(args.Used, ref writeEvent);
-                if (!TryComp<ActorComponent>(args.User, out var actor))
-                    return;
 
                 paperComp.Mode = PaperAction.Write;
-                _uiSystem.TryOpen(uid, PaperUiKey.Key, actor.PlayerSession);
-                UpdateUserInterface(uid, paperComp, actor.PlayerSession);
+                _uiSystem.OpenUi(uid, PaperUiKey.Key, args.User);
+                UpdateUserInterface(uid, paperComp);
                 args.Handled = true;
                 return;
             }
@@ -157,9 +151,8 @@ namespace Content.Server.Paper
                 if (TryComp<MetaDataComponent>(uid, out var meta))
                     _metaSystem.SetEntityDescription(uid, "", meta);
 
-                if (args.Session.AttachedEntity != null)
-                    _adminLogger.Add(LogType.Chat, LogImpact.Low,
-                        $"{ToPrettyString(args.Session.AttachedEntity.Value):player} has written on {ToPrettyString(uid):entity} the following text: {args.Text}");
+                _adminLogger.Add(LogType.Chat, LogImpact.Low,
+                    $"{ToPrettyString(args.Actor):player} has written on {ToPrettyString(uid):entity} the following text: {args.Text}");
 
                 _audio.PlayPvs(paperComp.Sound, uid);
             }
@@ -213,13 +206,12 @@ namespace Content.Server.Paper
             _appearance.SetData(uid, PaperVisuals.Status, status, appearance);
         }
 
-        public void UpdateUserInterface(EntityUid uid, PaperComponent? paperComp = null, ICommonSession? session = null)
+        public void UpdateUserInterface(EntityUid uid, PaperComponent? paperComp = null)
         {
             if (!Resolve(uid, ref paperComp))
                 return;
 
-            if (_uiSystem.TryGetUi(uid, PaperUiKey.Key, out var bui))
-                _uiSystem.SetUiState(bui, new PaperBoundUserInterfaceState(paperComp.Content, paperComp.StampedBy, paperComp.Mode), session);
+            _uiSystem.SetUiState(uid, PaperUiKey.Key, new PaperBoundUserInterfaceState(paperComp.Content, paperComp.StampedBy, paperComp.Mode));
         }
     }
 
index 5d373652a97e3703a6e7da03fda2a8ac5b3daa6c..f3cff9f2e72966b8632c765ac714450aed191f18 100644 (file)
@@ -67,7 +67,7 @@ public sealed partial class ParticleAcceleratorSystem
         FireEmitter(comp.StarboardEmitter!.Value, strength);
     }
 
-    public void SwitchOn(EntityUid uid, ICommonSession? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
+    public void SwitchOn(EntityUid uid, EntityUid? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
     {
         if (!Resolve(uid, ref comp))
             return;
@@ -77,7 +77,7 @@ public sealed partial class ParticleAcceleratorSystem
         if (comp.Enabled || !comp.CanBeEnabled)
             return;
 
-        if (user?.AttachedEntity is { } player)
+        if (user is { } player)
             _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(player):player} has turned {ToPrettyString(uid)} on");
 
         comp.Enabled = true;
@@ -90,14 +90,14 @@ public sealed partial class ParticleAcceleratorSystem
         UpdateUI(uid, comp);
     }
 
-    public void SwitchOff(EntityUid uid, ICommonSession? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
+    public void SwitchOff(EntityUid uid, EntityUid? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
     {
         if (!Resolve(uid, ref comp))
             return;
         if (!comp.Enabled)
             return;
 
-        if (user?.AttachedEntity is { } player)
+        if (user is { } player)
             _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(player):player} has turned {ToPrettyString(uid)} off");
 
         comp.Enabled = false;
@@ -138,7 +138,7 @@ public sealed partial class ParticleAcceleratorSystem
         UpdateUI(uid, comp);
     }
 
-    public void SetStrength(EntityUid uid, ParticleAcceleratorPowerState strength, ICommonSession? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
+    public void SetStrength(EntityUid uid, ParticleAcceleratorPowerState strength, EntityUid? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
     {
         if (!Resolve(uid, ref comp))
             return;
@@ -154,7 +154,7 @@ public sealed partial class ParticleAcceleratorSystem
         if (strength == comp.SelectedStrength)
             return;
 
-        if (user?.AttachedEntity is { } player)
+        if (user is { } player)
         {
             var impact = strength switch
             {
@@ -235,7 +235,8 @@ public sealed partial class ParticleAcceleratorSystem
     {
         if (!Resolve(uid, ref comp))
             return;
-        if (!_uiSystem.TryGetUi(uid, ParticleAcceleratorControlBoxUiKey.Key, out var bui))
+
+        if (!_uiSystem.HasUi(uid, ParticleAcceleratorControlBoxUiKey.Key))
             return;
 
         var draw = 0f;
@@ -247,7 +248,7 @@ public sealed partial class ParticleAcceleratorSystem
             receive = powerConsumer.ReceivedPower;
         }
 
-        _uiSystem.SetUiState(bui, new ParticleAcceleratorUIState(
+        _uiSystem.SetUiState(uid, ParticleAcceleratorControlBoxUiKey.Key, new ParticleAcceleratorUIState(
             comp.Assembled,
             comp.Enabled,
             comp.SelectedStrength,
@@ -346,7 +347,7 @@ public sealed partial class ParticleAcceleratorSystem
         UpdateAppearance(uid, comp);
 
         if (!args.Powered)
-            _uiSystem.TryCloseAll(uid, ParticleAcceleratorControlBoxUiKey.Key);
+            _uiSystem.CloseUi(uid, ParticleAcceleratorControlBoxUiKey.Key);
     }
 
     private void OnUISetEnableMessage(EntityUid uid, ParticleAcceleratorControlBoxComponent comp, ParticleAcceleratorSetEnableMessage msg)
@@ -361,10 +362,10 @@ public sealed partial class ParticleAcceleratorSystem
         if (msg.Enabled)
         {
             if (comp.Assembled)
-                SwitchOn(uid, msg.Session, comp);
+                SwitchOn(uid, msg.Actor, comp);
         }
         else
-            SwitchOff(uid, msg.Session, comp);
+            SwitchOff(uid, msg.Actor, comp);
 
         UpdateUI(uid, comp);
     }
@@ -378,7 +379,7 @@ public sealed partial class ParticleAcceleratorSystem
         if (TryComp<ApcPowerReceiverComponent>(uid, out var apcPower) && !apcPower.Powered)
             return;
 
-        SetStrength(uid, msg.State, msg.Session, comp);
+        SetStrength(uid, msg.State, msg.Actor, comp);
 
         UpdateUI(uid, comp);
     }
@@ -392,7 +393,7 @@ public sealed partial class ParticleAcceleratorSystem
         if (TryComp<ApcPowerReceiverComponent>(uid, out var apcPower) && !apcPower.Powered)
             return;
 
-        RescanParts(uid, msg.Session, comp);
+        RescanParts(uid, msg.Actor, comp);
 
         UpdateUI(uid, comp);
     }
index bdbc7b3f5bc7109dcfa667193037511729b4921e..99bb0d5cbdafc376c5c70b4e9182b78f4219b627 100644 (file)
@@ -18,7 +18,7 @@ public sealed partial class ParticleAcceleratorSystem
         SubscribeLocalEvent<ParticleAcceleratorPartComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
     }
 
-    public void RescanParts(EntityUid uid, ICommonSession? user = null, ParticleAcceleratorControlBoxComponent? controller = null)
+    public void RescanParts(EntityUid uid, EntityUid? user = null, ParticleAcceleratorControlBoxComponent? controller = null)
     {
         if (!Resolve(uid, ref controller))
             return;
index 0cbd47c233a859eb15f822a19b3420c1df2bcbdf..0645944a2ac01bd23d06932792722e5b95e03804 100644 (file)
@@ -48,8 +48,7 @@ public sealed partial class ParticleAcceleratorLimiterWireAction : ComponentWire
         // Yes, it's a feature that mending this wire WON'T WORK if the strength wire is also cut.
         // Since that blocks SetStrength().
         var paSystem = EntityManager.System<ParticleAcceleratorSystem>();
-        var userSession = EntityManager.TryGetComponent<ActorComponent>(user, out var actor) ? actor.PlayerSession : null;
-        paSystem.SetStrength(wire.Owner, controller.MaxStrength, userSession, controller);
+        paSystem.SetStrength(wire.Owner, controller.MaxStrength, user, controller);
         return true;
     }
 
index 65fa76ee413d109ff3f096f69b21cd0d0d72cbef..1650960bd3133a097023cf1b1259b3867e1beb61 100644 (file)
@@ -33,7 +33,6 @@ public sealed partial class ParticleAcceleratorStrengthWireAction : ComponentWir
     public override void Pulse(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
     {
         var paSystem = EntityManager.System<ParticleAcceleratorSystem>();
-        var userSession = EntityManager.TryGetComponent<ActorComponent>(user, out var actor) ? actor.PlayerSession : null;
-        paSystem.SetStrength(wire.Owner, (ParticleAcceleratorPowerState) ((int) controller.SelectedStrength + 1), userSession, controller);
+        paSystem.SetStrength(wire.Owner, (ParticleAcceleratorPowerState) ((int) controller.SelectedStrength + 1), user, controller);
     }
 }
index c43403edd412b500beb240594d49ca9db9b8eda2..40a15d2bc507d8c03379fd724daaba9517892e2b 100644 (file)
@@ -23,10 +23,9 @@ public sealed partial class ParticleAcceleratorPowerWireAction : ComponentWireAc
     public override bool Cut(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
     {
         var paSystem = EntityManager.System<ParticleAcceleratorSystem>();
-        var userSession = EntityManager.TryGetComponent<ActorComponent>(user, out var actor) ? actor.PlayerSession : null;
 
         controller.CanBeEnabled = false;
-        paSystem.SwitchOff(wire.Owner, userSession, controller);
+        paSystem.SwitchOff(wire.Owner, user, controller);
         return true;
     }
 
@@ -39,11 +38,10 @@ public sealed partial class ParticleAcceleratorPowerWireAction : ComponentWireAc
     public override void Pulse(EntityUid user, Wire wire, ParticleAcceleratorControlBoxComponent controller)
     {
         var paSystem = EntityManager.System<ParticleAcceleratorSystem>();
-        var userSession = EntityManager.TryGetComponent<ActorComponent>(user, out var actor) ? actor.PlayerSession : null;
 
         if (controller.Enabled)
-            paSystem.SwitchOff(wire.Owner, userSession, controller);
+            paSystem.SwitchOff(wire.Owner, user, controller);
         else if (controller.Assembled)
-            paSystem.SwitchOn(wire.Owner, userSession, controller);
+            paSystem.SwitchOn(wire.Owner, user, controller);
     }
 }
index 34c76a13206252d4bc616fa8fa650be16b0c4225..0aa6ab1908287bc20766be3d3454e8d7f8d0ce05 100644 (file)
@@ -155,9 +155,6 @@ public sealed partial class NavMapSystem : SharedNavMapSystem
 
     private void OnConfigureMessage(Entity<ConfigurableNavMapBeaconComponent> ent, ref NavMapBeaconConfigureBuiMessage args)
     {
-        if (args.Session.AttachedEntity is not { } user)
-            return;
-
         if (!TryComp<NavMapBeaconComponent>(ent, out var beacon))
             return;
 
@@ -167,7 +164,7 @@ public sealed partial class NavMapSystem : SharedNavMapSystem
             return;
 
         _adminLog.Add(LogType.Action, LogImpact.Medium,
-            $"{ToPrettyString(user):player} configured NavMapBeacon \'{ToPrettyString(ent):entity}\' with text \'{args.Text}\', color {args.Color.ToHexNoAlpha()}, and {(args.Enabled ? "enabled" : "disabled")} it.");
+            $"{ToPrettyString(args.Actor):player} configured NavMapBeacon \'{ToPrettyString(ent):entity}\' with text \'{args.Text}\', color {args.Color.ToHexNoAlpha()}, and {(args.Enabled ? "enabled" : "disabled")} it.");
 
         if (TryComp<WarpPointComponent>(ent, out var warpPoint))
         {
index c9db560fef06e5baad18087eb8fa6d91a3dd795a..b0b3141fb0ee80a5cf4c368fcc20e156cc29cb94 100644 (file)
@@ -24,29 +24,23 @@ public sealed class StationMapSystem : EntitySystem
 
     private void OnStationMapClosed(EntityUid uid, StationMapComponent component, BoundUIClosedEvent args)
     {
-        if (!Equals(args.UiKey, StationMapUiKey.Key) || args.Session.AttachedEntity == null)
+        if (!Equals(args.UiKey, StationMapUiKey.Key))
             return;
 
-        RemCompDeferred<StationMapUserComponent>(args.Session.AttachedEntity.Value);
+        RemCompDeferred<StationMapUserComponent>(args.Actor);
     }
 
     private void OnUserParentChanged(EntityUid uid, StationMapUserComponent component, ref EntParentChangedMessage args)
     {
-        if (TryComp<ActorComponent>(uid, out var actor))
-        {
-            _ui.TryClose(component.Map, StationMapUiKey.Key, actor.PlayerSession);
-        }
+        _ui.CloseUi(component.Map, StationMapUiKey.Key, uid);
     }
 
     private void OnStationMapOpened(EntityUid uid, StationMapComponent component, BoundUIOpenedEvent args)
     {
-        if (args.Session.AttachedEntity == null)
-            return;
-
         if (!_cell.TryUseActivatableCharge(uid))
             return;
 
-        var comp = EnsureComp<StationMapUserComponent>(args.Session.AttachedEntity.Value);
+        var comp = EnsureComp<StationMapUserComponent>(args.Actor);
         comp.Map = uid;
     }
 }
diff --git a/Content.Server/Power/Components/ActivatableUIRequiresPowerComponent.cs b/Content.Server/Power/Components/ActivatableUIRequiresPowerComponent.cs
deleted file mode 100644 (file)
index c387457..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Content.Server.Power.Components
-{
-    [RegisterComponent]
-    public sealed partial class ActivatableUIRequiresPowerComponent : Component
-    {
-    }
-}
-
index 561b0e71f093c512bbaf18dd900a3eb13fbaa4f4..72843a65b84eb4bcee7dcd046f9c1583ca8c6c35 100644 (file)
@@ -4,11 +4,12 @@ using Content.Shared.UserInterface;
 using JetBrains.Annotations;
 using Content.Shared.Wires;
 using Content.Server.UserInterface;
+using Content.Shared.Power.Components;
+using ActivatableUISystem = Content.Shared.UserInterface.ActivatableUISystem;
 
 namespace Content.Server.Power.EntitySystems;
 
-[UsedImplicitly]
-internal sealed class ActivatableUIRequiresPowerSystem : EntitySystem
+public sealed class ActivatableUIRequiresPowerSystem : EntitySystem
 {
     [Dependency] private readonly ActivatableUISystem _activatableUI = default!;
     [Dependency] private readonly SharedPopupSystem _popup = default!;
index 95b5d74a94575382fe8f58cfd55107573f5b2b6b..388f65ad2e88ecdcfe88d0e6f5f1bfa095963216 100644 (file)
@@ -66,11 +66,8 @@ public sealed class ApcSystem : EntitySystem
     //Update the HasAccess var for UI to read
     private void OnBoundUiOpen(EntityUid uid, ApcComponent component, BoundUIOpenedEvent args)
     {
-        if (args.Session.AttachedEntity == null)
-            return;
-
         // TODO: this should be per-player not stored on the apc
-        component.HasAccess = _accessReader.IsAllowed(args.Session.AttachedEntity.Value, uid);
+        component.HasAccess = _accessReader.IsAllowed(args.Actor, uid);
         UpdateApcState(uid, component);
     }
 
@@ -81,21 +78,18 @@ public sealed class ApcSystem : EntitySystem
         if (attemptEv.Cancelled)
         {
             _popup.PopupCursor(Loc.GetString("apc-component-on-toggle-cancel"),
-                args.Session, PopupType.Medium);
+                args.Actor, PopupType.Medium);
             return;
         }
 
-        if (args.Session.AttachedEntity == null)
-            return;
-
-        if (_accessReader.IsAllowed(args.Session.AttachedEntity.Value, uid))
+        if (_accessReader.IsAllowed(args.Actor, uid))
         {
             ApcToggleBreaker(uid, component);
         }
         else
         {
             _popup.PopupCursor(Loc.GetString("apc-component-insufficient-access"),
-                args.Session, PopupType.Medium);
+                args.Actor, PopupType.Medium);
         }
     }
 
@@ -158,7 +152,7 @@ public sealed class ApcSystem : EntitySystem
             (int) MathF.Ceiling(battery.CurrentSupply), apc.LastExternalState,
             battery.CurrentStorage / battery.Capacity);
 
-        _ui.TrySetUiState(uid, ApcUiKey.Key, state, ui: ui);
+        _ui.SetUiState((uid, ui), ApcUiKey.Key, state);
     }
 
     private ApcChargeState CalcChargeState(EntityUid uid, PowerState.Battery battery)
index 0e20f007d7179589e1d5c26fea58ec8597238172..be1238fd2b7e770cf37363c19260103ad1de53e2 100644 (file)
@@ -286,20 +286,17 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
             var query = AllEntityQuery<PowerMonitoringConsoleComponent>();
             while (query.MoveNext(out var ent, out var console))
             {
-                if (!_userInterfaceSystem.TryGetUi(ent, PowerMonitoringConsoleUiKey.Key, out var bui))
+                if (!_userInterfaceSystem.IsUiOpen(ent, PowerMonitoringConsoleUiKey.Key))
                     continue;
 
-                foreach (var session in bui.SubscribedSessions)
-                    UpdateUIState(ent, console, session);
+                UpdateUIState(ent, console);
+
             }
         }
     }
 
-    public void UpdateUIState(EntityUid uid, PowerMonitoringConsoleComponent component, ICommonSession session)
+    private void UpdateUIState(EntityUid uid, PowerMonitoringConsoleComponent component)
     {
-        if (!_userInterfaceSystem.TryGetUi(uid, PowerMonitoringConsoleUiKey.Key, out var bui))
-            return;
-
         var consoleXform = Transform(uid);
 
         if (consoleXform?.GridUid == null)
@@ -422,15 +419,15 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
         }
 
         // Set the UI state
-        _userInterfaceSystem.SetUiState(bui,
+        _userInterfaceSystem.SetUiState(uid,
+            PowerMonitoringConsoleUiKey.Key,
             new PowerMonitoringConsoleBoundInterfaceState
                 (totalSources,
                 totalBatteryUsage,
                 totalLoads,
                 allEntries.ToArray(),
                 sourcesForFocus.ToArray(),
-                loadsForFocus.ToArray()),
-            session);
+                loadsForFocus.ToArray()));
     }
 
     private double GetPrimaryPowerValues(EntityUid uid, PowerMonitoringDeviceComponent device, out double powerSupplied, out double powerUsage, out double batteryUsage)
index a95a3fd4234dd1be61dbb6d424585850d173ceb9..f7d259b122a343a78f9f53c596d2e6bdf83aa609 100644 (file)
@@ -48,30 +48,21 @@ public sealed class PortableGeneratorSystem : SharedPortableGeneratorSystem
 
     private void GeneratorSwitchOutputMessage(EntityUid uid, PortableGeneratorComponent component, PortableGeneratorSwitchOutputMessage args)
     {
-        if (args.Session.AttachedEntity == null)
-            return;
-
         var fuelGenerator = Comp<FuelGeneratorComponent>(uid);
         if (fuelGenerator.On)
             return;
 
-        _switchable.Cycle(uid, args.Session.AttachedEntity.Value);
+        _switchable.Cycle(uid, args.Actor);
     }
 
     private void GeneratorStopMessage(EntityUid uid, PortableGeneratorComponent component, PortableGeneratorStopMessage args)
     {
-        if (args.Session.AttachedEntity == null)
-            return;
-
-        StopGenerator(uid, component, args.Session.AttachedEntity.Value);
+        StopGenerator(uid, component, args.Actor);
     }
 
     private void GeneratorStartMessage(EntityUid uid, PortableGeneratorComponent component, PortableGeneratorStartMessage args)
     {
-        if (args.Session.AttachedEntity == null)
-            return;
-
-        StartGenerator(uid, component, args.Session.AttachedEntity.Value);
+        StartGenerator(uid, component, args.Actor);
     }
 
     private void StartGenerator(EntityUid uid, PortableGeneratorComponent component, EntityUid user)
@@ -234,7 +225,7 @@ public sealed class PortableGeneratorSystem : SharedPortableGeneratorSystem
         if (powerSupplier.Net is { IsConnectedNetwork: true } net)
             networkStats = (net.NetworkNode.LastCombinedLoad, net.NetworkNode.LastCombinedSupply);
 
-        _uiSystem.TrySetUiState(
+        _uiSystem.SetUiState(
             uid,
             GeneratorComponentUiKey.Key,
             new PortableGeneratorComponentBuiState(fuelComp, fuel, clogged, networkStats));
index d4c1faa4c9d190df5a2925f1a50459bb7ca36ea1..f45a01b2e1b07f271bb5232b31beed733a9243ef 100644 (file)
@@ -11,6 +11,7 @@ using Content.Server.Power.EntitySystems;
 using Content.Server.UserInterface;
 using Content.Shared.Containers.ItemSlots;
 using Content.Shared.Popups;
+using ActivatableUISystem = Content.Shared.UserInterface.ActivatableUISystem;
 
 namespace Content.Server.PowerCell;
 
index d115ec991a7c97d030689cb896855a9a7501ccad..56c5d8e548ce0bb373aa48bc08c85aa0d3f16256 100644 (file)
@@ -221,25 +221,25 @@ public sealed class RadioDeviceSystem : EntitySystem
 
     private void OnToggleIntercomMic(EntityUid uid, IntercomComponent component, ToggleIntercomMicMessage args)
     {
-        if (component.RequiresPower && !this.IsPowered(uid, EntityManager) || args.Session.AttachedEntity is not { } user)
+        if (component.RequiresPower && !this.IsPowered(uid, EntityManager))
             return;
 
-        SetMicrophoneEnabled(uid, user, args.Enabled, true);
+        SetMicrophoneEnabled(uid, args.Actor, args.Enabled, true);
         UpdateIntercomUi(uid, component);
     }
 
     private void OnToggleIntercomSpeaker(EntityUid uid, IntercomComponent component, ToggleIntercomSpeakerMessage args)
     {
-        if (component.RequiresPower && !this.IsPowered(uid, EntityManager) || args.Session.AttachedEntity is not { } user)
+        if (component.RequiresPower && !this.IsPowered(uid, EntityManager))
             return;
 
-        SetSpeakerEnabled(uid, user, args.Enabled, true);
+        SetSpeakerEnabled(uid, args.Actor, args.Enabled, true);
         UpdateIntercomUi(uid, component);
     }
 
     private void OnSelectIntercomChannel(EntityUid uid, IntercomComponent component, SelectIntercomChannelMessage args)
     {
-        if (component.RequiresPower && !this.IsPowered(uid, EntityManager) || args.Session.AttachedEntity is not { })
+        if (component.RequiresPower && !this.IsPowered(uid, EntityManager))
             return;
 
         if (!_protoMan.TryIndex<RadioChannelPrototype>(args.Channel, out _) || !component.SupportedChannels.Contains(args.Channel))
@@ -262,6 +262,6 @@ public sealed class RadioDeviceSystem : EntitySystem
         var availableChannels = component.SupportedChannels;
         var selectedChannel = micComp?.BroadcastChannel ?? SharedChatSystem.CommonChannel;
         var state = new IntercomBoundUIState(micEnabled, speakerEnabled, availableChannels, selectedChannel);
-        _ui.TrySetUiState(uid, IntercomUiKey.Key, state);
+        _ui.SetUiState(uid, IntercomUiKey.Key, state);
     }
 }
index 6bd5300d8fe362585d340457b6df989c496148dd..f8fdba55b7636fef7fe9cb165522199116c64884 100644 (file)
@@ -45,7 +45,7 @@ public sealed partial class ResearchSystem
         if (!this.IsPowered(uid, EntityManager))
             return;
 
-        _uiSystem.TryToggleUi(uid, ResearchClientUiKey.Key, args.Session);
+        _uiSystem.TryToggleUi(uid, ResearchClientUiKey.Key, args.Actor);
     }
     #endregion
 
@@ -88,7 +88,7 @@ public sealed partial class ResearchSystem
         var state = new ResearchClientBoundInterfaceState(names.Length, names,
             GetServerIds(), serverComponent?.Id ?? -1);
 
-        _uiSystem.TrySetUiState(uid, ResearchClientUiKey.Key, state);
+        _uiSystem.SetUiState(uid, ResearchClientUiKey.Key, state);
     }
 
     /// <summary>
index 9f95fd25176a4d938d430580143b0b619b1e8ae3..5358ddefcdf4f749a4850c2a257a26f0e6da6f47 100644 (file)
@@ -20,8 +20,7 @@ public sealed partial class ResearchSystem
 
     private void OnConsoleUnlock(EntityUid uid, ResearchConsoleComponent component, ConsoleUnlockTechnologyMessage args)
     {
-        if (args.Session.AttachedEntity is not { } ent)
-            return;
+        var act = args.Actor;
 
         if (!this.IsPowered(uid, EntityManager))
             return;
@@ -29,13 +28,13 @@ public sealed partial class ResearchSystem
         if (!PrototypeManager.TryIndex<TechnologyPrototype>(args.Id, out var technologyPrototype))
             return;
 
-        if (TryComp<AccessReaderComponent>(uid, out var access) && !_accessReader.IsAllowed(ent, uid, access))
+        if (TryComp<AccessReaderComponent>(uid, out var access) && !_accessReader.IsAllowed(act, uid, access))
         {
-            _popup.PopupEntity(Loc.GetString("research-console-no-access-popup"), ent);
+            _popup.PopupEntity(Loc.GetString("research-console-no-access-popup"), act);
             return;
         }
 
-        if (!UnlockTechnology(uid, args.Id, ent))
+        if (!UnlockTechnology(uid, args.Id, act))
             return;
 
         var message = Loc.GetString("research-console-unlock-technology-radio-broadcast",
@@ -68,7 +67,7 @@ public sealed partial class ResearchSystem
             state = new ResearchConsoleBoundInterfaceState(default);
         }
 
-        _uiSystem.TrySetUiState(uid, ResearchConsoleUiKey.Key, state);
+        _uiSystem.SetUiState(uid, ResearchConsoleUiKey.Key, state);
     }
 
     private void OnPointsChanged(EntityUid uid, ResearchConsoleComponent component, ref ResearchServerPointsChangedEvent args)
index 2064abd8ebf298cc9ea2999587d6b10fbc44b11f..67002475228c8c07de1ef49fb2bf0017bdae68d3 100644 (file)
@@ -91,7 +91,7 @@ public sealed class DiskConsoleSystem : EntitySystem
                        totalPoints >= component.PricePerDisk;
 
         var state = new DiskConsoleBoundUserInterfaceState(totalPoints, component.PricePerDisk, canPrint);
-        _ui.TrySetUiState(uid, DiskConsoleUiKey.Key, state);
+        _ui.SetUiState(uid, DiskConsoleUiKey.Key, state);
     }
 
     private void OnShutdown(EntityUid uid, DiskConsolePrintingComponent component, ComponentShutdown args)
index 61636bea7c9cf75c98b2483077d54e22182d4366..d031418476702b59f854a6da9c41dad4f8ab8531 100644 (file)
@@ -56,7 +56,7 @@ public sealed partial class SalvageSystem
             if (station != component.Owner)
                 continue;
 
-            _ui.TrySetUiState(uid, SalvageConsoleUiKey.Expedition, state, ui: uiComp);
+            _ui.SetUiState((uid, uiComp), SalvageConsoleUiKey.Expedition, state);
         }
     }
 
@@ -74,6 +74,6 @@ public sealed partial class SalvageSystem
             state = new SalvageExpeditionConsoleState(TimeSpan.Zero, false, true, 0, new List<SalvageMissionParams>());
         }
 
-        _ui.TrySetUiState(component, SalvageConsoleUiKey.Expedition, state);
+        _ui.SetUiState(component.Owner, SalvageConsoleUiKey.Expedition, state);
     }
 }
index e4711a5876388f27311c1670f1fd4c43ea720b0e..4b7291298b26868f49132cfbb9a5c1967b8c43a9 100644 (file)
@@ -35,11 +35,6 @@ public sealed partial class SalvageSystem
 
     private void OnMagnetClaim(EntityUid uid, SalvageMagnetComponent component, ref MagnetClaimOfferEvent args)
     {
-        var player = args.Session.AttachedEntity;
-
-        if (player is null)
-            return;
-
         var station = _station.GetOwningStation(uid);
 
         if (!TryComp(station, out SalvageMagnetDataComponent? dataComp) ||
@@ -177,12 +172,12 @@ public sealed partial class SalvageSystem
             // Fuck with the seed to mix wrecks and asteroids.
             seed = (int) (seed / 10f) * 10;
 
-            
+
             if (i >= data.Comp.OfferCount / 2)
             {
                 seed++;
             }
-            
+
 
             data.Comp.Offered.Add(seed);
         }
@@ -216,7 +211,7 @@ public sealed partial class SalvageSystem
         if (!TryComp(station, out SalvageMagnetDataComponent? dataComp))
             return;
 
-        _ui.TrySetUiState(entity, SalvageMagnetUiKey.Key,
+        _ui.SetUiState(entity.Owner, SalvageMagnetUiKey.Key,
             new SalvageMagnetBoundUserInterfaceState(dataComp.Offered)
             {
                 Cooldown = dataComp.OfferCooldown,
@@ -238,7 +233,7 @@ public sealed partial class SalvageSystem
             if (station != data.Owner)
                 continue;
 
-            _ui.TrySetUiState(magnetUid, SalvageMagnetUiKey.Key,
+            _ui.SetUiState(magnetUid, SalvageMagnetUiKey.Key,
                 new SalvageMagnetBoundUserInterfaceState(data.Comp.Offered)
                 {
                     Cooldown = data.Comp.OfferCooldown,
index 63b4d9daef91b443020e32cb95ebadfa201065cd..b5a954f166ddd6d1d4ed1d7c8b682212ce2b5af9 100644 (file)
@@ -27,7 +27,7 @@ public sealed partial class SensorMonitoringConsoleComponent : Component
     public TimeSpan RetentionTime = TimeSpan.FromMinutes(1);
 
     // UI update tracking stuff.
-    public HashSet<ICommonSession> InitialUIStateSent = new();
+    public HashSet<EntityUid> InitialUIStateSent = new();
     public TimeSpan LastUIUpdate;
     public ValueList<int> RemovedSensors;
 
index 26c6b178313ddd7b53bb508e6b6efb12d6338c8d..dec3e6c36ead2820e07c106e77a797f0cd0ac539 100644 (file)
@@ -18,27 +18,26 @@ public sealed partial class SensorMonitoringConsoleSystem
 
     private void UpdateConsoleUI(EntityUid uid, SensorMonitoringConsoleComponent comp)
     {
-        if (!_userInterface.TryGetUi(uid, SensorMonitoringConsoleUiKey.Key, out var ui))
-            return;
-
-        if (ui.SubscribedSessions.Count == 0)
+        if (!_userInterface.IsUiOpen(uid, SensorMonitoringConsoleUiKey.Key))
+        {
             return;
+        }
 
         ConsoleUIState? fullState = null;
         SensorMonitoringIncrementalUpdate? incrementalUpdate = null;
 
-        foreach (var session in ui.SubscribedSessions)
+        foreach (var actorUid in _userInterface.GetActors(uid, SensorMonitoringConsoleUiKey.Key))
         {
-            if (comp.InitialUIStateSent.Contains(session))
+            if (comp.InitialUIStateSent.Contains(actorUid))
             {
                 incrementalUpdate ??= CalculateIncrementalUpdate();
-                _userInterface.TrySendUiMessage(ui, incrementalUpdate, session);
+                _userInterface.ServerSendUiMessage(uid, SensorMonitoringConsoleUiKey.Key, incrementalUpdate, actorUid);
             }
             else
             {
                 fullState ??= CalculateFullState();
-                _userInterface.SetUiState(ui, fullState, session);
-                comp.InitialUIStateSent.Add(session);
+                _userInterface.SetUiState(uid, SensorMonitoringConsoleUiKey.Key, fullState);
+                comp.InitialUIStateSent.Add(actorUid);
             }
         }
 
@@ -131,9 +130,6 @@ public sealed partial class SensorMonitoringConsoleSystem
         if (!args.UiKey.Equals(SensorMonitoringConsoleUiKey.Key))
             return;
 
-        if (args.Session is not { } player)
-            return;
-
-        component.InitialUIStateSent.Remove(player);
+        component.InitialUIStateSent.Remove(args.Actor);
     }
 }
index 803aa963f390c39053948bf47abf42aa5beddb44..d45c04cdc28e25f51402dedfb677bda618ac90b9 100644 (file)
@@ -245,19 +245,18 @@ public sealed partial class EmergencyShuttleSystem
 
     private void OnEmergencyRepealAll(EntityUid uid, EmergencyShuttleConsoleComponent component, EmergencyShuttleRepealAllMessage args)
     {
-        var player = args.Session.AttachedEntity;
-        if (player == null) return;
+        var player = args.Actor;
 
-        if (!_reader.FindAccessTags(player.Value).Contains(EmergencyRepealAllAccess))
+        if (!_reader.FindAccessTags(player).Contains(EmergencyRepealAllAccess))
         {
-            _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), player.Value, PopupType.Medium);
+            _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), player, PopupType.Medium);
             return;
         }
 
         if (component.AuthorizedEntities.Count == 0)
             return;
 
-        _logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle early launch REPEAL ALL by {args.Session:user}");
+        _logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle early launch REPEAL ALL by {args.Actor:user}");
         _chatSystem.DispatchGlobalAnnouncement(Loc.GetString("emergency-shuttle-console-auth-revoked", ("remaining", component.AuthorizationsRequired)));
         component.AuthorizedEntities.Clear();
         UpdateAllEmergencyConsoles();
@@ -265,13 +264,11 @@ public sealed partial class EmergencyShuttleSystem
 
     private void OnEmergencyRepeal(EntityUid uid, EmergencyShuttleConsoleComponent component, EmergencyShuttleRepealMessage args)
     {
-        var player = args.Session.AttachedEntity;
-        if (player == null)
-            return;
+        var player = args.Actor;
 
-        if (!_idSystem.TryFindIdCard(player.Value, out var idCard) || !_reader.IsAllowed(idCard, uid))
+        if (!_idSystem.TryFindIdCard(player, out var idCard) || !_reader.IsAllowed(idCard, uid))
         {
-            _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), player.Value, PopupType.Medium);
+            _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), player, PopupType.Medium);
             return;
         }
 
@@ -279,7 +276,7 @@ public sealed partial class EmergencyShuttleSystem
         if (!component.AuthorizedEntities.Remove(MetaData(idCard).EntityName))
             return;
 
-        _logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle early launch REPEAL by {args.Session:user}");
+        _logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle early launch REPEAL by {args.Actor:user}");
         var remaining = component.AuthorizationsRequired - component.AuthorizedEntities.Count;
         _chatSystem.DispatchGlobalAnnouncement(Loc.GetString("emergency-shuttle-console-auth-revoked", ("remaining", remaining)));
         CheckForLaunch(component);
@@ -288,13 +285,11 @@ public sealed partial class EmergencyShuttleSystem
 
     private void OnEmergencyAuthorize(EntityUid uid, EmergencyShuttleConsoleComponent component, EmergencyShuttleAuthorizeMessage args)
     {
-        var player = args.Session.AttachedEntity;
-        if (player == null)
-            return;
+        var player = args.Actor;
 
-        if (!_idSystem.TryFindIdCard(player.Value, out var idCard) || !_reader.IsAllowed(idCard, uid))
+        if (!_idSystem.TryFindIdCard(player, out var idCard) || !_reader.IsAllowed(idCard, uid))
         {
-            _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), args.Session, PopupType.Medium);
+            _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), args.Actor, PopupType.Medium);
             return;
         }
 
@@ -302,7 +297,7 @@ public sealed partial class EmergencyShuttleSystem
         if (!component.AuthorizedEntities.Add(MetaData(idCard).EntityName))
             return;
 
-        _logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle early launch AUTH by {args.Session:user}");
+        _logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle early launch AUTH by {args.Actor:user}");
         var remaining = component.AuthorizationsRequired - component.AuthorizedEntities.Count;
 
         if (remaining > 0)
@@ -349,9 +344,10 @@ public sealed partial class EmergencyShuttleSystem
             auths.Add(auth);
         }
 
-        if (_uiSystem.TryGetUi(uid, EmergencyConsoleUiKey.Key, out var bui))
+        if (_uiSystem.HasUi(uid, EmergencyConsoleUiKey.Key))
             _uiSystem.SetUiState(
-                bui,
+                uid,
+                EmergencyConsoleUiKey.Key,
                 new EmergencyConsoleBoundUserInterfaceState()
                 {
                     EarlyLaunchTime = EarlyLaunchAuthorized ? _timing.CurTime + TimeSpan.FromSeconds(_consoleAccumulator) : null,
index b7f08b4b349f89218e44273734126c000b38d6de..1de20a87348efdb6cf2940ada9ac05722c90d524 100644 (file)
@@ -39,7 +39,7 @@ public sealed class RadarConsoleSystem : SharedRadarConsoleSystem
             angle = Angle.Zero;
         }
 
-        if (_uiSystem.TryGetUi(uid, RadarConsoleUiKey.Key, out var bui))
+        if (_uiSystem.HasUi(uid, RadarConsoleUiKey.Key))
         {
             NavInterfaceState state;
             var docks = _console.GetAllDocks();
@@ -53,7 +53,7 @@ public sealed class RadarConsoleSystem : SharedRadarConsoleSystem
                 state = _console.GetNavState(uid, docks);
             }
 
-            _uiSystem.SetUiState(bui, new NavBoundUserInterfaceState(state));
+            _uiSystem.SetUiState(uid, RadarConsoleUiKey.Key, new NavBoundUserInterfaceState(state));
         }
     }
 }
index a4f2c7b4db39ad4410e2ecaf17fb827a890b719c..89dc114cafca21c3212038dce0d6adb448e5c863 100644 (file)
@@ -136,13 +136,12 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
     /// </summary>
     private void OnConsoleUIClose(EntityUid uid, ShuttleConsoleComponent component, BoundUIClosedEvent args)
     {
-        if ((ShuttleConsoleUiKey) args.UiKey != ShuttleConsoleUiKey.Key ||
-            args.Session.AttachedEntity is not { } user)
+        if ((ShuttleConsoleUiKey) args.UiKey != ShuttleConsoleUiKey.Key)
         {
             return;
         }
 
-        RemovePilot(user);
+        RemovePilot(args.Actor);
     }
 
     private void OnConsoleUIOpenAttempt(EntityUid uid, ShuttleConsoleComponent component,
@@ -265,9 +264,9 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
                 new List<ShuttleExclusionObject>());
         }
 
-        if (_ui.TryGetUi(consoleUid, ShuttleConsoleUiKey.Key, out var bui))
+        if (_ui.HasUi(consoleUid, ShuttleConsoleUiKey.Key))
         {
-            _ui.SetUiState(bui, new ShuttleBoundUserInterfaceState(navState, mapState, dockState));
+            _ui.SetUiState(consoleUid, ShuttleConsoleUiKey.Key, new ShuttleBoundUserInterfaceState(navState, mapState, dockState));
         }
     }
 
index bf265da2e64422cc64630218b01ec56dc16b9263..ce79466b58916233da0ca9477773f5a3fd48c9c8 100644 (file)
@@ -57,7 +57,7 @@ public sealed partial class ShuttleSystem
             !TryComp<TransformComponent>(uid, out var xform) ||
             !TryComp<IFFComponent>(xform.GridUid, out var iff))
         {
-            _uiSystem.TrySetUiState(uid, IFFConsoleUiKey.Key, new IFFConsoleBoundUserInterfaceState()
+            _uiSystem.SetUiState(uid, IFFConsoleUiKey.Key, new IFFConsoleBoundUserInterfaceState()
             {
                 AllowedFlags = component.AllowedFlags,
                 Flags = IFFFlags.None,
@@ -65,7 +65,7 @@ public sealed partial class ShuttleSystem
         }
         else
         {
-            _uiSystem.TrySetUiState(uid, IFFConsoleUiKey.Key, new IFFConsoleBoundUserInterfaceState()
+            _uiSystem.SetUiState(uid, IFFConsoleUiKey.Key, new IFFConsoleBoundUserInterfaceState()
             {
                 AllowedFlags = component.AllowedFlags,
                 Flags = iff.Flags,
@@ -83,7 +83,7 @@ public sealed partial class ShuttleSystem
             if (xform.GridUid != gridUid)
                 continue;
 
-            _uiSystem.TrySetUiState(uid, IFFConsoleUiKey.Key, new IFFConsoleBoundUserInterfaceState()
+            _uiSystem.SetUiState(uid, IFFConsoleUiKey.Key, new IFFConsoleBoundUserInterfaceState()
             {
                 AllowedFlags = comp.AllowedFlags,
                 Flags = component.Flags,
index 3dcdd78affaf85ea22c1e63b666696ea8e7a76dd..d0e9f80e36453149941f75d7965791d970f8077e 100644 (file)
@@ -28,20 +28,19 @@ public sealed partial class BorgSystem
 
     private void OnEjectBrainBuiMessage(EntityUid uid, BorgChassisComponent component, BorgEjectBrainBuiMessage args)
     {
-        if (args.Session.AttachedEntity is not { } attachedEntity || component.BrainEntity is not { } brain)
+        if (component.BrainEntity is not { } brain)
             return;
 
         _adminLog.Add(LogType.Action, LogImpact.Medium,
-            $"{ToPrettyString(attachedEntity):player} removed brain {ToPrettyString(brain)} from borg {ToPrettyString(uid)}");
+            $"{ToPrettyString(args.Actor):player} removed brain {ToPrettyString(brain)} from borg {ToPrettyString(uid)}");
         _container.Remove(brain, component.BrainContainer);
-        _hands.TryPickupAnyHand(attachedEntity, brain);
+        _hands.TryPickupAnyHand(args.Actor, brain);
         UpdateUI(uid, component);
     }
 
     private void OnEjectBatteryBuiMessage(EntityUid uid, BorgChassisComponent component, BorgEjectBatteryBuiMessage args)
     {
-        if (args.Session.AttachedEntity is not { } attachedEntity ||
-            !TryComp<PowerCellSlotComponent>(uid, out var slotComp) ||
+        if (!TryComp<PowerCellSlotComponent>(uid, out var slotComp) ||
             !Container.TryGetContainer(uid, slotComp.CellSlotId, out var container) ||
             !container.ContainedEntities.Any())
         {
@@ -49,14 +48,11 @@ public sealed partial class BorgSystem
         }
 
         var ents = Container.EmptyContainer(container);
-        _hands.TryPickupAnyHand(attachedEntity, ents.First());
+        _hands.TryPickupAnyHand(args.Actor, ents.First());
     }
 
     private void OnSetNameBuiMessage(EntityUid uid, BorgChassisComponent component, BorgSetNameBuiMessage args)
     {
-        if (args.Session.AttachedEntity is not { } attachedEntity)
-            return;
-
         if (args.Name.Length > HumanoidCharacterProfile.MaxNameLength ||
             args.Name.Length == 0 ||
             string.IsNullOrWhiteSpace(args.Name) ||
@@ -75,24 +71,21 @@ public sealed partial class BorgSystem
         if (metaData.EntityName.Equals(name, StringComparison.InvariantCulture))
             return;
 
-        _adminLog.Add(LogType.Action, LogImpact.High, $"{ToPrettyString(attachedEntity):player} set borg \"{ToPrettyString(uid)}\"'s name to: {name}");
+        _adminLog.Add(LogType.Action, LogImpact.High, $"{ToPrettyString(args.Actor):player} set borg \"{ToPrettyString(uid)}\"'s name to: {name}");
         _metaData.SetEntityName(uid, name, metaData);
     }
 
     private void OnRemoveModuleBuiMessage(EntityUid uid, BorgChassisComponent component, BorgRemoveModuleBuiMessage args)
     {
-        if (args.Session.AttachedEntity is not { } attachedEntity)
-            return;
-
         var module = GetEntity(args.Module);
 
         if (!component.ModuleContainer.Contains(module))
             return;
 
         _adminLog.Add(LogType.Action, LogImpact.Medium,
-            $"{ToPrettyString(attachedEntity):player} removed module {ToPrettyString(module)} from borg {ToPrettyString(uid)}");
+            $"{ToPrettyString(args.Actor):player} removed module {ToPrettyString(module)} from borg {ToPrettyString(uid)}");
         _container.Remove(module, component.ModuleContainer);
-        _hands.TryPickupAnyHand(attachedEntity, module);
+        _hands.TryPickupAnyHand(args.Actor, module);
 
         UpdateUI(uid, component);
     }
@@ -111,6 +104,6 @@ public sealed partial class BorgSystem
         }
 
         var state = new BorgBuiState(chargePercent, hasBattery);
-        _ui.TrySetUiState(uid, BorgUiKey.Key, state);
+        _ui.SetUiState(uid, BorgUiKey.Key, state);
     }
 }
index 010682bc0d3f06d1cbde4c09881cd7bafabf9580..cc1532899dc3d488219313f41e00d3a900f5b8dd 100644 (file)
@@ -93,10 +93,10 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
     private void OnBoundUIOpened(EntityUid uid, SiliconLawBoundComponent component, BoundUIOpenedEvent args)
     {
         _entityManager.TryGetComponent<IntrinsicRadioTransmitterComponent>(uid, out var intrinsicRadio);
-        HashSet<string>? radioChannels = intrinsicRadio?.Channels;
+        var radioChannels = intrinsicRadio?.Channels;
 
         var state = new SiliconLawBuiState(GetLaws(uid).Laws, radioChannels);
-        _userInterface.TrySetUiState(args.Entity, SiliconLawsUiKey.Key, state, args.Session);
+        _userInterface.SetUiState(args.Entity, SiliconLawsUiKey.Key, state);
     }
 
     private void OnPlayerSpawnComplete(EntityUid uid, SiliconLawBoundComponent component, PlayerSpawnCompleteEvent args)
index 179cadcfbcbc3294a577ccb0a900cc4c39ab0a65..dd3f0c00543dfdfd8adf15cdc51d78b8d9eb777a 100644 (file)
@@ -35,13 +35,13 @@ namespace Content.Server.Solar.EntitySystems
                 _updateTimer -= 1;
                 var state = new SolarControlConsoleBoundInterfaceState(_powerSolarSystem.TargetPanelRotation, _powerSolarSystem.TargetPanelVelocity, _powerSolarSystem.TotalPanelPower, _powerSolarSystem.TowardsSun);
                 var query = EntityQueryEnumerator<SolarControlConsoleComponent, UserInterfaceComponent>();
-                while (query.MoveNext(out var uid, out var _, out var uiComp))
+                while (query.MoveNext(out var uid, out _, out var uiComp))
                 {
-                    _uiSystem.TrySetUiState(uid, SolarControlConsoleUiKey.Key, state, ui: uiComp);
+                    _uiSystem.SetUiState((uid, uiComp), SolarControlConsoleUiKey.Key, state);
                 }
             }
         }
+
         private void OnUIMessage(EntityUid uid, SolarControlConsoleComponent component, SolarControlConsoleAdjustMessage msg)
         {
             if (double.IsFinite(msg.Rotation))
index 721eff6f2cfd12a8b51da970356d0fbb812ab3f6..a5202285d9916cae1b878fb52cfdf37c7919155e 100644 (file)
@@ -57,7 +57,7 @@ public sealed class GeneralStationRecordConsoleSystem : EntitySystem
 
         if (!TryComp<StationRecordsComponent>(owningStation, out var stationRecords))
         {
-            _ui.TrySetUiState(uid, GeneralStationRecordConsoleKey.Key, new GeneralStationRecordConsoleState());
+            _ui.SetUiState(uid, GeneralStationRecordConsoleKey.Key, new GeneralStationRecordConsoleState());
             return;
         }
 
@@ -66,7 +66,7 @@ public sealed class GeneralStationRecordConsoleSystem : EntitySystem
         switch (listing.Count)
         {
             case 0:
-                _ui.TrySetUiState(uid, GeneralStationRecordConsoleKey.Key, new GeneralStationRecordConsoleState());
+                _ui.SetUiState(uid, GeneralStationRecordConsoleKey.Key, new GeneralStationRecordConsoleState());
                 return;
             case 1:
                 console.ActiveKey = listing.Keys.First();
@@ -80,6 +80,6 @@ public sealed class GeneralStationRecordConsoleSystem : EntitySystem
         _stationRecords.TryGetRecord<GeneralStationRecord>(key, out var record, stationRecords);
 
         GeneralStationRecordConsoleState newState = new(id, record, listing, console.Filter);
-        _ui.TrySetUiState(uid, GeneralStationRecordConsoleKey.Key, newState);
+        _ui.SetUiState(uid, GeneralStationRecordConsoleKey.Key, newState);
     }
 }
index 390310390e01d298b26c00b1c0238ace562eacad..4b5dd7290c0f5b2603c604b0dbf77a92862fedd8 100644 (file)
@@ -7,10 +7,8 @@ using Content.Shared.Lock;
 using Content.Shared.Storage;
 using Content.Shared.Storage.Components;
 using Content.Shared.Storage.EntitySystems;
-using Content.Shared.Timing;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
-using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
@@ -20,133 +18,21 @@ namespace Content.Server.Storage.EntitySystems;
 
 public sealed partial class StorageSystem : SharedStorageSystem
 {
-    [Dependency] private readonly IAdminManager _admin = default!;
     [Dependency] private readonly IPrototypeManager _prototype = default!;
-    [Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
-    [Dependency] private readonly SharedAudioSystem _audio = default!;
-
-    private const string OpenUiUseDelayID = "storage";
 
     public override void Initialize()
     {
         base.Initialize();
-        SubscribeLocalEvent<StorageComponent, GetVerbsEvent<ActivationVerb>>(AddUiVerb);
-        Subs.BuiEvents<StorageComponent>(StorageComponent.StorageUiKey.Key, subs =>
-        {
-            subs.Event<BoundUIClosedEvent>(OnBoundUIClosed);
-        });
         SubscribeLocalEvent<StorageComponent, BeforeExplodeEvent>(OnExploded);
 
         SubscribeLocalEvent<StorageFillComponent, MapInitEvent>(OnStorageFillMapInit);
     }
 
-    protected override void OnMapInit(Entity<StorageComponent> entity, ref MapInitEvent args)
-    {
-        base.OnMapInit(entity, ref args);
-
-        if (TryComp<UseDelayComponent>(entity, out var useDelay))
-            UseDelay.SetLength((entity, useDelay), entity.Comp.OpenUiCooldown, OpenUiUseDelayID);
-    }
-
-    private void AddUiVerb(EntityUid uid, StorageComponent component, GetVerbsEvent<ActivationVerb> args)
-    {
-        var silent = false;
-        if (!args.CanAccess || !args.CanInteract || TryComp<LockComponent>(uid, out var lockComponent) && lockComponent.Locked)
-        {
-            // we allow admins to open the storage anyways
-            if (!_admin.HasAdminFlag(args.User, AdminFlags.Admin))
-                return;
-
-            silent = true;
-        }
-
-        silent |= HasComp<GhostComponent>(args.User);
-
-        // Get the session for the user
-        if (!TryComp<ActorComponent>(args.User, out var actor))
-            return;
-
-        // Does this player currently have the storage UI open?
-        var uiOpen = _uiSystem.SessionHasOpenUi(uid, StorageComponent.StorageUiKey.Key, actor.PlayerSession);
-
-        ActivationVerb verb = new()
-        {
-            Act = () =>
-            {
-                if (uiOpen)
-                {
-                    _uiSystem.TryClose(uid, StorageComponent.StorageUiKey.Key, actor.PlayerSession);
-                }
-                else
-                {
-                    OpenStorageUI(uid, args.User, component, silent);
-                }
-            }
-        };
-        if (uiOpen)
-        {
-            verb.Text = Loc.GetString("comp-storage-verb-close-storage");
-            verb.Icon = new SpriteSpecifier.Texture(
-                new("/Textures/Interface/VerbIcons/close.svg.192dpi.png"));
-        }
-        else
-        {
-            verb.Text = Loc.GetString("comp-storage-verb-open-storage");
-            verb.Icon = new SpriteSpecifier.Texture(
-                new("/Textures/Interface/VerbIcons/open.svg.192dpi.png"));
-        }
-        args.Verbs.Add(verb);
-    }
-
-    private void OnBoundUIClosed(EntityUid uid, StorageComponent storageComp, BoundUIClosedEvent args)
-    {
-        if (TryComp<ActorComponent>(args.Session.AttachedEntity, out var actor) && actor?.PlayerSession != null)
-            CloseNestedInterfaces(uid, actor.PlayerSession, storageComp);
-
-        // If UI is closed for everyone
-        if (!_uiSystem.IsUiOpen(uid, args.UiKey))
-        {
-            storageComp.IsUiOpen = false;
-            UpdateAppearance((uid, storageComp, null));
-
-            if (storageComp.StorageCloseSound is not null)
-                Audio.PlayEntity(storageComp.StorageCloseSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, storageComp.StorageCloseSound.Params);
-        }
-    }
-
     private void OnExploded(Entity<StorageComponent> ent, ref BeforeExplodeEvent args)
     {
         args.Contents.AddRange(ent.Comp.Container.ContainedEntities);
     }
 
-    /// <summary>
-    ///     Opens the storage UI for an entity
-    /// </summary>
-    /// <param name="entity">The entity to open the UI for</param>
-    public override void OpenStorageUI(EntityUid uid, EntityUid entity, StorageComponent? storageComp = null, bool silent = false)
-    {
-        if (!Resolve(uid, ref storageComp, false) || !TryComp(entity, out ActorComponent? player))
-            return;
-
-        // prevent spamming bag open / honkerton honk sound
-        silent |= TryComp<UseDelayComponent>(uid, out var useDelay) && UseDelay.IsDelayed((uid, useDelay), OpenUiUseDelayID);
-        if (!silent)
-        {
-            if (!storageComp.IsUiOpen)
-                _audio.PlayPvs(storageComp.StorageOpenSound, uid);
-            if (useDelay != null)
-                UseDelay.TryResetDelay((uid, useDelay), id: OpenUiUseDelayID);
-        }
-
-        Log.Debug($"Storage (UID {uid}) \"used\" by player session (UID {player.PlayerSession.AttachedEntity}).");
-
-        var bui = _uiSystem.GetUiOrNull(uid, StorageComponent.StorageUiKey.Key);
-        if (bui == null)
-            return;
-        _uiSystem.OpenUi(bui, player.PlayerSession);
-        _uiSystem.SendUiMessage(bui, new StorageModifyWindowMessage());
-    }
-
     /// <inheritdoc />
     public override void PlayPickupAnimation(EntityUid uid, EntityCoordinates initialCoordinates, EntityCoordinates finalCoordinates,
         Angle initialRotation, EntityUid? user = null)
@@ -154,30 +40,4 @@ public sealed partial class StorageSystem : SharedStorageSystem
         var filter = Filter.Pvs(uid).RemoveWhereAttachedEntity(e => e == user);
         RaiseNetworkEvent(new PickupAnimationEvent(GetNetEntity(uid), GetNetCoordinates(initialCoordinates), GetNetCoordinates(finalCoordinates), initialRotation), filter);
     }
-
-    /// <summary>
-    ///     If the user has nested-UIs open (e.g., PDA UI open when pda is in a backpack), close them.
-    /// </summary>
-    /// <param name="session"></param>
-    public void CloseNestedInterfaces(EntityUid uid, ICommonSession session, StorageComponent? storageComp = null)
-    {
-        if (!Resolve(uid, ref storageComp))
-            return;
-
-        // for each containing thing
-        // if it has a storage comp
-        // ensure unsubscribe from session
-        // if it has a ui component
-        // close ui
-        foreach (var entity in storageComp.Container.ContainedEntities)
-        {
-            if (!TryComp(entity, out UserInterfaceComponent? ui))
-                continue;
-
-            foreach (var bui in ui.Interfaces.Values)
-            {
-                _uiSystem.TryClose(entity, bui.UiKey, session, ui);
-            }
-        }
-    }
 }
index 25f64ba4b643ece5349ff6f90f3929b25e0618bf..864fe1185a42d818e8347627e42aa8e15349d991 100644 (file)
@@ -73,7 +73,7 @@ public sealed partial class StoreSystem
         if (!Resolve(uid, ref component))
             return;
 
-        _ui.TryCloseAll(uid, StoreUiKey.Key);
+        _ui.CloseUi(uid, StoreUiKey.Key);
     }
 
     /// <summary>
@@ -83,12 +83,13 @@ public sealed partial class StoreSystem
     /// <param name="store">The store entity itself</param>
     /// <param name="component">The store component being refreshed.</param>
     /// <param name="ui"></param>
-    public void UpdateUserInterface(EntityUid? user, EntityUid store, StoreComponent? component = null, PlayerBoundUserInterface? ui = null)
+    public void UpdateUserInterface(EntityUid? user, EntityUid store, StoreComponent? component = null)
     {
         if (!Resolve(store, ref component))
             return;
 
-        if (ui == null && !_ui.TryGetUi(store, StoreUiKey.Key, out ui))
+        // TODO: Why is the state not being set unless this?
+        if (!_ui.IsUiOpen(store, StoreUiKey.Key))
             return;
 
         //this is the person who will be passed into logic for all listing filtering.
@@ -113,12 +114,12 @@ public sealed partial class StoreSystem
         // only tell operatives to lock their uplink if it can be locked
         var showFooter = HasComp<RingerUplinkComponent>(store);
         var state = new StoreUpdateState(component.LastAvailableListings, allCurrency, showFooter, component.RefundAllowed);
-        _ui.SetUiState(ui, state);
+        _ui.SetUiState(store, StoreUiKey.Key, state);
     }
 
     private void OnRequestUpdate(EntityUid uid, StoreComponent component, StoreRequestUpdateInterfaceMessage args)
     {
-        UpdateUserInterface(args.Session.AttachedEntity, GetEntity(args.Entity), component);
+        UpdateUserInterface(args.Actor, GetEntity(args.Entity), component);
     }
 
     private void BeforeActivatableUiOpen(EntityUid uid, StoreComponent component, BeforeActivatableUIOpenEvent args)
@@ -139,8 +140,7 @@ public sealed partial class StoreSystem
             return;
         }
 
-        if (msg.Session.AttachedEntity is not { Valid: true } buyer)
-            return;
+        var buyer = msg.Actor;
 
         //verify that we can actually buy this listing and it wasn't added
         if (!ListingHasCategory(listing, component.Categories))
@@ -263,7 +263,7 @@ public sealed partial class StoreSystem
             $"{ToPrettyString(buyer):player} purchased listing \"{ListingLocalisationHelpers.GetLocalisedNameOrEntityName(listing, _prototypeManager)}\" from {ToPrettyString(uid)}");
 
         listing.PurchaseAmount++; //track how many times something has been purchased
-        _audio.PlayEntity(component.BuySuccessSound, msg.Session, uid); //cha-ching!
+        _audio.PlayEntity(component.BuySuccessSound, msg.Actor, uid); //cha-ching!
 
         UpdateUserInterface(buyer, uid, component);
     }
@@ -289,8 +289,7 @@ public sealed partial class StoreSystem
         if (proto.Cash == null || !proto.CanWithdraw)
             return;
 
-        if (msg.Session.AttachedEntity is not { Valid: true } buyer)
-            return;
+        var buyer = msg.Actor;
 
         FixedPoint2 amountRemaining = msg.Amount;
         var coordinates = Transform(buyer).Coordinates;
@@ -313,7 +312,7 @@ public sealed partial class StoreSystem
     {
         // TODO: Remove guardian/holopara
 
-        if (args.Session.AttachedEntity is not { Valid: true } buyer)
+        if (args.Actor is not { Valid: true } buyer)
             return;
 
         if (!IsOnStartingMap(uid, component))
index 56426e04045f230a799726d23a676b864f6cb3b5..7998c42f533e22195b841fc86d042a4c3bc3ad34 100644 (file)
@@ -199,10 +199,9 @@ public sealed partial class StoreSystem : EntitySystem
         if (component.Balance == new Dictionary<string, FixedPoint2>() && preset.InitialBalance != null) //if we don't have a value stored, use the preset
             TryAddCurrency(preset.InitialBalance, uid, component);
 
-        var ui = _ui.GetUiOrNull(uid, StoreUiKey.Key);
-        if (ui != null)
+        if (_ui.HasUi(uid, StoreUiKey.Key))
         {
-            _ui.SetUiState(ui, new StoreInitializeState(preset.StoreName));
+            _ui.SetUiState(uid, StoreUiKey.Key, new StoreInitializeState(preset.StoreName));
         }
     }
 }
index 9447dec417203efb4a813390ef5263618429f6f6..1dba52a698425be275fdd196edbca92e78354247 100644 (file)
@@ -111,17 +111,15 @@ namespace Content.Server.Strip
             if (TryComp<CombatModeComponent>(user, out var mode) && mode.IsInCombatMode && !openInCombat)
                 return;
 
-            if (TryComp<ActorComponent>(user, out var actor) && HasComp<StrippingComponent>(user))
+            if (HasComp<StrippingComponent>(user))
             {
-                if (_userInterfaceSystem.SessionHasOpenUi(strippable, StrippingUiKey.Key, actor.PlayerSession))
-                    return;
-                _userInterfaceSystem.TryOpen(strippable, StrippingUiKey.Key, actor.PlayerSession);
+                _userInterfaceSystem.OpenUi(strippable.Owner, StrippingUiKey.Key, user);
             }
         }
 
         private void OnStripButtonPressed(Entity<StrippableComponent> strippable, ref StrippingSlotButtonPressed args)
         {
-            if (args.Session.AttachedEntity is not { Valid: true } user ||
+            if (args.Actor is not { Valid: true } user ||
                 !TryComp<HandsComponent>(user, out var userHands))
                 return;
 
@@ -173,7 +171,7 @@ namespace Content.Server.Strip
 
         private void OnStripEnsnareMessage(EntityUid uid, EnsnareableComponent component, StrippingEnsnareButtonPressed args)
         {
-            if (args.Session.AttachedEntity is not { Valid: true } user)
+            if (args.Actor is not { Valid: true } user)
                 return;
 
             foreach (var entity in component.Container.ContainedEntities)
index f258fbe89cf67ae3e68447c1e9d5049c47fcdab4..ca0f59cd14d410330372a3e3d46a4e0ca4ad4dfd 100644 (file)
@@ -90,7 +90,7 @@ public sealed class SurveillanceCameraMonitorSystem : EntitySystem
     private void OnSubnetRequest(EntityUid uid, SurveillanceCameraMonitorComponent component,
         SurveillanceCameraMonitorSubnetRequestMessage args)
     {
-        if (args.Session.AttachedEntity != null)
+        if (args.Actor != null)
         {
             SetActiveSubnet(uid, args.Subnet, component);
         }
@@ -208,13 +208,9 @@ public sealed class SurveillanceCameraMonitorSystem : EntitySystem
 
     private void OnBoundUiClose(EntityUid uid, SurveillanceCameraMonitorComponent component, BoundUIClosedEvent args)
     {
-        if (args.Session.AttachedEntity == null)
-        {
-            return;
-        }
-
-        RemoveViewer(uid, args.Session.AttachedEntity.Value, component);
+        RemoveViewer(uid, args.Actor, component);
     }
+
     #endregion
 
     private void SendHeartbeat(EntityUid uid, SurveillanceCameraMonitorComponent? monitor = null)
@@ -487,6 +483,6 @@ public sealed class SurveillanceCameraMonitorSystem : EntitySystem
         }
 
         var state = new SurveillanceCameraMonitorUiState(GetNetEntity(monitor.ActiveCamera), monitor.KnownSubnets.Keys.ToHashSet(), monitor.ActiveCameraAddress, monitor.ActiveSubnet, monitor.KnownCameras);
-        _userInterface.TrySetUiState(uid, SurveillanceCameraMonitorUiKey.Key, state);
+        _userInterface.SetUiState(uid, SurveillanceCameraMonitorUiKey.Key, state);
     }
 }
index ac417230267677fc033c62d1d70c6e0d93268ac0..d0c2cd78d320b9ad3888cd4c7dda15efa5d47363 100644 (file)
@@ -134,14 +134,14 @@ public sealed class SurveillanceCameraRouterSystem : EntitySystem
         UpdateSetupInterface(uid, component);
     }
 
-    private void OpenSetupInterface(EntityUid uid, EntityUid player, SurveillanceCameraRouterComponent? camera = null, ActorComponent? actor = null)
+    private void OpenSetupInterface(EntityUid uid, EntityUid player, SurveillanceCameraRouterComponent? camera = null)
     {
-        if (!Resolve(uid, ref camera) || !Resolve(player, ref actor))
+        if (!Resolve(uid, ref camera))
             return;
-        if (!_userInterface.TryGetUi(uid, SurveillanceCameraSetupUiKey.Router, out var bui))
+
+        if (!_userInterface.TryOpenUi(uid, SurveillanceCameraSetupUiKey.Router, player))
             return;
 
-        _userInterface.OpenUi(bui, actor.PlayerSession);
         UpdateSetupInterface(uid, camera);
     }
 
@@ -154,13 +154,13 @@ public sealed class SurveillanceCameraRouterSystem : EntitySystem
 
         if (router.AvailableNetworks.Count == 0 || router.SubnetFrequencyId != null)
         {
-            _userInterface.TryCloseAll(uid, SurveillanceCameraSetupUiKey.Router);
+            _userInterface.CloseUi(uid, SurveillanceCameraSetupUiKey.Router);
             return;
         }
 
         var state = new SurveillanceCameraSetupBoundUiState(router.SubnetName, deviceNet.ReceiveFrequency ?? 0,
             router.AvailableNetworks, true, router.SubnetFrequencyId != null);
-        _userInterface.TrySetUiState(uid, SurveillanceCameraSetupUiKey.Router, state);
+        _userInterface.SetUiState(uid, SurveillanceCameraSetupUiKey.Router, state);
     }
 
     private void SendHeartbeat(EntityUid uid, string origin, string destination,
index 410ba9f7540d89949a42723e85d465f85aa1822a..8dd253269d06cb75b09e84029a082a1a5ac3ebf5 100644 (file)
@@ -196,14 +196,14 @@ public sealed class SurveillanceCameraSystem : EntitySystem
         UpdateSetupInterface(uid, component);
     }
 
-    private void OpenSetupInterface(EntityUid uid, EntityUid player, SurveillanceCameraComponent? camera = null, ActorComponent? actor = null)
+    private void OpenSetupInterface(EntityUid uid, EntityUid player, SurveillanceCameraComponent? camera = null)
     {
-        if (!Resolve(uid, ref camera) || !Resolve(player, ref actor))
+        if (!Resolve(uid, ref camera))
             return;
-        if (!_userInterface.TryGetUi(uid, SurveillanceCameraSetupUiKey.Camera, out var bui))
+
+        if (!_userInterface.TryOpenUi(uid, SurveillanceCameraSetupUiKey.Camera, player))
             return;
 
-        _userInterface.OpenUi(bui, actor.PlayerSession);
         UpdateSetupInterface(uid, camera);
     }
 
@@ -216,7 +216,7 @@ public sealed class SurveillanceCameraSystem : EntitySystem
 
         if (camera.NameSet && camera.NetworkSet)
         {
-            _userInterface.TryCloseAll(uid, SurveillanceCameraSetupUiKey.Camera);
+            _userInterface.CloseUi(uid, SurveillanceCameraSetupUiKey.Camera);
             return;
         }
 
@@ -228,14 +228,14 @@ public sealed class SurveillanceCameraSystem : EntitySystem
             }
             else if (!camera.NetworkSet)
             {
-                _userInterface.TryCloseAll(uid, SurveillanceCameraSetupUiKey.Camera);
+                _userInterface.CloseUi(uid, SurveillanceCameraSetupUiKey.Camera);
                 return;
             }
         }
 
         var state = new SurveillanceCameraSetupBoundUiState(camera.CameraId, deviceNet.ReceiveFrequency ?? 0,
             camera.AvailableNetworks, camera.NameSet, camera.NetworkSet);
-        _userInterface.TrySetUiState(uid, SurveillanceCameraSetupUiKey.Camera, state);
+        _userInterface.SetUiState(uid, SurveillanceCameraSetupUiKey.Camera, state);
     }
 
     // If the camera deactivates for any reason, it must have all viewers removed,
index 99185653288f4e57bdda0cc53c97bcc53e79bdb0..133876bd751fdc1a3afe1c24650daebcd2768b94 100644 (file)
@@ -79,6 +79,6 @@ public sealed class ThiefUndeterminedBackpackSystem : EntitySystem
             data.Add(i, info);
         }
 
-        _ui.TrySetUiState(uid, ThiefBackpackUIKey.Key, new ThiefBackpackBoundUserInterfaceState(data, MaxSelectedSets));
+        _ui.SetUiState(uid, ThiefBackpackUIKey.Key, new ThiefBackpackBoundUserInterfaceState(data, MaxSelectedSets));
     }
 }
index 4d3c7ffba97cc130390bf7b29f4a9c45777e423a..83936edc8c479f07a16fc16ae18fc5b5dfb0efe3 100644 (file)
@@ -9,18 +9,12 @@ public sealed partial class IntrinsicUIComponent : Component
     /// <summary>
     /// List of UIs and their actions that this entity has.
     /// </summary>
-    [DataField("uis", required: true)] public List<IntrinsicUIEntry> UIs = new();
+    [DataField("uis", required: true)] public Dictionary<Enum, IntrinsicUIEntry> UIs = new();
 }
 
 [DataDefinition]
-public partial class IntrinsicUIEntry
+public sealed partial class IntrinsicUIEntry
 {
-    /// <summary>
-    /// The BUI key that this intrinsic UI should open.
-    /// </summary>
-    [DataField("key", required: true)]
-    public Enum? Key { get; private set; }
-
     [DataField("toggleAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>), required: true)]
     public string? ToggleAction;
 
index fa725e524a0a449cdda26c9ce7e3ce74d503fde1..0f7261865dcfd03c50729c7856710d9c487f0b71 100644 (file)
@@ -18,50 +18,31 @@ public sealed class IntrinsicUISystem : EntitySystem
 
     private void OnActionToggle(EntityUid uid, IntrinsicUIComponent component, ToggleIntrinsicUIEvent args)
     {
+        if (args.Key == null)
+            return;
+
         args.Handled = InteractUI(uid, args.Key, component);
     }
 
     private void InitActions(EntityUid uid, IntrinsicUIComponent component, MapInitEvent args)
     {
-        foreach (var entry in component.UIs)
+        foreach (var entry in component.UIs.Values)
         {
             _actionsSystem.AddAction(uid, ref entry.ToggleActionEntity, entry.ToggleAction);
         }
     }
 
-    public bool InteractUI(EntityUid uid, Enum? key, IntrinsicUIComponent? iui = null, ActorComponent? actor = null)
+    public bool InteractUI(EntityUid uid, Enum key, IntrinsicUIComponent? iui = null, ActorComponent? actor = null)
     {
         if (!Resolve(uid, ref iui, ref actor))
             return false;
 
-        if (key is null)
-        {
-            Log.Error($"Entity {ToPrettyString(uid)} has an invalid intrinsic UI.");
-        }
-
-        var ui = GetUIOrNull(uid, key, iui);
-
-        if (ui is null)
-        {
-            Log.Error($"Couldn't get UI {key} on {ToPrettyString(uid)}");
-            return false;
-        }
-
         var attempt = new IntrinsicUIOpenAttemptEvent(uid, key);
         RaiseLocalEvent(uid, attempt);
         if (attempt.Cancelled)
             return false;
 
-        _uiSystem.ToggleUi(ui, actor.PlayerSession);
-        return true;
-    }
-
-    private PlayerBoundUserInterface? GetUIOrNull(EntityUid uid, Enum? key, IntrinsicUIComponent? component = null)
-    {
-        if (!Resolve(uid, ref component))
-            return null;
-
-        return key is null ? null : _uiSystem.GetUiOrNull(uid, key);
+        return _uiSystem.TryToggleUi(uid, key, actor.PlayerSession);
     }
 }
 
index 7c9aed188fe91d72b4f6957216515d1ea81b513f..723b9de6267c93621f12321cf860bf9095ece366 100644 (file)
@@ -115,7 +115,7 @@ namespace Content.Server.VendingMachines
         {
             var state = new VendingMachineInterfaceState(GetAllInventory(uid, component));
 
-            _userInterfaceSystem.TrySetUiState(uid, VendingMachineUiKey.Key, state);
+            _userInterfaceSystem.SetUiState(uid, VendingMachineUiKey.Key, state);
         }
 
         private void OnInventoryEjectMessage(EntityUid uid, VendingMachineComponent component, VendingMachineEjectMessage args)
@@ -123,7 +123,7 @@ namespace Content.Server.VendingMachines
             if (!this.IsPowered(uid, EntityManager))
                 return;
 
-            if (args.Session.AttachedEntity is not { Valid: true } entity || Deleted(entity))
+            if (args.Actor is not { Valid: true } entity || Deleted(entity))
                 return;
 
             AuthorizedVend(uid, entity, args.Type, args.ID, component);
index ad9020d324f6f8908a300460487afdb43ab70654..df972b9a14ae1d001a0b7e68ca1ebb07700549d0 100644 (file)
@@ -41,17 +41,14 @@ public sealed partial class VoiceMaskSystem : EntitySystem
     {
         if (message.Name.Length > HumanoidCharacterProfile.MaxNameLength || message.Name.Length <= 0)
         {
-            _popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-failure"), uid, message.Session, PopupType.SmallCaution);
+            _popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-failure"), uid, message.Actor, PopupType.SmallCaution);
             return;
         }
 
         component.VoiceName = message.Name;
-        if (message.Session.AttachedEntity != null)
-            _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(message.Session.AttachedEntity.Value):player} set voice of {ToPrettyString(uid):mask}: {component.VoiceName}");
-        else
-            _adminLogger.Add(LogType.Action, LogImpact.Medium, $"Voice of {ToPrettyString(uid):mask} set: {component.VoiceName}");
+        _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(message.Actor):player} set voice of {ToPrettyString(uid):mask}: {component.VoiceName}");
 
-        _popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-success"), uid, message.Session);
+        _popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-success"), uid, message.Actor);
 
         TrySetLastKnownName(uid, message.Name);
 
@@ -66,7 +63,7 @@ public sealed partial class VoiceMaskSystem : EntitySystem
         ent.Comp.SpeechVerb = msg.Verb;
         // verb is only important to metagamers so no need to log as opposed to name
 
-        _popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-success"), ent, msg.Session);
+        _popupSystem.PopupEntity(Loc.GetString("voice-mask-popup-success"), ent, msg.Actor);
 
         TrySetLastSpeechVerb(ent, msg.Verb);
 
@@ -94,14 +91,12 @@ public sealed partial class VoiceMaskSystem : EntitySystem
         ent.Comp.Enabled = !args.IsToggled;
     }
 
-    private void OpenUI(EntityUid player, ActorComponent? actor = null)
+    private void OpenUI(EntityUid player)
     {
-        if (!Resolve(player, ref actor))
-            return;
-        if (!_uiSystem.TryGetUi(player, VoiceMaskUIKey.Key, out var bui))
+        if (!_uiSystem.HasUi(player, VoiceMaskUIKey.Key))
             return;
 
-        _uiSystem.OpenUi(bui, actor.PlayerSession);
+        _uiSystem.OpenUi(player, VoiceMaskUIKey.Key, player);
         UpdateUI(player);
     }
 
@@ -112,7 +107,7 @@ public sealed partial class VoiceMaskSystem : EntitySystem
             return;
         }
 
-        if (_uiSystem.TryGetUi(owner, VoiceMaskUIKey.Key, out var bui))
-            _uiSystem.SetUiState(bui, new VoiceMaskBuiState(component.VoiceName, component.SpeechVerb));
+        if (_uiSystem.HasUi(owner, VoiceMaskUIKey.Key))
+            _uiSystem.SetUiState(owner, VoiceMaskUIKey.Key, new VoiceMaskBuiState(component.VoiceName, component.SpeechVerb));
     }
 }
index a2deb11fe78dd84fa0de35a38bcd8512c2787fe1..5d31a4d1440249fc0398f3a80a63f113c348cccb 100644 (file)
@@ -17,6 +17,7 @@ using Robust.Server.GameObjects;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
+using ActivatableUISystem = Content.Shared.UserInterface.ActivatableUISystem;
 
 namespace Content.Server.Wires;
 
@@ -393,11 +394,11 @@ public sealed class WiresSystem : SharedWiresSystem
 
     private void OnWiresActionMessage(EntityUid uid, WiresComponent component, WiresActionMessage args)
     {
-        if (args.Session.AttachedEntity == null)
+        if (args.Actor == null)
         {
             return;
         }
-        var player = (EntityUid) args.Session.AttachedEntity;
+        var player = (EntityUid) args.Actor;
 
         if (!EntityManager.TryGetComponent(player, out HandsComponent? handsComponent))
         {
@@ -458,7 +459,7 @@ public sealed class WiresSystem : SharedWiresSystem
         {
             if (TryComp(args.User, out ActorComponent? actor))
             {
-                _uiSystem.TryOpen(uid, WiresUiKey.Key, actor.PlayerSession);
+                _uiSystem.OpenUi(uid, WiresUiKey.Key, actor.PlayerSession);
                 args.Handled = true;
             }
         }
@@ -468,7 +469,8 @@ public sealed class WiresSystem : SharedWiresSystem
     {
         if (args.Open)
             return;
-        _uiSystem.TryCloseAll(ent, WiresUiKey.Key);
+
+        _uiSystem.CloseUi(ent.Owner, WiresUiKey.Key);
     }
 
     private void OnAttemptOpenActivatableUI(EntityUid uid, ActivatableUIRequiresPanelComponent component, ActivatableUIOpenAttemptEvent args)
@@ -574,18 +576,17 @@ public sealed class WiresSystem : SharedWiresSystem
 
         statuses.Sort((a, b) => a.position.CompareTo(b.position));
 
-        _uiSystem.TrySetUiState(uid, WiresUiKey.Key, new WiresBoundUserInterfaceState(
+        _uiSystem.SetUiState((uid, ui), WiresUiKey.Key, new WiresBoundUserInterfaceState(
             clientList.ToArray(),
             statuses.Select(p => new StatusEntry(p.key, p.value)).ToArray(),
             Loc.GetString(wires.BoardName),
             wires.SerialNumber,
-            wires.WireSeed), ui: ui);
+            wires.WireSeed));
     }
 
     public void OpenUserInterface(EntityUid uid, ICommonSession player)
     {
-        if (_uiSystem.TryGetUi(uid, WiresUiKey.Key, out var ui))
-            _uiSystem.OpenUi(ui, player);
+        _uiSystem.OpenUi(uid, WiresUiKey.Key, player);
     }
 
     /// <summary>
@@ -629,7 +630,7 @@ public sealed class WiresSystem : SharedWiresSystem
 
         if (!args.WiresAccessible)
         {
-            _uiSystem.TryCloseAll(uid, WiresUiKey.Key);
+            _uiSystem.CloseUi(uid, WiresUiKey.Key);
         }
     }
 
index 2e546dd200d5399f2f4b1695f94d356c1850f546..59ca913a3984aa148125ec68e8c6b6dd7bc03fd5 100644 (file)
@@ -223,8 +223,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
         var state = new AnalysisConsoleUpdateState(GetNetEntity(artifact), analyzerConnected, serverConnected,
             canScan, canPrint, msg, scanning, paused, active?.StartTime, active?.AccumulatedRunTime, totalTime, points, biasDirection == BiasDirection.Down);
 
-        var bui = _ui.GetUi(uid, ArtifactAnalzyerUiKey.Key);
-        _ui.SetUiState(bui, state);
+        _ui.SetUiState(uid, ArtifactAnalzyerUiKey.Key, state);
     }
 
     /// <summary>
@@ -235,7 +234,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
     /// <param name="args"></param>
     private void OnServerSelectionMessage(EntityUid uid, AnalysisConsoleComponent component, AnalysisConsoleServerSelectionMessage args)
     {
-        _ui.TryOpen(uid, ResearchClientUiKey.Key, args.Session);
+        _ui.OpenUi(uid, ResearchClientUiKey.Key, args.Actor);
     }
 
     /// <summary>
index ebc23c7b053e3c9036bf80521032cf26dc219c8e..96a4dfc2ddd87b72122560068fbdbcd030aa5d37 100644 (file)
@@ -1,6 +1,9 @@
-namespace Content.Shared.Administration.Components;
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Administration.Components;
 
 /// <summary>
 /// Flips the target's sprite on it's head, so they do a headstand.
 /// </summary>
+[NetworkedComponent]
 public abstract partial class SharedHeadstandComponent : Component { }
index 2e6d54ca8847dc418110d16918b4ba6ca8aa6d5c..9a95454f72141c4fad7b0d1a6ea73ce503095238 100644 (file)
@@ -1,5 +1,8 @@
-namespace Content.Shared.Administration.Components;
+using Robust.Shared.GameStates;
 
+namespace Content.Shared.Administration.Components;
+
+[NetworkedComponent]
 public abstract partial class SharedKillSignComponent : Component
 {
 
index 34a64d0edbd3db79fb022e101de89f94cd359c76..3bea79d345171e3437272b32d8dba664d58a5124 100644 (file)
@@ -42,7 +42,7 @@ public sealed class SolutionTransferSystem : EntitySystem
         var newTransferAmount = FixedPoint2.Clamp(message.Value, ent.Comp.MinimumTransferAmount, ent.Comp.MaximumTransferAmount);
         ent.Comp.TransferAmount = newTransferAmount;
 
-        if (message.Session.AttachedEntity is { Valid: true } user)
+        if (message.Actor is { Valid: true } user)
             _popup.PopupClient(Loc.GetString("comp-solution-transfer-set-amount", ("amount", newTransferAmount)), ent, user);
     }
 
@@ -53,10 +53,9 @@ public sealed class SolutionTransferSystem : EntitySystem
         if (!args.CanAccess || !args.CanInteract || !comp.CanChangeTransferAmount || args.Hands == null)
             return;
 
-        if (!TryComp<ActorComponent>(args.User, out var actor))
-            return;
-
         // Custom transfer verb
+        var @event = args;
+
         args.Verbs.Add(new AlternativeVerb()
         {
             Text = Loc.GetString("comp-solution-transfer-verb-custom-amount"),
@@ -64,8 +63,7 @@ public sealed class SolutionTransferSystem : EntitySystem
             // TODO: remove server check when bui prediction is a thing
             Act = () =>
             {
-                if (_net.IsServer)
-                    _ui.TryOpen(uid, TransferAmountUiKey.Key, actor.PlayerSession);
+                _ui.OpenUi(uid, TransferAmountUiKey.Key, @event.User);
             },
             Priority = 1
         });
index 83e09b1a6dd048b6f736f0056c5d40301ae360df..914b34d3c125ee7d073106c3c5c982e53b823185 100644 (file)
@@ -626,9 +626,9 @@ namespace Content.Shared.Containers.ItemSlots
                 return;
 
             if (args.TryEject && slot.HasItem)
-                TryEjectToHands(uid, slot, args.Session.AttachedEntity, false);
-            else if (args.TryInsert && !slot.HasItem && args.Session.AttachedEntity is EntityUid user)
-                TryInsertFromHand(uid, slot, user);
+                TryEjectToHands(uid, slot, args.Actor, true);
+            else if (args.TryInsert && !slot.HasItem)
+                TryInsertFromHand(uid, slot, args.Actor);
         }
         #endregion
 
index 4cca399b28b9768c2268ce358511ed3684970001..51a80dfd21321908eecec0bf52e1f9670d13671d 100644 (file)
@@ -23,6 +23,9 @@
       <Private>false</Private>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Power\Components\" />
+  </ItemGroup>
   <Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
   <Import Project="..\RobustToolbox\MSBuild\Robust.CompNetworkGenerator.targets" />
 </Project>
index 53d58f1d80f4289fe3c8a5caa8dcd3213bcb69d5..dbb1f6f2c4dede9ff07b37bb6c4698900a90b199 100644 (file)
@@ -1,8 +1,10 @@
 using Robust.Shared.Audio;
+using Robust.Shared.GameStates;
 using Robust.Shared.Serialization;
 
 namespace Content.Shared.Extinguisher;
 
+[NetworkedComponent]
 public abstract partial class SharedFireExtinguisherComponent : Component
 {
     [DataField("refillSound")] public SoundSpecifier RefillSound = new SoundPathSpecifier("/Audio/Effects/refill.ogg");
index 2eabe14d2365bc7fb47edd32cf9b0c970636eb64..1f421d0e6f70fe1c80ba621b688ac6b679a7590d 100644 (file)
@@ -76,8 +76,11 @@ namespace Content.Shared.Interaction
 
         public override void Initialize()
         {
+            SubscribeLocalEvent<BoundUserInterfaceCheckRangeEvent>(HandleUserInterfaceRangeCheck);
             SubscribeLocalEvent<BoundUserInterfaceMessageAttempt>(OnBoundInterfaceInteractAttempt);
+
             SubscribeAllEvent<InteractInventorySlotEvent>(HandleInteractInventorySlotEvent);
+
             SubscribeLocalEvent<UnremoveableComponent, ContainerGettingRemovedAttemptEvent>(OnRemoveAttempt);
             SubscribeLocalEvent<UnremoveableComponent, GotUnequippedEvent>(OnUnequip);
             SubscribeLocalEvent<UnremoveableComponent, GotUnequippedHandEvent>(OnUnequipHand);
@@ -108,7 +111,9 @@ namespace Content.Shared.Interaction
         /// </summary>
         private void OnBoundInterfaceInteractAttempt(BoundUserInterfaceMessageAttempt ev)
         {
-            if (ev.Sender.AttachedEntity is not { } user || !_actionBlockerSystem.CanInteract(user, ev.Target))
+            var user = ev.Actor;
+
+            if (!_actionBlockerSystem.CanInteract(user, ev.Target))
             {
                 ev.Cancel();
                 return;
@@ -1145,6 +1150,21 @@ namespace Content.Shared.Interaction
             RaiseLocalEvent(uidA, new ContactInteractionEvent(uidB.Value));
             RaiseLocalEvent(uidB.Value, new ContactInteractionEvent(uidA));
         }
+
+        private void HandleUserInterfaceRangeCheck(ref BoundUserInterfaceCheckRangeEvent ev)
+        {
+            if (ev.Result == BoundUserInterfaceRangeResult.Fail)
+                return;
+
+            if (InRangeUnobstructed(ev.Actor, ev.Target, ev.Data.InteractionRange))
+            {
+                ev.Result = BoundUserInterfaceRangeResult.Pass;
+            }
+            else
+            {
+                ev.Result = BoundUserInterfaceRangeResult.Fail;
+            }
+        }
     }
 
     /// <summary>
index dd87f9f907ab689958cd5f9007b4bd6f7dc3af5d..f65a599e539f873b113292b8c97f54631488693e 100644 (file)
@@ -1,8 +1,10 @@
 using Robust.Shared.Audio;
+using Robust.Shared.GameStates;
 using Robust.Shared.Serialization;
 
 namespace Content.Shared.Paper;
 
+[NetworkedComponent]
 public abstract partial class SharedPaperComponent : Component
 {
     /// <summary>
diff --git a/Content.Shared/Power/Components/ActivatableUIRequiresPowerComponent.cs b/Content.Shared/Power/Components/ActivatableUIRequiresPowerComponent.cs
new file mode 100644 (file)
index 0000000..af193c8
--- /dev/null
@@ -0,0 +1,8 @@
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Power.Components;
+
+[RegisterComponent, NetworkedComponent]
+public sealed partial class ActivatableUIRequiresPowerComponent : Component
+{
+}
index 3bec0e1d0166b74b2b9c6709ff72a3b6dfcfac43..4670f2dbf8dadc23ad538e46e65ea02b8bad8eb2 100644 (file)
@@ -2,9 +2,12 @@ using System.Collections.Frozen;
 using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using Content.Shared.ActionBlocker;
+using Content.Shared.Administration;
+using Content.Shared.Administration.Managers;
 using Content.Shared.Containers.ItemSlots;
 using Content.Shared.Destructible;
 using Content.Shared.DoAfter;
+using Content.Shared.Ghost;
 using Content.Shared.Hands.Components;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Implants.Components;
@@ -29,6 +32,7 @@ using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Serialization;
+using Robust.Shared.Utility;
 
 namespace Content.Shared.Storage.EntitySystems;
 
@@ -36,6 +40,7 @@ public abstract class SharedStorageSystem : EntitySystem
 {
     [Dependency] private   readonly IPrototypeManager _prototype = default!;
     [Dependency] protected readonly IRobustRandom Random = default!;
+    [Dependency] private readonly ISharedAdminManager _admin = default!;
     [Dependency] protected readonly ActionBlockerSystem ActionBlocker = default!;
     [Dependency] private   readonly EntityLookupSystem _entityLookupSystem = default!;
     [Dependency] private   readonly SharedAppearanceSystem _appearance = default!;
@@ -73,6 +78,7 @@ public abstract class SharedStorageSystem : EntitySystem
     private FrozenDictionary<string, ItemSizePrototype> _nextSmallest = FrozenDictionary<string, ItemSizePrototype>.Empty;
 
     private const string QuickInsertUseDelayID = "quickInsert";
+    private const string OpenUiUseDelayID = "storage";
 
     protected readonly List<string> CantFillReasons = [];
 
@@ -86,7 +92,13 @@ public abstract class SharedStorageSystem : EntitySystem
         _xformQuery = GetEntityQuery<TransformComponent>();
         _prototype.PrototypesReloaded += OnPrototypesReloaded;
 
+        Subs.BuiEvents<StorageComponent>(StorageComponent.StorageUiKey.Key, subs =>
+        {
+            subs.Event<BoundUIClosedEvent>(OnBoundUIClosed);
+        });
+
         SubscribeLocalEvent<StorageComponent, MapInitEvent>(OnMapInit);
+        SubscribeLocalEvent<StorageComponent, GetVerbsEvent<ActivationVerb>>(AddUiVerb);
         SubscribeLocalEvent<StorageComponent, ComponentGetState>(OnStorageGetState);
         SubscribeLocalEvent<StorageComponent, ComponentHandleState>(OnStorageHandleState);
         SubscribeLocalEvent<StorageComponent, ComponentInit>(OnComponentInit, before: new[] { typeof(SharedContainerSystem) });
@@ -121,10 +133,13 @@ public abstract class SharedStorageSystem : EntitySystem
         UpdatePrototypeCache();
     }
 
-    protected virtual void OnMapInit(Entity<StorageComponent> entity, ref MapInitEvent args)
+    private void OnMapInit(Entity<StorageComponent> entity, ref MapInitEvent args)
     {
         if (TryComp<UseDelayComponent>(entity, out var useDelayComp))
+        {
             UseDelay.SetLength((entity, useDelayComp), entity.Comp.QuickInsertCooldown, QuickInsertUseDelayID);
+            UseDelay.SetLength((entity, useDelayComp), entity.Comp.OpenUiCooldown, OpenUiUseDelayID);
+        }
     }
 
     private void OnStorageGetState(EntityUid uid, StorageComponent component, ref ComponentGetState args)
@@ -139,7 +154,6 @@ public abstract class SharedStorageSystem : EntitySystem
         args.State = new StorageComponentState()
         {
             Grid = new List<Box2i>(component.Grid),
-            IsUiOpen = component.IsUiOpen,
             MaxItemSize = component.MaxItemSize,
             StoredItems = storedItems,
             SavedLocations = component.SavedLocations
@@ -153,7 +167,6 @@ public abstract class SharedStorageSystem : EntitySystem
 
         component.Grid.Clear();
         component.Grid.AddRange(state.Grid);
-        component.IsUiOpen = state.IsUiOpen;
         component.MaxItemSize = state.MaxItemSize;
 
         component.StoredItems.Clear();
@@ -205,9 +218,108 @@ public abstract class SharedStorageSystem : EntitySystem
         UpdateAppearance((uid, storageComp, null));
     }
 
-    public virtual void UpdateUI(Entity<StorageComponent?> entity) {}
+    /// <summary>
+    ///     If the user has nested-UIs open (e.g., PDA UI open when pda is in a backpack), close them.
+    /// </summary>
+    private void CloseNestedInterfaces(EntityUid uid, EntityUid actor, StorageComponent? storageComp = null)
+    {
+        if (!Resolve(uid, ref storageComp))
+            return;
 
-    public virtual void OpenStorageUI(EntityUid uid, EntityUid entity, StorageComponent? storageComp = null, bool silent = false) { }
+        // for each containing thing
+        // if it has a storage comp
+        // ensure unsubscribe from session
+        // if it has a ui component
+        // close ui
+        foreach (var entity in storageComp.Container.ContainedEntities)
+        {
+            _ui.CloseUis(entity, actor);
+        }
+    }
+
+    private void OnBoundUIClosed(EntityUid uid, StorageComponent storageComp, BoundUIClosedEvent args)
+    {
+        CloseNestedInterfaces(uid, args.Actor, storageComp);
+
+        // If UI is closed for everyone
+        if (!_ui.IsUiOpen(uid, args.UiKey))
+        {
+            UpdateAppearance((uid, storageComp, null));
+            Audio.PlayPredicted(storageComp.StorageCloseSound, uid, args.Actor);
+        }
+    }
+
+    private void AddUiVerb(EntityUid uid, StorageComponent component, GetVerbsEvent<ActivationVerb> args)
+    {
+        var silent = false;
+        if (!args.CanAccess || !args.CanInteract || TryComp<LockComponent>(uid, out var lockComponent) && lockComponent.Locked)
+        {
+            // we allow admins to open the storage anyways
+            if (!_admin.HasAdminFlag(args.User, AdminFlags.Admin))
+                return;
+
+            silent = true;
+        }
+
+        silent |= HasComp<GhostComponent>(args.User);
+
+        // Does this player currently have the storage UI open?
+        var uiOpen = _ui.IsUiOpen(uid, StorageComponent.StorageUiKey.Key, args.User);
+
+        ActivationVerb verb = new()
+        {
+            Act = () =>
+            {
+                if (uiOpen)
+                {
+                    _ui.CloseUi(uid, StorageComponent.StorageUiKey.Key, args.User);
+                }
+                else
+                {
+                    OpenStorageUI(uid, args.User, component, silent);
+                }
+            }
+        };
+
+        if (uiOpen)
+        {
+            verb.Text = Loc.GetString("comp-storage-verb-close-storage");
+            verb.Icon = new SpriteSpecifier.Texture(
+                new("/Textures/Interface/VerbIcons/close.svg.192dpi.png"));
+        }
+        else
+        {
+            verb.Text = Loc.GetString("comp-storage-verb-open-storage");
+            verb.Icon = new SpriteSpecifier.Texture(
+                new("/Textures/Interface/VerbIcons/open.svg.192dpi.png"));
+        }
+        args.Verbs.Add(verb);
+    }
+
+    /// <summary>
+    ///     Opens the storage UI for an entity
+    /// </summary>
+    /// <param name="entity">The entity to open the UI for</param>
+    public void OpenStorageUI(EntityUid uid, EntityUid entity, StorageComponent? storageComp = null, bool silent = false)
+    {
+        if (!Resolve(uid, ref storageComp, false))
+            return;
+
+        // prevent spamming bag open / honkerton honk sound
+        silent |= TryComp<UseDelayComponent>(uid, out var useDelay) && UseDelay.IsDelayed((uid, useDelay));
+        if (!silent)
+        {
+            if (!_ui.IsUiOpen(uid, StorageComponent.StorageUiKey.Key))
+                Audio.PlayPredicted(storageComp.StorageOpenSound, uid, entity);
+
+            if (useDelay != null)
+                UseDelay.TryResetDelay((uid, useDelay));
+        }
+
+        _ui.OpenUi(uid, StorageComponent.StorageUiKey.Key, entity);
+    }
+
+    public virtual void UpdateUI(Entity<StorageComponent?> entity) {}
 
     private void AddTransferVerbs(EntityUid uid, StorageComponent component, GetVerbsEvent<UtilityVerb> args)
     {
@@ -261,7 +373,16 @@ public abstract class SharedStorageSystem : EntitySystem
         if (args.Handled || TryComp<LockComponent>(uid, out var lockComponent) && lockComponent.Locked)
             return;
 
-        OpenStorageUI(uid, args.User, storageComp);
+        // Toggle
+        if (_ui.IsUiOpen(uid, StorageComponent.StorageUiKey.Key, args.User))
+        {
+            _ui.CloseUi(uid, StorageComponent.StorageUiKey.Key, args.User);
+        }
+        else
+        {
+            OpenStorageUI(uid, args.User, storageComp);
+        }
+
         args.Handled = true;
     }
 
@@ -460,8 +581,7 @@ public abstract class SharedStorageSystem : EntitySystem
         if (!TryComp<StorageComponent>(uid, out var storageComp))
             return;
 
-        if (!_ui.TryGetUi(uid, StorageComponent.StorageUiKey.Key, out var bui) ||
-            !bui.SubscribedSessions.Contains(args.SenderSession))
+        if (!_ui.IsUiOpen(uid, StorageComponent.StorageUiKey.Key, player))
             return;
 
         if (!Exists(entity))
@@ -503,8 +623,7 @@ public abstract class SharedStorageSystem : EntitySystem
         if (!TryComp<StorageComponent>(storageEnt, out var storageComp))
             return;
 
-        if (!_ui.TryGetUi(storageEnt, StorageComponent.StorageUiKey.Key, out var bui) ||
-            !bui.SubscribedSessions.Contains(args.SenderSession))
+        if (!_ui.IsUiOpen(storageEnt, StorageComponent.StorageUiKey.Key, player))
             return;
 
         if (!Exists(itemEnt))
@@ -530,8 +649,7 @@ public abstract class SharedStorageSystem : EntitySystem
         if (!TryComp<StorageComponent>(storageEnt, out var storageComp))
             return;
 
-        if (!_ui.TryGetUi(storageEnt, StorageComponent.StorageUiKey.Key, out var bui) ||
-            !bui.SubscribedSessions.Contains(args.SenderSession))
+        if (!_ui.IsUiOpen(storageEnt, StorageComponent.StorageUiKey.Key, player))
             return;
 
         if (!Exists(itemEnt))
@@ -558,8 +676,7 @@ public abstract class SharedStorageSystem : EntitySystem
         if (!TryComp<StorageComponent>(storageEnt, out var storageComp))
             return;
 
-        if (!_ui.TryGetUi(storageEnt, StorageComponent.StorageUiKey.Key, out var bui) ||
-            !bui.SubscribedSessions.Contains(args.SenderSession))
+        if (!_ui.IsUiOpen(storageEnt, StorageComponent.StorageUiKey.Key, player))
             return;
 
         if (!Exists(itemEnt))
@@ -584,11 +701,10 @@ public abstract class SharedStorageSystem : EntitySystem
         var storage = GetEntity(msg.Storage);
         var item = GetEntity(msg.Item);
 
-        if (!TryComp<StorageComponent>(storage, out var storageComp))
+        if (!HasComp<StorageComponent>(storage))
             return;
 
-        if (!_ui.TryGetUi(storage, StorageComponent.StorageUiKey.Key, out var bui) ||
-            !bui.SubscribedSessions.Contains(args.SenderSession))
+        if (!_ui.IsUiOpen(storage, StorageComponent.StorageUiKey.Key, player))
             return;
 
         if (!Exists(item))
@@ -605,11 +721,7 @@ public abstract class SharedStorageSystem : EntitySystem
 
     private void OnBoundUIOpen(EntityUid uid, StorageComponent storageComp, BoundUIOpenedEvent args)
     {
-        if (!storageComp.IsUiOpen)
-        {
-            storageComp.IsUiOpen = true;
-            UpdateAppearance((uid, storageComp, null));
-        }
+        UpdateAppearance((uid, storageComp, null));
     }
 
     private void OnEntInserted(Entity<StorageComponent> entity, ref EntInsertedIntoContainerMessage args)
@@ -687,11 +799,13 @@ public abstract class SharedStorageSystem : EntitySystem
         var capacity = storage.Grid.GetArea();
         var used = GetCumulativeItemAreas((uid, storage));
 
+        var isOpen = _ui.IsUiOpen(entity.Owner, StorageComponent.StorageUiKey.Key);
+
         _appearance.SetData(uid, StorageVisuals.StorageUsed, used, appearance);
         _appearance.SetData(uid, StorageVisuals.Capacity, capacity, appearance);
-        _appearance.SetData(uid, StorageVisuals.Open, storage.IsUiOpen, appearance);
-        _appearance.SetData(uid, SharedBagOpenVisuals.BagState, storage.IsUiOpen ? SharedBagState.Open : SharedBagState.Closed, appearance);
-        _appearance.SetData(uid, StackVisuals.Hide, !storage.IsUiOpen, appearance);
+        _appearance.SetData(uid, StorageVisuals.Open, isOpen, appearance);
+        _appearance.SetData(uid, SharedBagOpenVisuals.BagState, isOpen ? SharedBagState.Open : SharedBagState.Closed, appearance);
+        _appearance.SetData(uid, StackVisuals.Hide, !isOpen, appearance);
     }
 
     /// <summary>
@@ -1343,8 +1457,6 @@ public abstract class SharedStorageSystem : EntitySystem
     [Serializable, NetSerializable]
     protected sealed class StorageComponentState : ComponentState
     {
-        public bool IsUiOpen;
-
         public Dictionary<NetEntity, ItemStorageLocation> StoredItems = new();
 
         public Dictionary<string, List<ItemStorageLocation>> SavedLocations = new();
index 43a93e4b0f8d5c9dd8f92c2438a9b4e0e3c6e32c..ef682dd4f94cb4278a336cdad312ecb409d10269 100644 (file)
@@ -19,10 +19,6 @@ namespace Content.Shared.Storage
     {
         public static string ContainerId = "storagebase";
 
-        // TODO: This fucking sucks
-        [ViewVariables(VVAccess.ReadWrite), DataField]
-        public bool IsUiOpen;
-
         [ViewVariables]
         public Container Container = default!;
 
@@ -232,15 +228,6 @@ namespace Content.Shared.Storage
         }
     }
 
-    /// <summary>
-    /// An extra BUI message that either opens, closes, or focuses the storage window based on context.
-    /// </summary>
-    [Serializable, NetSerializable]
-    public sealed class StorageModifyWindowMessage : BoundUserInterfaceMessage
-    {
-
-    }
-
     [NetSerializable]
     [Serializable]
     public enum StorageVisuals : byte
similarity index 87%
rename from Content.Server/UserInterface/ActivatableUIComponent.cs
rename to Content.Shared/UserInterface/ActivatableUIComponent.cs
index cc0e5008e4763309946bd331efcba9ad6d570dc5..74e613493288cd0e209097239451714e6cd5b7be 100644 (file)
@@ -1,16 +1,14 @@
 using Content.Shared.Whitelist;
-using Robust.Server.GameObjects;
-using Robust.Server.Player;
-using Robust.Shared.Player;
+using Robust.Shared.GameStates;
 using Robust.Shared.Serialization.TypeSerializers.Implementations;
 
-namespace Content.Server.UserInterface
+namespace Content.Shared.UserInterface
 {
-    [RegisterComponent]
+    [RegisterComponent, NetworkedComponent]
     public sealed partial class ActivatableUIComponent : Component
     {
-        [DataField(required: true, customTypeSerializer:typeof(EnumSerializer))]
-        public Enum? Key { get; set; }
+        [DataField(required: true, customTypeSerializer: typeof(EnumSerializer))]
+        public Enum Key { get; set; } = default!;
 
         [ViewVariables(VVAccess.ReadWrite)]
         [DataField]
@@ -70,6 +68,6 @@ namespace Content.Server.UserInterface
         ///     NOTE: DO NOT DIRECTLY SET, USE ActivatableUISystem.SetCurrentSingleUser
         /// </summary>
         [ViewVariables]
-        public ICommonSession? CurrentSingleUser;
+        public EntityUid? CurrentSingleUser;
     }
 }
index 6e6b3f63c62c6dc544d4cf9987bb7ff3dc364c1b..338673a3ca6d42f36fe3f3233151db2dca836db2 100644 (file)
@@ -24,12 +24,12 @@ public sealed class UserOpenActivatableUIAttemptEvent : CancellableEntityEventAr
 public sealed class AfterActivatableUIOpenEvent : EntityEventArgs
 {
     public EntityUid User { get; }
-    public readonly ICommonSession Session;
+    public readonly EntityUid Actor;
 
-    public AfterActivatableUIOpenEvent(EntityUid who, ICommonSession session)
+    public AfterActivatableUIOpenEvent(EntityUid who, EntityUid actor)
     {
         User = who;
-        Session = session;
+        Actor = actor;
     }
 }
 
similarity index 65%
rename from Content.Server/UserInterface/ActivatableUIRequiresPowerCellComponent.cs
rename to Content.Shared/UserInterface/ActivatableUIRequiresPowerCellComponent.cs
index fdc56f89a053d7d81466bc81332ce43b635bb18f..aa9e561e076f7f0677c6e52cd091fa1a01118782 100644 (file)
@@ -1,13 +1,12 @@
-using Content.Server.PowerCell;
 using Content.Shared.PowerCell;
-using Content.Shared.UserInterface;
+using Robust.Shared.GameStates;
 
-namespace Content.Server.UserInterface;
+namespace Content.Shared.UserInterface;
 
 /// <summary>
 /// Specifies that the attached entity requires <see cref="PowerCellDrawComponent"/> power.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, NetworkedComponent]
 public sealed partial class ActivatableUIRequiresPowerCellComponent : Component
 {
 
similarity index 82%
rename from Content.Server/UserInterface/ActivatableUISystem.Power.cs
rename to Content.Shared/UserInterface/ActivatableUISystem.Power.cs
index d4dcc91d46e8d303fb3ad6329a7c65d208584b4e..c904224328181470caa1c6d494b0df9c685ea894 100644 (file)
@@ -1,13 +1,11 @@
-using Content.Server.PowerCell;
 using Content.Shared.PowerCell;
-using Content.Shared.UserInterface;
 using Robust.Shared.Containers;
 
-namespace Content.Server.UserInterface;
+namespace Content.Shared.UserInterface;
 
 public sealed partial class ActivatableUISystem
 {
-    [Dependency] private readonly PowerCellSystem _cell = default!;
+    [Dependency] private readonly SharedPowerCellSystem _cell = default!;
 
     private void InitializePower()
     {
@@ -23,10 +21,9 @@ public sealed partial class ActivatableUISystem
         _cell.SetPowerCellDrawEnabled(uid, false);
 
         if (HasComp<ActivatableUIRequiresPowerCellComponent>(uid) &&
-            TryComp<ActivatableUIComponent>(uid, out var activatable) &&
-            activatable.Key != null)
+            TryComp<ActivatableUIComponent>(uid, out var activatable))
         {
-            _uiSystem.TryCloseAll(uid, activatable.Key);
+            _uiSystem.CloseUi(uid, activatable.Key);
         }
     }
 
@@ -57,13 +54,13 @@ public sealed partial class ActivatableUISystem
     /// </summary>
     public void CheckUsage(EntityUid uid, ActivatableUIComponent? active = null, ActivatableUIRequiresPowerCellComponent? component = null, PowerCellDrawComponent? draw = null)
     {
-        if (!Resolve(uid, ref component, ref draw, ref active, false) || active.Key == null)
+        if (!Resolve(uid, ref component, ref draw, ref active, false))
             return;
 
-        if (_cell.HasCharge(uid, draw.UseRate))
+        if (_cell.HasActivatableCharge(uid))
             return;
 
-        _uiSystem.TryCloseAll(uid, active.Key);
+        _uiSystem.CloseUi(uid, active.Key);
     }
 
     private void OnBatteryOpenAttempt(EntityUid uid, ActivatableUIRequiresPowerCellComponent component, ActivatableUIOpenAttemptEvent args)
@@ -72,10 +69,11 @@ public sealed partial class ActivatableUISystem
             return;
 
         // Check if we have the appropriate drawrate / userate to even open it.
-        if (args.Cancelled || !_cell.HasCharge(uid, MathF.Max(draw.DrawRate, draw.UseRate), user: args.User))
+        if (args.Cancelled ||
+            !_cell.HasActivatableCharge(uid, draw, user: args.User) ||
+            !_cell.HasDrawCharge(uid, draw, user: args.User))
         {
             args.Cancel();
-            return;
         }
     }
 }
similarity index 81%
rename from Content.Server/UserInterface/ActivatableUISystem.cs
rename to Content.Shared/UserInterface/ActivatableUISystem.cs
index 5f2314df90b596c5d58b337d211d7bccb2914e6c..bfe8491b1578eb5c244c5b8a2bdb6fdc7745c325 100644 (file)
@@ -1,23 +1,21 @@
-using Content.Server.Administration.Managers;
 using Content.Shared.ActionBlocker;
+using Content.Shared.Administration.Managers;
 using Content.Shared.Ghost;
 using Content.Shared.Hands;
 using Content.Shared.Hands.Components;
 using Content.Shared.Interaction;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Popups;
-using Content.Shared.UserInterface;
 using Content.Shared.Verbs;
-using Robust.Server.GameObjects;
 using Robust.Shared.Player;
 
-namespace Content.Server.UserInterface;
+namespace Content.Shared.UserInterface;
 
 public sealed partial class ActivatableUISystem : EntitySystem
 {
-    [Dependency] private readonly IAdminManager _adminManager = default!;
+    [Dependency] private readonly ISharedAdminManager _adminManager = default!;
     [Dependency] private readonly ActionBlockerSystem _blockerSystem = default!;
-    [Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
+    [Dependency] private readonly SharedUserInterfaceSystem _uiSystem = default!;
     [Dependency] private readonly SharedPopupSystem _popupSystem = default!;
 
     public override void Initialize()
@@ -49,7 +47,7 @@ public sealed partial class ActivatableUISystem : EntitySystem
         if (!comp.RequireHands)
             return;
 
-        if (!TryComp(ev.Sender.AttachedEntity, out HandsComponent? hands) || hands.Hands.Count == 0)
+        if (!TryComp(ev.Actor, out HandsComponent? hands) || hands.Hands.Count == 0)
             ev.Cancel();
     }
 
@@ -128,7 +126,9 @@ public sealed partial class ActivatableUISystem : EntitySystem
 
     private void OnUIClose(EntityUid uid, ActivatableUIComponent component, BoundUIClosedEvent args)
     {
-        if (args.Session != component.CurrentSingleUser)
+        var user = args.Actor;
+
+        if (user != component.CurrentSingleUser)
             return;
 
         if (!Equals(args.UiKey, component.Key))
@@ -139,18 +139,12 @@ public sealed partial class ActivatableUISystem : EntitySystem
 
     private bool InteractUI(EntityUid user, EntityUid uiEntity, ActivatableUIComponent aui)
     {
-        if (!TryComp(user, out ActorComponent? actor))
-            return false;
-
-        if (aui.Key == null)
+        if (!_uiSystem.HasUi(uiEntity, aui.Key))
             return false;
 
-        if (!_uiSystem.TryGetUi(uiEntity, aui.Key, out var ui))
-            return false;
-
-        if (ui.SubscribedSessions.Contains(actor.PlayerSession))
+        if (_uiSystem.IsUiOpen(uiEntity, aui.Key, user))
         {
-            _uiSystem.CloseUi(ui, actor.PlayerSession);
+            _uiSystem.CloseUi(uiEntity, aui.Key, user);
             return true;
         }
 
@@ -160,10 +154,10 @@ public sealed partial class ActivatableUISystem : EntitySystem
         if (aui.RequireHands && !HasComp<HandsComponent>(user))
             return false;
 
-        if (aui.AdminOnly && !_adminManager.IsAdmin(actor.PlayerSession))
+        if (aui.AdminOnly && !_adminManager.IsAdmin(user))
             return false;
 
-        if (aui.SingleUser && (aui.CurrentSingleUser != null) && (actor.PlayerSession != aui.CurrentSingleUser))
+        if (aui.SingleUser && aui.CurrentSingleUser != null && user != aui.CurrentSingleUser)
         {
             string message = Loc.GetString("machine-already-in-use", ("machine", uiEntity));
             _popupSystem.PopupEntity(message, uiEntity, user);
@@ -171,7 +165,7 @@ public sealed partial class ActivatableUISystem : EntitySystem
             // If we get here, supposedly, the object is in use.
             // Check with BUI that it's ACTUALLY in use just in case.
             // Since this could brick the object if it goes wrong.
-            if (ui.SubscribedSessions.Count != 0)
+            if (_uiSystem.IsUiOpen(uiEntity, aui.Key))
                 return false;
         }
 
@@ -189,24 +183,25 @@ public sealed partial class ActivatableUISystem : EntitySystem
         var bae = new BeforeActivatableUIOpenEvent(user);
         RaiseLocalEvent(uiEntity, bae);
 
-        SetCurrentSingleUser(uiEntity, actor.PlayerSession, aui);
-        _uiSystem.OpenUi(ui, actor.PlayerSession);
+        SetCurrentSingleUser(uiEntity, user, aui);
+        _uiSystem.OpenUi(uiEntity, aui.Key, user);
 
         //Let the component know a user opened it so it can do whatever it needs to do
-        var aae = new AfterActivatableUIOpenEvent(user, actor.PlayerSession);
+        var aae = new AfterActivatableUIOpenEvent(user, user);
         RaiseLocalEvent(uiEntity, aae);
 
         return true;
     }
 
-    public void SetCurrentSingleUser(EntityUid uid, ICommonSession? v, ActivatableUIComponent? aui = null)
+    public void SetCurrentSingleUser(EntityUid uid, EntityUid? user, ActivatableUIComponent? aui = null)
     {
         if (!Resolve(uid, ref aui))
             return;
+
         if (!aui.SingleUser)
             return;
 
-        aui.CurrentSingleUser = v;
+        aui.CurrentSingleUser = user;
 
         RaiseLocalEvent(uid, new ActivatableUIPlayerChangedEvent());
     }
@@ -216,10 +211,10 @@ public sealed partial class ActivatableUISystem : EntitySystem
         if (!Resolve(uid, ref aui, false))
             return;
 
-        if (aui.Key == null || !_uiSystem.TryGetUi(uid, aui.Key, out var ui))
+        if (!_uiSystem.HasUi(uid, aui.Key))
             return;
 
-        _uiSystem.CloseAll(ui);
+        _uiSystem.CloseUi(uid, aui.Key);
     }
 
     private void OnHandDeselected(EntityUid uid, ActivatableUIComponent? aui, HandDeselectedEvent args)
index e13070d1ba925cbe705d6149dc25e119aa0b0388..4893fa2557f6b35e7c1f49b39ed2c764c7f466d1 100644 (file)
@@ -19,7 +19,7 @@
     key: enum.PaperUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.PaperUiKey.Key
-      type: PaperBoundUserInterface
+      enum.PaperUiKey.Key:
+        type: PaperBoundUserInterface
   - type: Paper
     content: book-text-holoparasite-info
index a69c770f4028b5a2475b9e064b77bbb8e4ae54ad..5d9fc64e128deb12a73032b4323d5e05a1c44aec 100644 (file)
@@ -23,8 +23,8 @@
         ents: []
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   # to prevent bag open/honk spam
   - type: UseDelay
     delay: 0.5
   - type: Sprite
     sprite: Clothing/Back/Backpacks/syndicate.rsi
   - type: ExplosionResistance
-    damageCoefficient: 0.1         
+    damageCoefficient: 0.1
 
 #Special
 - type: entity
index 8af00039b5d56515f553b3f75fd258f74cfbd2e4..fcdecffc8f1518e756964e461aad44e52da0aed2 100644 (file)
@@ -14,9 +14,9 @@
       default: ClothingBackpack
     - type: UserInterface
       interfaces:
-        - key: enum.StorageUiKey.Key
+        enum.StorageUiKey.Key:
           type: StorageBoundUserInterface
-        - key: enum.ChameleonUiKey.Key
+        enum.ChameleonUiKey.Key:
           type: ChameleonBoundUserInterface
 
 - type: entity
@@ -51,8 +51,8 @@
     canChangeTransferAmount: true
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: DrawableSolution
     solution: tank
   - type: RefillableSolution
index 703730daf383d87e34e9744f52031ec49145e91d..76af5067aea118891eac812f3dd63449f51fa1c5 100644 (file)
@@ -36,8 +36,8 @@
         ents: []
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
 
 - type: entity
   abstract: true
index 093f5e645b6b02e2372525542a2631223ca37dd8..83612ac4b2ea9874b9c73b2773c674aa7b60ef22 100644 (file)
@@ -16,5 +16,5 @@
       default: ClothingHeadsetGrey
     - type: UserInterface
       interfaces:
-        - key: enum.ChameleonUiKey.Key
+        enum.ChameleonUiKey.Key:
           type: ChameleonBoundUserInterface
index c04f3482870123d34b5cfdf2a3145e38bd355e5a..fa87ed398ed6fb8c662075a1f63970e8ff5bf145 100644 (file)
@@ -16,6 +16,6 @@
       default: ClothingEyesGlassesSunglasses
     - type: UserInterface
       interfaces:
-        - key: enum.ChameleonUiKey.Key
+        enum.ChameleonUiKey.Key:
           type: ChameleonBoundUserInterface
 
index 96bdd61f94e013536999b3c7c1f3f3015e11860e..02ec58bd67e39a85d605db0c609cc1663e1c03b8 100644 (file)
   - type: Actions
   - type: UserInterface
     interfaces:
-      - key: enum.MeleeSpeechUiKey.Key
+      enum.MeleeSpeechUiKey.Key:
         type: MeleeSpeechBoundUserInterface
   - type: StaticPrice
     price: 0
index e6a57319999a2a1a6033236de47e0b7c82525702..6140bcd8ede14c6e052c83ed869903c05ebfaff2 100644 (file)
@@ -19,9 +19,9 @@
     - type: FingerprintMask
     - type: UserInterface
       interfaces:
-        - key: enum.ChameleonUiKey.Key
+        enum.ChameleonUiKey.Key:
           type: ChameleonBoundUserInterface
+
 - type: entity
   parent: ClothingHandsChameleon
   id: ClothingHandsChameleonThief
index ec0921c5127b54bc12347f7cea29fa1f193bc9ee..a844fd724a36b65fb20518a34e408c98dffa85ab 100644 (file)
     - 0,0,0,0
   - type: UserInterface
     interfaces:
-      - key: enum.StorageUiKey.Key
+      enum.StorageUiKey.Key:
         type: StorageBoundUserInterface
   - type: ContainerContainer
     containers:
     - 0,0,0,0
   - type: UserInterface
     interfaces:
-      - key: enum.StorageUiKey.Key
-        type: StorageBoundUserInterface
+        enum.StorageUiKey.Key:
+          type: StorageBoundUserInterface
   - type: ContainerContainer
     containers:
       storagebase: !type:Container
index 1dd36bff94935f53cd5f246823f4a68a49578c83..636f922d8576f95703f1ff0804d0e12f77cfcfa1 100644 (file)
@@ -16,5 +16,5 @@
       default: ClothingHeadHatBeret
     - type: UserInterface
       interfaces:
-        - key: enum.ChameleonUiKey.Key
+        enum.ChameleonUiKey.Key:
           type: ChameleonBoundUserInterface
index 0a0fc68469a78a00949531f4dc89e1c085b7f0e0..7f758a27d280ee814099655a871f1158613eb326 100644 (file)
@@ -18,7 +18,7 @@
     - type: IdentityBlocker # need that for default ClothingMaskGas
     - type: UserInterface
       interfaces:
-        - key: enum.ChameleonUiKey.Key
+        enum.ChameleonUiKey.Key:
           type: ChameleonBoundUserInterface
     - type: HideLayerClothing
       slots:
index 1f50dc1ef1cd4ec34f510ccd0d096bd6f294b4ab..56fddceaad693664f256cea1d304c85f3cbecfb9 100644 (file)
@@ -16,5 +16,5 @@
       default: ClothingNeckScarfStripedRed
     - type: UserInterface
       interfaces:
-        - key: enum.ChameleonUiKey.Key
+        enum.ChameleonUiKey.Key:
           type: ChameleonBoundUserInterface
index 987d3c2f242c37162dcfd739ce8448e3bba11e44..e5067e84c516008d964d7faa5762a52047e34187 100644 (file)
@@ -38,8 +38,8 @@
         ents: []
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: StaticPrice
     price: 70
 
index 9be8c22a0a2295b9464a83220994e59b6ddbf654..c3d9bb1224244bbe12acabb77dffd833a6878b7d 100644 (file)
@@ -16,5 +16,5 @@
       default: ClothingOuterVest
     - type: UserInterface
       interfaces:
-        - key: enum.ChameleonUiKey.Key
+        enum.ChameleonUiKey.Key:
           type: ChameleonBoundUserInterface
index 880239b51e40ff2b4c3c798b260235ce7a0ee75a..485d530ea5a7fd9f672da5f1a559cb360a66abc7 100644 (file)
     key: enum.SharedGasTankUiKey.Key
   - type: UserInterface
     interfaces:
-      - key: enum.SharedGasTankUiKey.Key
+      enum.SharedGasTankUiKey.Key:
         type: GasTankBoundUserInterface
   - type: Explosive
     explosionType: Default
index 987eda582e416b4f60fbb95cd8d0b1bc0f6a93ec..4ae752345a78ccc5e01adc60b29572a713d31062 100644 (file)
       default: ClothingShoesColorBlack
     - type: UserInterface
       interfaces:
-        - key: enum.ChameleonUiKey.Key
+        enum.ChameleonUiKey.Key:
           type: ChameleonBoundUserInterface
 
 - type: entity
index ad02f4aa6763c9231e9b3362b1127ff5be970fb0..a2c903bac3b77afa9285e8572dab434ea01a9f97 100644 (file)
@@ -38,5 +38,5 @@
       default: ClothingUniformJumpsuitColorBlack
     - type: UserInterface
       interfaces:
-        - key: enum.ChameleonUiKey.Key
-          type: ChameleonBoundUserInterface
\ No newline at end of file
+        enum.ChameleonUiKey.Key:
+          type: ChameleonBoundUserInterface
index 9907c5f71feb9080e5f5af41e13c9a225a84def3..27a19ab8994032216f9b1c253c924baac213bad3 100644 (file)
     locPrefix: silicon
   - type: UserInterface
     interfaces:
-    - key: enum.SiliconLawsUiKey.Key
-      type: SiliconLawBoundUserInterface
-    - key: enum.BorgUiKey.Key
-      type: BorgBoundUserInterface
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.SiliconLawsUiKey.Key:
+        type: SiliconLawBoundUserInterface
+      enum.BorgUiKey.Key:
+        type: BorgBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: ActivatableUI
     key: enum.BorgUiKey.Key
   - type: SiliconLawBound
index 819c7beacf59846ef16394cf9466c4ee8766c73a..c0a99ec8a0c6dcfe0c580658cdfb62b4de91c30d 100644 (file)
     - id: FoodMeat
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: Sprite
     drawdepth: Mobs
     layers:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
     bloodMaxVolume: 60
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
index 8a10337c9469dff385e863373a7de3a33cbd4e8e..6aea0e89b014d6e5d6c47e3c3f7af979c08ae315 100644 (file)
@@ -76,8 +76,8 @@
         - id: BikeHorn
     - type: UserInterface
       interfaces:
-      - key: enum.StrippingUiKey.Key
-        type: StrippableBoundUserInterface
+        enum.StrippingUiKey.Key:
+          type: StrippableBoundUserInterface
     - type: MobThresholds
       thresholds:
         0: Alive
index 747268466a6315ee3dd53c42c43ceebfaea9cb0b..f6cf36196f277a5a5444c9d73d4ac59ed43d3de5 100644 (file)
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: DamageStateVisuals
     states:
       Alive:
index 68ebf52dc06548eb823a0bbe6bb31434b073c52b..83d3dbd0696c107bb14add29a1392cf9e4db386a 100644 (file)
@@ -75,8 +75,8 @@
     softness: 1
   - type: UserInterface
     interfaces:
-    - key: enum.StoreUiKey.Key
-      type: StoreBoundUserInterface
+      enum.StoreUiKey.Key:
+        type: StoreBoundUserInterface
   - type: Visibility
     layer: 2 #ghost vis layer
   - type: Store
index 9a4d4ec3aae6cd0d69a58971fb1c250d7cb84a85..c808ed2d210e3851047339a36efec91520dc57fe 100644 (file)
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   - type: Sprite
     layers:
     - map: ["enum.DamageStateVisualLayers.Base"]
index eeee64022599a00fff590231d0fc79355f703298..8cfd199dca77af421910d96b4dbb77d21005baeb 100644 (file)
   - type: Strippable
   - type: UserInterface
     interfaces:
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
 
 - type: entity
   id: MobKangarooSpaceSalvage
index af18791fa7f61511f93ca75c4c38509595389af4..38092e3aa7e4b5edc8295ec807c52f7e28bb55c6 100644 (file)
     - CentralCommand
   - type: UserInterface
     interfaces:
-      - key: enum.SolarControlConsoleUiKey.Key
+      enum.SolarControlConsoleUiKey.Key:
         type: SolarControlConsoleBoundUserInterface
-      - key: enum.CommunicationsConsoleUiKey.Key
+      enum.CommunicationsConsoleUiKey.Key:
         type: CommunicationsConsoleBoundUserInterface
-      - key: enum.RadarConsoleUiKey.Key
+      enum.RadarConsoleUiKey.Key:
         type: RadarConsoleBoundUserInterface
-      - key: enum.CargoConsoleUiKey.Orders
+      enum.CargoConsoleUiKey.Orders:
         type: CargoOrderConsoleBoundUserInterface
-      - key: enum.CrewMonitoringUIKey.Key
+      enum.CrewMonitoringUIKey.Key:
         type: CrewMonitoringBoundUserInterface
-      - key: enum.GeneralStationRecordConsoleKey.Key
-        # who the fuck named this bruh
+      enum.GeneralStationRecordConsoleKey.Key:
+      # who the fuck named this bruh
         type: GeneralStationRecordConsoleBoundUserInterface
   - type: IntrinsicUI
     uis:
-      - key: enum.SolarControlConsoleUiKey.Key
+      enum.SolarControlConsoleUiKey.Key:
         toggleAction: ActionAGhostShowSolar
-      - key: enum.CommunicationsConsoleUiKey.Key
+      enum.CommunicationsConsoleUiKey.Key:
         toggleAction: ActionAGhostShowCommunications
-      - key: enum.RadarConsoleUiKey.Key
+      enum.RadarConsoleUiKey.Key:
         toggleAction: ActionAGhostShowRadar
-      - key: enum.CargoConsoleUiKey.Orders
+      enum.CargoConsoleUiKey.Orders:
         toggleAction: ActionAGhostShowCargo
-      - key: enum.CrewMonitoringUIKey.Key
+      enum.CrewMonitoringUIKey.Key:
         toggleAction: ActionAGhostShowCrewMonitoring
-      - key: enum.GeneralStationRecordConsoleKey.Key
+      enum.GeneralStationRecordConsoleKey.Key:
         toggleAction: ActionAGhostShowStationRecords
   - type: SolarControlConsole # look ma i AM the computer!
   - type: CommunicationsConsole
index ae4a370f9d17cda15813ffd0927586515b61a495..26c0ae30ec962cc876627e7e96f4e57fa9186fb2 100644 (file)
@@ -95,8 +95,8 @@
     - type: MeleeSpeech
     - type: UserInterface
       interfaces:
-      - key: enum.MeleeSpeechUiKey.Key
-        type: MeleeSpeechBoundUserInterface
+        enum.MeleeSpeechUiKey.Key:
+          type: MeleeSpeechBoundUserInterface
     - type: Actions
     - type: Guardian
     - type: InteractionPopup
index cf04d82b506ae04a17b5e8a335bb2ddf91aa209d..01b938ffa863d25583fe3150e57332f0fdc945d9 100644 (file)
   - type: Strippable
   - type: UserInterface
     interfaces:
-      - key: enum.VoiceMaskUIKey.Key
+      enum.VoiceMaskUIKey.Key:
         type: VoiceMaskBoundUserInterface
-      - key: enum.HumanoidMarkingModifierKey.Key
+      enum.HumanoidMarkingModifierKey.Key:
         type: HumanoidMarkingModifierBoundUserInterface
-      - key: enum.StrippingUiKey.Key
+      enum.StrippingUiKey.Key:
         type: StrippableBoundUserInterface
   - type: Puller
   - type: Speech
     requiredLegs: 2
   - type: UserInterface
     interfaces:
-      - key: enum.HumanoidMarkingModifierKey.Key # sure, this can go here too
+      enum.HumanoidMarkingModifierKey.Key: # sure, this can go here too
         type: HumanoidMarkingModifierBoundUserInterface
index de2f88e59de46501257908951c5fdf467f692ce4..081973c3d27c3fba73ff671b1812e45d88dea10e 100644 (file)
         ents: []
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
-    - key: enum.VoiceMaskUIKey.Key
-      type: VoiceMaskBoundUserInterface
-    - key: enum.HumanoidMarkingModifierKey.Key
-      type: HumanoidMarkingModifierBoundUserInterface
-    - key: enum.StrippingUiKey.Key
-      type: StrippableBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
+      enum.VoiceMaskUIKey.Key:
+        type: VoiceMaskBoundUserInterface
+      enum.HumanoidMarkingModifierKey.Key:
+        type: HumanoidMarkingModifierBoundUserInterface
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
   # to prevent bag open/honk spam
   - type: UseDelay
     delay: 0.5
index e8ae78763620fb49919d4b6f54cfa56a1768edbf..a729eed9c8f13c40cf90ac9f2f41847b2f63d945 100644 (file)
@@ -33,8 +33,8 @@
     solution: drink
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
 
 - type: entity
   parent: DrinkBase
index ca67e51792e8dd7227b4d8b5beba67640a2f7232..5d092673edfa8410da076af45ff7163a9521e774 100644 (file)
@@ -21,8 +21,8 @@
     maxTransferAmount: 15
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: Sprite
     state: icon
     layers:
index 763c4210ae2d5de3aad860adbad26aada054daa0..156cd5a767508db256b7a636ae0f8bf6e10ae3d7 100644 (file)
@@ -25,8 +25,8 @@
     maxTransferAmount: 10
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: Drink
   - type: Sprite
     state: icon
index 829d68279d4c6147f3c79b67e4d5a6e9375c1aab..ad2e760141403ef8c1edb88d77f2f21e6a094470 100644 (file)
@@ -29,8 +29,8 @@
     state: icon
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: PhysicalComposition
     materialComposition:
       Steel: 50
index 67154963d1fdabfc87b5ff85988f8350b48f1fc2..a6b14d722d03f7c22f7e7cd41c093bc99757f2e3 100644 (file)
@@ -39,8 +39,8 @@
     solution: drink
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: DamageOnLand
     damage:
       types:
     solution: drink
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: Damageable
     damageContainer: Inorganic
   - type: Destructible
index 70303cfdff4315b199c13dfd34d5477ccc637d31..40cb141af783eb7569ace76399b33ca48e83cf7f 100644 (file)
@@ -37,8 +37,8 @@
     canChangeTransferAmount: true
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: Destructible
     thresholds:
     - trigger:
index 670b556e359889ae76c596c9fcb0a9295e797dd1..ada46c5d02e329a844c8d8fc55af473ecff672b3 100644 (file)
@@ -21,5 +21,5 @@
         - DoorElectronicsConfigurator
     - type: UserInterface
       interfaces:
-      - key: enum.DoorElectronicsConfigurationUiKey.Key
-        type: DoorElectronicsBoundUserInterface
+        enum.DoorElectronicsConfigurationUiKey.Key:
+          type: DoorElectronicsBoundUserInterface
index 08e96d1de2be26bf8e4294061155e932c808521c..c0ce4cba18130a9ce38204fae4a5b1ba4676b640 100644 (file)
@@ -18,7 +18,7 @@
       key: enum.WarDeclaratorUiKey.Key
     - type: UserInterface
       interfaces:
-        - key: enum.WarDeclaratorUiKey.Key
+        enum.WarDeclaratorUiKey.Key:
           type: WarDeclaratorBoundUserInterface
     - type: WarDeclarator
       message: war-declarator-default-message
index 7436ae7c988e9f3dfe563cf3d3f25b7f00c1223d..e7c0b14beb0cd408556babc9916fba163c47adf4 100644 (file)
@@ -20,8 +20,8 @@
     closeOnHandDeselect: false
   - type: UserInterface
     interfaces:
-    - key: enum.ForensicScannerUiKey.Key
-      type: ForensicScannerBoundUserInterface
+      enum.ForensicScannerUiKey.Key:
+        type: ForensicScannerBoundUserInterface
   - type: ForensicScanner
   - type: GuideHelp
     guides:
index 73976b48e03e347d5597bb3ad31040eaf8a03300..e1efc0399304769ef0647a6cef8bd8fa87d0018b 100644 (file)
     closeOnHandDeselect: false
   - type: UserInterface
     interfaces:
-    - key: enum.PdaUiKey.Key
-      type: PdaBoundUserInterface
-    - key: enum.StoreUiKey.Key
-      type: StoreBoundUserInterface
-    - key: enum.RingerUiKey.Key
-      type: RingerBoundUserInterface
-    - key: enum.InstrumentUiKey.Key
-      type: InstrumentBoundUserInterface
-    - key: enum.HealthAnalyzerUiKey.Key
-      type: HealthAnalyzerBoundUserInterface
+      enum.PdaUiKey.Key:
+        type: PdaBoundUserInterface
+      enum.StoreUiKey.Key:
+        type: StoreBoundUserInterface
+      enum.RingerUiKey.Key:
+        type: RingerBoundUserInterface
+      enum.InstrumentUiKey.Key:
+        type: InstrumentBoundUserInterface
+      enum.HealthAnalyzerUiKey.Key:
+        type: HealthAnalyzerBoundUserInterface
   - type: Tag
     tags:
     - DoorBumpOpener
index fa9071d3e9f58d653ff329ba00cadd14625a3bbd..b4e336b37dde95474bd7ec0e46593ad4121c8c71 100644 (file)
@@ -30,8 +30,8 @@
     singleUser: true
   - type: UserInterface
     interfaces:
-    - key: enum.NavMapBeaconUiKey.Key
-      type: NavMapBeaconBoundUserInterface
+      enum.NavMapBeaconUiKey.Key:
+        type: NavMapBeaconBoundUserInterface
   - type: Item
     size: Small
   - type: SubFloorHide
index c37d8935f3554e6cdbb2ec5a7f0118d13d58d246..0d2f890a1d3e77c8e23d264bb10cd8d30ce76851 100644 (file)
@@ -28,7 +28,7 @@
               acts: [ "Destruction" ]
     - type: UserInterface
       interfaces:
-        - key: enum.StationMapUiKey.Key
+        enum.StationMapUiKey.Key:
           type: StationMapBoundUserInterface
 
 - type: entity
index 07d918b5765460c9533fa2737cee7740bce35f51..684260b737f71c2caa4d99de5a8604924db31ea1 100644 (file)
@@ -13,8 +13,8 @@
     key: enum.InstrumentUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.InstrumentUiKey.Key
-      type: InstrumentBoundUserInterface
+      enum.InstrumentUiKey.Key:
+        type: InstrumentBoundUserInterface
   - type: Item
     size: Normal
   - type: StaticPrice
@@ -51,8 +51,8 @@
         acts: ["Destruction"]
   - type: UserInterface
     interfaces:
-    - key: enum.InstrumentUiKey.Key
-      type: InstrumentBoundUserInterface
+      enum.InstrumentUiKey.Key:
+        type: InstrumentBoundUserInterface
   - type: Fixtures
     fixtures:
       fix1:
index d8f11cdea29d33d530a007baafc44b1b02fe1d8f..63175dc89aaee7dbd9b804f2191c717902493344 100644 (file)
@@ -36,8 +36,8 @@
         ents: []
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   # to prevent bag open/honk spam
   - type: UseDelay
     delay: 0.5
index cb755b161a61dc5d8442d7aff3b0f66191b193d0..4aab2efdb97bb6a47fc577dd5c8cd4d473ac1dbc 100644 (file)
@@ -18,8 +18,8 @@
   - type: SpaceGarbage
   - type: UserInterface
     interfaces:
-    - key: enum.CrayonUiKey.Key
-      type: CrayonBoundUserInterface
+      enum.CrayonUiKey.Key:
+        type: CrayonBoundUserInterface
   - type: Crayon
     capacity: 15
   - type: Food
index 537562f4618dcc9bef6a494d09aab1d5fcfdc8f8..df8f4872408d9aafce62ef09006ae2e646aca366 100644 (file)
     program: 2
   - type: UserInterface
     interfaces:
-    - key: enum.InstrumentUiKey.Key
-      type: InstrumentBoundUserInterface
-    - key: enum.StationMapUiKey.Key
-      type: UntrackedStationMapBoundUserInterface
+      enum.InstrumentUiKey.Key:
+        type: InstrumentBoundUserInterface
+      enum.StationMapUiKey.Key:
+        type: UntrackedStationMapBoundUserInterface
   - type: Sprite
     sprite: Objects/Fun/pai.rsi
     layers:
index 78f9edc9c5eaba63a2ec899e30012877a618a18c..e44e981a6cf99d96ad6780a1ed7562057dcc0c8e 100644 (file)
@@ -25,8 +25,8 @@
     closeOnHandDeselect: false
   - type: UserInterface
     interfaces:
-    - key: enum.PaperUiKey.Key
-      type: PaperBoundUserInterface
+      enum.PaperUiKey.Key:
+        type: PaperBoundUserInterface
   - type: Tag
     tags:
       - Book
@@ -49,7 +49,7 @@
       color: "#0a2a6b"
     - state: decor_wingette
       color: "#082561"
-    - state: icon_text 
+    - state: icon_text
       color: gold
     - state: icon_planet
       color: "#42b6f5"
   description: Each book is unique! What is hidden in this one?
   components:
   - type: RandomMetadata
-    nameSegments: 
+    nameSegments:
     - book_hint_appearance
     - book_type
   - type: RandomSprite
           icon_skull: ""
           icon_text: ""
           icon_text2: ""
-          icon_text3: "" 
+          icon_text3: ""
         overlay:
           overlay_blood: ""
           overlay_dirt: Sixteen
     - book_story_element_trait
     - "."
     storySeparator: ""
-    
+
 - type: entity
   parent: BookBase
   id: BookAtmosDistro
     - state: icon_corner
       color: gold
   - type: Paper
-    content: book-text-atmos-vents
\ No newline at end of file
+    content: book-text-atmos-vents
index b44b71930f76a5bcffeef76df20deb4c0b3c73ac..3de1afe8b8a95fbe65352e26e1f51ba67aa7046f 100644 (file)
     default: PassengerIDCard
   - type: UserInterface
     interfaces:
-      - key: enum.AgentIDCardUiKey.Key
+      enum.AgentIDCardUiKey.Key:
         type: AgentIDCardBoundUserInterface
-      - key: enum.ChameleonUiKey.Key
+      enum.ChameleonUiKey.Key:
         type: ChameleonBoundUserInterface
 
 - type: entity
index 0c52b2381cd5d20df8503265863e1b96d088a951..08e5e3caafd90a89fbdecf5f4de2fa57f6fdebd0 100644 (file)
@@ -22,8 +22,8 @@
     requireHands: false
   - type: UserInterface
     interfaces:
-    - key: enum.PaperUiKey.Key
-      type: PaperBoundUserInterface
+      enum.PaperUiKey.Key:
+        type: PaperBoundUserInterface
   - type: Item
     size: Tiny
   - type: Tag
     key: enum.PaperUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.PaperUiKey.Key
-      type: PaperBoundUserInterface
+      enum.PaperUiKey.Key:
+        type: PaperBoundUserInterface
 
 - type: entity
   parent: Paper
     key: enum.CargoConsoleUiKey.Orders
   - type: UserInterface
     interfaces:
-    - key: enum.CargoConsoleUiKey.Orders
-      type: CargoOrderConsoleBoundUserInterface
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.CargoConsoleUiKey.Orders:
+        type: CargoOrderConsoleBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: MeleeWeapon
     wideAnimationRotation: 180
     damage:
index 2336945f171e44607a43ce06f223a9fbce2373c2..a0f5e254d5f6e9f682bb3a74ce67ca2b8e8075e1 100644 (file)
           ents: [ ]
     - type: UserInterface
       interfaces:
-        - key: enum.StorageUiKey.Key
+        enum.StorageUiKey.Key:
           type: StorageBoundUserInterface
 
 - type: entity
       Telecrystal: 0
   - type: UserInterface
     interfaces:
-    - key: enum.StoreUiKey.Key
-      type: StoreBoundUserInterface
+      enum.StoreUiKey.Key:
+        type: StoreBoundUserInterface
 
 - type: entity
   parent: BaseSubdermalImplant
index b4f95d81e56a1140770d649c02df0b499bc3e539..f6b2b0a70c6ec59134bdc2f049b9d7ade4fe54e9 100644 (file)
@@ -40,8 +40,8 @@
     - 0,0,0,1
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: Tag
     tags:
     - Book
index 706407b8a6aded9a0657cb06cdfc4b19411842a1..55a58ef18a1509dd910f78b87cc8f686006673b1 100644 (file)
@@ -9,11 +9,11 @@
       - 0,0,0,1
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: Sprite
     sprite: Objects/Specific/Chapel/chaplainurn.rsi
     state: icon
   - type: Item
     size: Normal
-    sprite: Objects/Specific/Chapel/chaplainurn.rsi
\ No newline at end of file
+    sprite: Objects/Specific/Chapel/chaplainurn.rsi
index 0894d6a754758e5df40ebe7c9bd76c82d433813d..ca74dca8a7b2769a387804363e8ce5fa0fd4b3a6 100644 (file)
@@ -44,8 +44,8 @@
     - type: Appearance
     - type: UserInterface
       interfaces:
-      - key: enum.StorageUiKey.Key
-        type: StorageBoundUserInterface
+        enum.StorageUiKey.Key:
+          type: StorageBoundUserInterface
     - type: Storage
       maxItemSize: Normal
       grid:
index 6e5362d9bbbafeb0026b491f8c32330180c836d7..dab6f9f20fe8cdeed478720393941c31946828ac 100644 (file)
@@ -39,8 +39,8 @@
     doAfterDelay: 10
   - type: UserInterface
     interfaces:
-    - key: enum.MechUiKey.Key
-      type: MechBoundUserInterface
+      enum.MechUiKey.Key:
+        type: MechBoundUserInterface
   - type: MeleeWeapon
     hidden: true
     attackRate: 0.75
index 6dfe039cc0ce9748259dc723b686090e7223683e..f30e1cf633a1ff450ba4caddc76ab0bfde779b71 100644 (file)
@@ -20,7 +20,7 @@
     closeOnHandDeselect: false
   - type: UserInterface
     interfaces:
-      - key: enum.CrewMonitoringUIKey.Key
+      enum.CrewMonitoringUIKey.Key:
         type: CrewMonitoringBoundUserInterface
   - type: CrewMonitoringConsole
   - type: DeviceNetwork
index 64bd04569b5478288f86b1df0e8a69bc048a0ad2..4f8b6f29361fa52f1da274f5b022af719199727a 100644 (file)
@@ -20,7 +20,7 @@
     closeOnHandDeselect: false
   - type: UserInterface
     interfaces:
-      - key: enum.HealthAnalyzerUiKey.Key
+      enum.HealthAnalyzerUiKey.Key:
         type: HealthAnalyzerBoundUserInterface
   - type: HealthAnalyzer
     scanningEndSound:
index b02c7109d318b3239cdcdb636823c2bcdbe9e2aa..4250d9ccdd6511a3143c6f68252fbb259dc017c6 100644 (file)
@@ -13,7 +13,7 @@
     inHandsOnly: true
   - type: UserInterface
     interfaces:
-      - key: enum.AnomalyScannerUiKey.Key
+      enum.AnomalyScannerUiKey.Key:
         type: AnomalyScannerBoundUserInterface
   - type: AnomalyScanner
   - type: GuideHelp
index e896832e5f2b0ce8ea4742879fd12025aaf7b355..d7b0a566e1bdbee7ad48ce3a0c1d601b7215f828 100644 (file)
@@ -13,8 +13,8 @@
     closeOnHandDeselect: true
   - type: UserInterface
     interfaces:
-    - key: enum.MagicMirrorUiKey.Key
-      type: MagicMirrorBoundUserInterface
+      enum.MagicMirrorUiKey.Key:
+        type: MagicMirrorBoundUserInterface
   - type: MeleeWeapon
     wideAnimationRotation: -135
     attackRate: 1
index e5f7a5ec3e407cdea04a330ca2ffd5908c0f7912..2241cdd4aa09b14900e3d1b234c83ba024ca0e40 100644 (file)
         ano01_on: Rainbow
   - type: UserInterface #needs to be here for certain effects
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
-    - key: enum.InstrumentUiKey.Key
-      type: InstrumentBoundUserInterface
-    - key: enum.IntercomUiKey.Key
-      type: IntercomBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
+      enum.InstrumentUiKey.Key:
+        type: InstrumentBoundUserInterface
+      enum.IntercomUiKey.Key:
+        type: IntercomBoundUserInterface
   - type: Appearance
   - type: Item
     size: Normal
index 57b3dab921fa11c041f256326194140df8b1cc16..4c3dac181608762d9b64fdfc886ffc0f109a8ea3 100644 (file)
       noRot: true
     - type: UserInterface #needs to be here for certain effects
       interfaces:
-      - key: enum.StorageUiKey.Key
-        type: StorageBoundUserInterface
-      - key: enum.TransferAmountUiKey.Key
-        type: TransferAmountBoundUserInterface
-      - key: enum.InstrumentUiKey.Key
-        type: InstrumentBoundUserInterface
-      - key: enum.IntercomUiKey.Key
-        type: IntercomBoundUserInterface
+        enum.StorageUiKey.Key:
+          type: StorageBoundUserInterface
+        enum.TransferAmountUiKey.Key:
+          type: TransferAmountBoundUserInterface
+        enum.InstrumentUiKey.Key:
+          type: InstrumentBoundUserInterface
+        enum.IntercomUiKey.Key:
+          type: IntercomBoundUserInterface
     - type: Reactive
       groups:
         Acidic: [Touch]
index 0dc714aba0cc427a51570add97438cd43cc5f2d6..acf5f6f24044fc45317c788485b18df8ded30919 100644 (file)
@@ -17,8 +17,8 @@
     key: enum.GasAnalyzerUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.GasAnalyzerUiKey.Key
-      type: GasAnalyzerBoundUserInterface
+      enum.GasAnalyzerUiKey.Key:
+        type: GasAnalyzerBoundUserInterface
   - type: Appearance
   - type: GenericVisualizer
     visuals:
index 8034844a82bfb37c95f881856c40705bc06a7c2a..4bd71f898db17fdf461d85d8dc7e02f46ecd5c3e 100644 (file)
@@ -36,7 +36,7 @@
       solution: beaker
     - type: UserInterface
       interfaces:
-        - key: enum.TransferAmountUiKey.Key
+        enum.TransferAmountUiKey.Key:
           type: TransferAmountBoundUserInterface
     - type: Drink
       solution: beaker
index 6c81fa946650024e0cd419f435f0ed0459e0b27c..3005f6b947a3189829a5de6eef2416c5002cfaa0 100644 (file)
@@ -44,8 +44,8 @@
     canChangeTransferAmount: true
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: Item
     size: Tiny
     sprite: Objects/Specific/Chemistry/beaker.rsi
index 65f5fbb5d0624cb5fe19f1d1f668bc37b353721d..ed36861bb26269be4a777b31a072ba930f440957 100644 (file)
@@ -50,8 +50,8 @@
     canChangeTransferAmount: true
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: Item
     size: Tiny
     sprite: Objects/Specific/Chemistry/vial.rsi
index fdf58dc48419ad0abed137e00ae5689230ffb07d..4989320e6f1417b3854fcca66fcab8e29b674aa0 100644 (file)
@@ -45,8 +45,8 @@
     solution: beaker
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: Drink
     solution: beaker
   - type: Appearance
     canChangeTransferAmount: true
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: Drink
     solution: beaker
   - type: Appearance
     solution: dropper
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: Spillable
     solution: injector
   - type: Item
index aa17685c2459ec00606adf4f00e0a5f0003e57a2..459beeef1880bd9b3e292da878c3fef38e20f865 100644 (file)
@@ -63,8 +63,8 @@
     heldPrefix: old-radio
   - type: UserInterface
     interfaces:
-    - key: enum.StoreUiKey.Key
-      type: StoreBoundUserInterface
+      enum.StoreUiKey.Key:
+        type: StoreBoundUserInterface
   - type: ActivatableUI
     key: enum.StoreUiKey.Key
   - type: Store
index 9a367841c4c1291e79debc4f6cd0e201e9670a78..b6c7c498554c0420e2da7e7691b22ff92ed01ff2 100644 (file)
@@ -62,7 +62,7 @@
       doAfter: 0.5
     - type: UserInterface
       interfaces:
-        - key: enum.AccessOverriderUiKey.Key
+        enum.AccessOverriderUiKey.Key:
           type: AccessOverriderBoundUserInterface
     - type: ActivatableUI
       key: enum.AccessOverriderUiKey.Key
index 77803a13ec67a394ee128c57e87dfbc3293051d9..77c5e548978afcc1b5d75b237c6c6091b795e773 100644 (file)
@@ -35,8 +35,8 @@
     canChangeTransferAmount: true
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: MeleeWeapon
     soundNoDamage:
       path: "/Audio/Effects/Fluids/splat.ogg"
index 295412debc81ada7af95f6272fee07d3c1ed9a61..87959ebef3dbf4f7931a378978cc008ab388504f 100644 (file)
   - type: GasAnalyzer
   - type: UserInterface
     interfaces:
-    - key: enum.GasAnalyzerUiKey.Key
-      type: GasAnalyzerBoundUserInterface
+      enum.GasAnalyzerUiKey.Key:
+        type: GasAnalyzerBoundUserInterface
   - type: Appearance
 
 - type: entity
index 2f281e141a10caff5f9f99e4d51743c2180a2feb..65942e330ea47de331ab3310d43acb128017bcaf 100644 (file)
@@ -19,8 +19,8 @@
     key: enum.SharedGasTankUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.SharedGasTankUiKey.Key
-      type: GasTankBoundUserInterface
+      enum.SharedGasTankUiKey.Key:
+        type: GasTankBoundUserInterface
   - type: GasTank
     outputPressure: 21.3
     air:
index 1d9bb47e0e6a3a187a80de5d23e26e86e15a90ef..4b46a9335389ec37211793782b9800118e110c58 100644 (file)
@@ -17,7 +17,7 @@
       inHandsOnly: true
     - type: UserInterface
       interfaces:
-        - key: enum.HandLabelerUiKey.Key
+        enum.HandLabelerUiKey.Key:
           type: HandLabelerBoundUserInterface
     - type: HandLabeler
       whitelist:
index 5647737219ecfb78f6b2dada1351a4abeabafd89..5938193181e4f5f78bc1930763a60c19bcaa4072 100644 (file)
@@ -34,7 +34,7 @@
     singleUser: true
   - type: UserInterface
     interfaces:
-      - key: enum.RadarConsoleUiKey.Key
+      enum.RadarConsoleUiKey.Key:
         type: RadarConsoleBoundUserInterface
   - type: StaticPrice
     price: 150
@@ -69,4 +69,4 @@
         name: power-cell-slot-component-slot-name-default
         startingItem: PowerCellMicroreactor
         disableEject: true
-        swap: false
\ No newline at end of file
+        swap: false
index f40f47115bb7f7138d9796513933fb4b705ec64a..04f8b9f9f6d18bfe62002140581f5a79b8be85f3 100644 (file)
@@ -40,7 +40,7 @@
       size: Huge
     - type: UserInterface
       interfaces:
-        - key: enum.SharedGasTankUiKey.Key
+        enum.SharedGasTankUiKey.Key:
           type: GasTankBoundUserInterface
     - type: Clothing
       sprite: Objects/Tanks/Jetpacks/blue.rsi
index 903b8d3f9062e6438e2b8d0a3f3c5be2f0330448..ad31a6ec02d197bb1fc48fab5d1bf6a15b61fa8e 100644 (file)
@@ -13,8 +13,8 @@
     key: enum.SprayPainterUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.SprayPainterUiKey.Key
-      type: SprayPainterBoundUserInterface
+      enum.SprayPainterUiKey.Key:
+        type: SprayPainterBoundUserInterface
   - type: SprayPainter
     colorPalette:
       red: '#FF1212FF'
index 695725140ff9a38e88dd5a68d6592e7af32ee0c2..0a0c70232459c84cbdcaac987b69907c7ce9afce 100644 (file)
     key: enum.ThiefBackpackUIKey.Key
   - type: UserInterface
     interfaces:
-      - key: enum.ThiefBackpackUIKey.Key
+      enum.ThiefBackpackUIKey.Key:
         type: ThiefBackpackBoundUserInterface
index b3103816eb9c3413e121a1818c4866a4062caf51..452a905329e25df6c473d8491b3acbbad2c10831 100644 (file)
     inHandsOnly: true
   - type: UserInterface
     interfaces:
-      - key: enum.NetworkConfiguratorUiKey.List
+      enum.NetworkConfiguratorUiKey.List:
         type: NetworkConfiguratorBoundUserInterface
-      - key: enum.NetworkConfiguratorUiKey.Configure
+      enum.NetworkConfiguratorUiKey.Configure:
         type: NetworkConfiguratorBoundUserInterface
-      - key: enum.NetworkConfiguratorUiKey.Link
+      enum.NetworkConfiguratorUiKey.Link:
         type: NetworkConfiguratorBoundUserInterface
   - type: Tag
     tags:
         - DoorElectronicsConfigurator
     - type: UserInterface
       interfaces:
-        - key: enum.NetworkConfiguratorUiKey.List
+        enum.NetworkConfiguratorUiKey.List:
           type: NetworkConfiguratorBoundUserInterface
-        - key: enum.NetworkConfiguratorUiKey.Configure
+        enum.NetworkConfiguratorUiKey.Configure:
           type: NetworkConfiguratorBoundUserInterface
-        - key: enum.NetworkConfiguratorUiKey.Link
+        enum.NetworkConfiguratorUiKey.Link:
           type: NetworkConfiguratorBoundUserInterface
     - type: StaticPrice
       price: 56
     price: 100
   - type: UserInterface
     interfaces:
-    - key: enum.RcdUiKey.Key
-      type: RCDMenuBoundUserInterface
+      enum.RcdUiKey.Key:
+        type: RCDMenuBoundUserInterface
   - type: ActivatableUI
     key: enum.RcdUiKey.Key
 
index e925bdab8761a7cdd7d821452cf26b59b52fecaf..c96a1522d2efb3fcf0f9f5f0bcf223636848e6ff 100644 (file)
@@ -34,8 +34,8 @@
     canChangeTransferAmount: true
   - type: UserInterface
     interfaces:
-    - key: enum.TransferAmountUiKey.Key
-      type: TransferAmountBoundUserInterface
+      enum.TransferAmountUiKey.Key:
+        type: TransferAmountBoundUserInterface
   - type: DrawableSolution
     solution: chamber
   - type: RefillableSolution
index 55c4bbd6b79969fd12311c5e9774ed9144d73ff3..39bb8c3a2aa5128dba7e4caab2d1dcab1f6ad013 100644 (file)
@@ -52,8 +52,8 @@
   - type: Storage
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: ContainerContainer
     containers:
       storagebase: !type:Container
index d661009b6dc5a8cef06324df5cea0f6151f87c67..082f5e07992378f1d60e6319576632c416b67446 100644 (file)
@@ -30,8 +30,8 @@
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.ReagentDispenserUiKey.Key
-      type: ReagentDispenserBoundUserInterface
+      enum.ReagentDispenserUiKey.Key:
+        type: ReagentDispenserBoundUserInterface
   - type: Anchorable
   - type: Pullable
   - type: Damageable
index 8b2ce8ab5634fa90c055b49155c59b18e5c929bd..86657eb46e05631bbce848d79485ed2504ae3d33 100644 (file)
   - type: SpawnOnOverload
   - type: UserInterface
     interfaces:
-    - key: enum.WiresUiKey.Key
-      type: WiresBoundUserInterface
+      enum.WiresUiKey.Key:
+        type: WiresBoundUserInterface
   - type: Airtight
     noAirWhenFullyAirBlocked: false
   - type: RadiationBlocker
index 2a8cc0c5261bd39ea2278a39e6ad96c9c78ce969..559dca704cdbbdb1c0f2bf4f3798a7c8c76f527d 100644 (file)
@@ -79,8 +79,8 @@
     alwaysRandomize: true
   - type: UserInterface
     interfaces:
-    - key: enum.WiresUiKey.Key
-      type: WiresBoundUserInterface
+      enum.WiresUiKey.Key:
+        type: WiresBoundUserInterface
   - type: Airtight
   - type: Occluder
   - type: Damageable
index a5b8a8dc74d7885aa27a57ddd16a247ba44ce5ea..fcdb432dce60f823776a362ded230e58d71545bb 100644 (file)
@@ -90,7 +90,7 @@
     - type: WiresPanel
     - type: UserInterface
       interfaces:
-        - key: enum.WiresUiKey.Key
+        enum.WiresUiKey.Key:
           type: WiresBoundUserInterface
     - type: Physics
       canCollide: false
index 1819c9d0ef2964949894cd0021604c2aec069e41..dc2acb79273f439e13cd6ed02a44e08229394e47 100644 (file)
@@ -56,8 +56,8 @@
   - type: Appearance
   - type: UserInterface
     interfaces:
-    - key: enum.WiresUiKey.Key
-      type: WiresBoundUserInterface
+      enum.WiresUiKey.Key:
+        type: WiresBoundUserInterface
   - type: Airtight
   - type: RadiationBlocker
     resistance: 2
index a6515b52c64abdc975481c6270e890d5dd6e2b6b..1ec6c04ffe7d0bc2322f2efbfa870eaaf3d70a68 100644 (file)
@@ -66,7 +66,7 @@
     damageContainer: Inorganic
     damageModifierSet: Glass
   - type: ExaminableDamage
-    messages: WindowMessages   
+    messages: WindowMessages
   - type: RCDDeconstructable
     cost: 8
     delay: 8
     layoutId: Airlock
   - type: UserInterface
     interfaces:
-    - key: enum.WiresUiKey.Key
-      type: WiresBoundUserInterface
+      enum.WiresUiKey.Key:
+        type: WiresBoundUserInterface
   - type: Appearance
   - type: WiresVisuals
   - type: Airtight
index 792f0766799ebf99bdb0bdad21b38ba0fdf90cc4..30aa793767a3dea9513281cd0265223d7f022648 100644 (file)
@@ -59,8 +59,8 @@
         - Spellbook
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: InteractionOutline
   - type: ContainerContainer
     containers:
index 2caa4010ca087808324986e359a228c99f9ef7e4..b79c0e621317867b39e68670f461f4fdcf24d82d 100644 (file)
@@ -33,8 +33,8 @@
       storagebase: !type:Container
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: InteractionOutline
   - type: Clickable
   - type: Tag
index f02b12624894e3e1cd85dafa1f9dca1db01e43c2..0824d21ae0d6e76c53b7b9cd8159ac95b36ebf25 100644 (file)
@@ -66,8 +66,8 @@
     price: 25
   - type: UserInterface
     interfaces:
-    - key: enum.DisposalUnitUiKey.Key
-      type: DisposalUnitBoundUserInterface
+      enum.DisposalUnitUiKey.Key:
+        type: DisposalUnitBoundUserInterface
   - type: RatKingRummageable
   - type: SolutionContainerManager
     solutions:
index 40fa8cf472d86dc34bd51630dd0f5b943eeca975..6a351d47f0b746935648e73cfa73c39355424029 100644 (file)
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-      - key: enum.SpaceVillainArcadeUiKey.Key
+      enum.SpaceVillainArcadeUiKey.Key:
         type: SpaceVillainArcadeBoundUserInterface
-      - key: enum.WiresUiKey.Key
+      enum.WiresUiKey.Key:
         type: WiresBoundUserInterface
   - type: Computer
     board: SpaceVillainArcadeComputerCircuitboard
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-      - key: enum.BlockGameUiKey.Key
+      enum.BlockGameUiKey.Key:
         type: BlockGameBoundUserInterface
-      - key: enum.WiresUiKey.Key
+      enum.WiresUiKey.Key:
         type: WiresBoundUserInterface
   - type: Computer
     board: BlockGameArcadeComputerCircuitboard
index ef15f73b322d61bd92d412c1c6f57e8ff4e94f84..56570697dffbddef0a354bb72674464d795bed18 100644 (file)
@@ -31,8 +31,8 @@
     key: enum.EmergencyConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-      - key: enum.EmergencyConsoleUiKey.Key
-        type: EmergencyConsoleBoundUserInterface
+        enum.EmergencyConsoleUiKey.Key:
+          type: EmergencyConsoleBoundUserInterface
   - type: PointLight
     radius: 1.5
     energy: 1.6
@@ -52,8 +52,8 @@
     key: enum.ShuttleConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-      - key: enum.ShuttleConsoleUiKey.Key
-        type: ShuttleConsoleBoundUserInterface
+        enum.ShuttleConsoleUiKey.Key:
+          type: ShuttleConsoleBoundUserInterface
   - type: RadarConsole
   - type: WorldLoader
     radius: 256
     key: enum.IFFConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-      - key: enum.IFFConsoleUiKey.Key
-        type: IFFConsoleBoundUserInterface
+        enum.IFFConsoleUiKey.Key:
+          type: IFFConsoleBoundUserInterface
   - type: Computer
     board: ComputerIFFCircuitboard
 
     key: enum.IFFConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-      - key: enum.IFFConsoleUiKey.Key
-        type: IFFConsoleBoundUserInterface
+        enum.IFFConsoleUiKey.Key:
+          type: IFFConsoleBoundUserInterface
   - type: Computer
     board: ComputerIFFSyndicateCircuitboard
 
     key: enum.PowerMonitoringConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.PowerMonitoringConsoleUiKey.Key
-      type: PowerMonitoringConsoleBoundUserInterface
+      enum.PowerMonitoringConsoleUiKey.Key:
+        type: PowerMonitoringConsoleBoundUserInterface
 
 - type: entity
   parent: BaseComputer
   - type: CriminalRecordsConsole
   - type: UserInterface
     interfaces:
-    - key: enum.CriminalRecordsConsoleKey.Key
-      type: CriminalRecordsConsoleBoundUserInterface
+      enum.CriminalRecordsConsoleKey.Key:
+        type: CriminalRecordsConsoleBoundUserInterface
   - type: ActivatableUI
     key: enum.CriminalRecordsConsoleKey.Key
   - type: Sprite
   - type: GeneralStationRecordConsole
   - type: UserInterface
     interfaces:
-      - key: enum.GeneralStationRecordConsoleKey.Key
-        type: GeneralStationRecordConsoleBoundUserInterface
+        enum.GeneralStationRecordConsoleKey.Key:
+          type: GeneralStationRecordConsoleBoundUserInterface
   - type: ActivatableUI
     key: enum.GeneralStationRecordConsoleKey.Key
   - type: PointLight
     key: enum.CrewMonitoringUIKey.Key
   - type: UserInterface
     interfaces:
-        - key: enum.CrewMonitoringUIKey.Key
+        enum.CrewMonitoringUIKey.Key:
           type: CrewMonitoringBoundUserInterface
   - type: CrewMonitoringConsole
   - type: DeviceNetwork
     key: enum.ResearchConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.ResearchConsoleUiKey.Key
-      type: ResearchConsoleBoundUserInterface
-    - key: enum.ResearchClientUiKey.Key
-      type: ResearchClientBoundUserInterface
+      enum.ResearchConsoleUiKey.Key:
+        type: ResearchConsoleBoundUserInterface
+      enum.ResearchClientUiKey.Key:
+        type: ResearchClientBoundUserInterface
   - type: ApcPowerReceiver
     powerLoad: 1000
   - type: Computer
     key: enum.ArtifactAnalzyerUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.ArtifactAnalzyerUiKey.Key
-      type: AnalysisConsoleBoundUserInterface
-    - key: enum.ResearchClientUiKey.Key
-      type: ResearchClientBoundUserInterface
+      enum.ArtifactAnalzyerUiKey.Key:
+        type: AnalysisConsoleBoundUserInterface
+      enum.ResearchClientUiKey.Key:
+        type: ResearchClientBoundUserInterface
   - type: ApcPowerReceiver
     powerLoad: 1000
   - type: Computer
     key: enum.IdCardConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.IdCardConsoleUiKey.Key
-      type: IdCardConsoleBoundUserInterface
+      enum.IdCardConsoleUiKey.Key:
+        type: IdCardConsoleBoundUserInterface
   - type: CrewManifestViewer
     ownerKey: enum.IdCardConsoleUiKey.Key
   - type: Sprite
     key: enum.CommunicationsConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.CommunicationsConsoleUiKey.Key
-      type: CommunicationsConsoleBoundUserInterface
+      enum.CommunicationsConsoleUiKey.Key:
+        type: CommunicationsConsoleBoundUserInterface
   - type: Computer
     board: CommsComputerCircuitboard
   - type: PointLight
     key: enum.SolarControlConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.SolarControlConsoleUiKey.Key
-      type: SolarControlConsoleBoundUserInterface
+      enum.SolarControlConsoleUiKey.Key:
+        type: SolarControlConsoleBoundUserInterface
   - type: Computer
     board: SolarControlComputerCircuitboard
   - type: PointLight
     key: enum.RadarConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-      - key: enum.RadarConsoleUiKey.Key
-        type: RadarConsoleBoundUserInterface
+        enum.RadarConsoleUiKey.Key:
+          type: RadarConsoleBoundUserInterface
   - type: Computer
     board: RadarConsoleCircuitboard
   - type: PointLight
     key: enum.CargoConsoleUiKey.Shuttle
   - type: UserInterface
     interfaces:
-    - key: enum.CargoConsoleUiKey.Shuttle
-      type: CargoShuttleConsoleBoundUserInterface
+      enum.CargoConsoleUiKey.Shuttle:
+        type: CargoShuttleConsoleBoundUserInterface
   - type: Computer
     board: CargoShuttleComputerCircuitboard
   - type: PointLight
     key: enum.CargoConsoleUiKey.Orders
   - type: UserInterface
     interfaces:
-    - key: enum.CargoConsoleUiKey.Orders
-      type: CargoOrderConsoleBoundUserInterface
+      enum.CargoConsoleUiKey.Orders:
+        type: CargoOrderConsoleBoundUserInterface
   - type: Computer
     board: CargoRequestComputerCircuitboard
   - type: PointLight
     key: enum.CargoConsoleUiKey.Bounty
   - type: UserInterface
     interfaces:
-    - key: enum.CargoConsoleUiKey.Bounty
-      type: CargoBountyConsoleBoundUserInterface
+      enum.CargoConsoleUiKey.Bounty:
+        type: CargoBountyConsoleBoundUserInterface
   - type: Computer
     board: CargoBountyComputerCircuitboard
   - type: PointLight
     key: enum.CloningConsoleUiKey.Key
   - type: UserInterface
     interfaces:
-      - key: enum.CloningConsoleUiKey.Key
-        type: CloningConsoleBoundUserInterface
+        enum.CloningConsoleUiKey.Key:
+          type: CloningConsoleBoundUserInterface
   - type: Speech
     speechVerb: Robotic
     speechSounds: Pai
     - type: ActivatableUIRequiresPower
     - type: UserInterface
       interfaces:
-        - key: enum.SalvageConsoleUiKey.Expedition
+        enum.SalvageConsoleUiKey.Expedition:
           type: SalvageExpeditionConsoleBoundUserInterface
     - type: Computer
       board: SalvageExpeditionsComputerCircuitboard
     anchored: true
   - type: UserInterface
     interfaces:
-      - key: enum.SurveillanceCameraMonitorUiKey.Key
-        type: SurveillanceCameraMonitorBoundUserInterface
+        enum.SurveillanceCameraMonitorUiKey.Key:
+          type: SurveillanceCameraMonitorBoundUserInterface
 
 - type: entity
   parent: BaseComputer
   - type: ActivatableUIRequiresVision
   - type: UserInterface
     interfaces:
-      - key: enum.SurveillanceCameraMonitorUiKey.Key
-        type: SurveillanceCameraMonitorBoundUserInterface
+        enum.SurveillanceCameraMonitorUiKey.Key:
+          type: SurveillanceCameraMonitorBoundUserInterface
 
 - type: entity
   id: ComputerPalletConsole
     key: enum.CargoPalletConsoleUiKey.Sale
   - type: UserInterface
     interfaces:
-    - key: enum.CargoPalletConsoleUiKey.Sale
-      type: CargoPalletConsoleBoundUserInterface
+      enum.CargoPalletConsoleUiKey.Sale:
+        type: CargoPalletConsoleBoundUserInterface
   - type: Computer
     board: CargoRequestComputerCircuitboard
   - type: PointLight
     anchored: true
   - type: UserInterface
     interfaces:
-      - key: enum.NewsWriterUiKey.Key
-        type: NewsWriterBoundUserInterface
+        enum.NewsWriterUiKey.Key:
+          type: NewsWriterBoundUserInterface
 
 - type: entity
   parent: BaseComputer
       key: enum.SensorMonitoringConsoleUiKey.Key
     - type: UserInterface
       interfaces:
-        - key: enum.SensorMonitoringConsoleUiKey.Key
+        enum.SensorMonitoringConsoleUiKey.Key:
           type: SensorMonitoringConsoleBoundUserInterface
     - type: DeviceNetwork
       deviceNetId: AtmosDevices
index df989a77957af2b2af6f921e84e800b2f63e25fe..dd58b9709d3cb2c5fab0806ec74e81eb06ad3e73 100644 (file)
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.DiskConsoleUiKey.Key
-      type: DiskConsoleBoundUserInterface
-    - key: enum.ResearchClientUiKey.Key
-      type: ResearchClientBoundUserInterface
+      enum.DiskConsoleUiKey.Key:
+        type: DiskConsoleBoundUserInterface
+      enum.ResearchClientUiKey.Key:
+        type: ResearchClientBoundUserInterface
   - type: ExtensionCableReceiver
   - type: Computer
     board: TechDiskComputerCircuitboard
index 6ac969171e037539af5cd32060a1eebfee5d6e61..4cb76ea4b921ff6a6d22c0ee20bb60c02fcbba8a 100644 (file)
@@ -89,9 +89,9 @@
     scanDelay: 0
   - type: UserInterface
     interfaces:
-      - key: enum.HealthAnalyzerUiKey.Key
+      enum.HealthAnalyzerUiKey.Key:
         type: HealthAnalyzerBoundUserInterface
-      - key: enum.WiresUiKey.Key
+      enum.WiresUiKey.Key:
         type: WiresBoundUserInterface
   - type: ActivatableUI
     key: enum.HealthAnalyzerUiKey.Key
index ab09a03fef7352b03bd370060a25d61b9d3a066e..8686d88233a3c5e13fda72b1c541a85619c76eb9 100644 (file)
@@ -27,8 +27,8 @@
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.ResearchClientUiKey.Key
-      type: ResearchClientBoundUserInterface
+      enum.ResearchClientUiKey.Key:
+        type: ResearchClientBoundUserInterface
   - type: Machine
     board: AnomalyVesselCircuitboard
   - type: PointLight
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-      - key: enum.AnomalyGeneratorUiKey.Key
-        type: AnomalyGeneratorBoundUserInterface
+        enum.AnomalyGeneratorUiKey.Key:
+          type: AnomalyGeneratorBoundUserInterface
   - type: Appearance
   - type: ActiveRadio
     channels:
index 89cadab6b1f9c517c8d94e933679d8614e000a5c..88e650068eb8d20cfb68c7d7cbac3c100f811a88 100644 (file)
@@ -10,7 +10,7 @@
     - type: InteractionOutline
     - type: UserInterface
       interfaces:
-        - key: enum.WiresUiKey.Key
+        enum.WiresUiKey.Key:
           type: WiresBoundUserInterface
     - type: Wires
       layoutId: Defusable
index aee124602140e2a06d3fe3d6665819e60b2c4b24..4e565054b461839069a32175481598736cc80713 100644 (file)
@@ -50,8 +50,8 @@
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.ChemMasterUiKey.Key
-      type: ChemMasterBoundUserInterface
+      enum.ChemMasterUiKey.Key:
+        type: ChemMasterBoundUserInterface
   - type: ApcPowerReceiver
     powerLoad: 250
   - type: Appearance
index 7e78f66efa6f699def1bd0cda40353991f81fdec..583b5e3548a18256ba8aa40ffddcd7e8d151bc99 100644 (file)
@@ -32,8 +32,8 @@
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.FaxUiKey.Key
-      type: FaxBoundUi
+      enum.FaxUiKey.Key:
+        type: FaxBoundUi
   - type: ApcPowerReceiver
     powerLoad: 250
   - type: FaxMachine
index 3244789a028fee7f3c50963fa3d72ecc6f382303..b4f05cf68a7b4f08b63f8d11b4b4f5458e7023f8 100644 (file)
@@ -58,8 +58,8 @@
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.FlatpackCreatorUIKey.Key
-      type: FlatpackCreatorBoundUserInterface
+      enum.FlatpackCreatorUIKey.Key:
+        type: FlatpackCreatorBoundUserInterface
   - type: ItemSlots
     slots:
       board_slot:
index b6ad9db356f3fc73eb54177707aebc8d2ee3eea8..dd01adf6d5c7cd7bf37d587fe92aa252c64697d0 100644 (file)
@@ -52,6 +52,6 @@
     key: enum.GatewayUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.GatewayUiKey.Key
-      type: GatewayBoundUserInterface
+      enum.GatewayUiKey.Key:
+        type: GatewayBoundUserInterface
   - type: Gateway
index 618538dccb7cf8803baac60592c419f7f5717c00..6ee454c6a98798c619c4ddadecf233380991e4b2 100644 (file)
@@ -62,8 +62,8 @@
       on: "on"
   - type: UserInterface
     interfaces:
-      - key: enum.GravityGeneratorUiKey.Key
-        type: GravityGeneratorBoundUserInterface
+        enum.GravityGeneratorUiKey.Key:
+          type: GravityGeneratorBoundUserInterface
   - type: Appearance
   - type: PointLight
     radius: 2.5
index 76b8ddd36baf4d4e4bafc8c287c7d25a5c9c8bb4..acd8527dbbad83e0de1beecda9d9268e14a4aef1 100644 (file)
@@ -26,8 +26,8 @@
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-      - key: enum.JukeboxUiKey.Key
-        type: JukeboxBoundUserInterface
+        enum.JukeboxUiKey.Key:
+          type: JukeboxBoundUserInterface
   - type: Damageable
     damageContainer: Inorganic
     damageModifierSet: Metallic
index 25c65452863e56b67e23e23329d14c30da756eda..9ad3214dc3527252980ec1536ff975614e408522 100644 (file)
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.LatheUiKey.Key
-      type: LatheBoundUserInterface
-    - key: enum.ResearchClientUiKey.Key
-      type: ResearchClientBoundUserInterface
+      enum.LatheUiKey.Key:
+        type: LatheBoundUserInterface
+      enum.ResearchClientUiKey.Key:
+        type: ResearchClientBoundUserInterface
   - type: Transform
     anchored: true
   - type: Pullable
index 37b5e50d31dcdb4420d9a26cf39dba0dd0c614ba..fe4eb1451832604dd7164bb7fbcba0045bde0a7e 100644 (file)
@@ -44,8 +44,8 @@
     range: 200
   - type: UserInterface
     interfaces:
-    - key: enum.MicrowaveUiKey.Key
-      type: MicrowaveBoundUserInterface
+      enum.MicrowaveUiKey.Key:
+        type: MicrowaveBoundUserInterface
   - type: Physics
   - type: Fixtures
     fixtures:
index f37c42e4745cf59553e36e0a2693ac10f33e8122..bc4581d7b6536560f90f47ed2cf2243b7bf71a23 100644 (file)
@@ -88,8 +88,8 @@
     key: enum.NukeUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.NukeUiKey.Key
-      type: NukeBoundUserInterface
+      enum.NukeUiKey.Key:
+        type: NukeBoundUserInterface
   - type: StaticPrice
     price: 50000 # YOU STOLE A NUCLEAR FISSION EXPLOSIVE?!
   - type: CargoSellBlacklist
index 773112f6f36bfee5fa8b8a38850add72e30d0ade..d6e733331330294583a749f3cae0a99b37ddd4ee 100644 (file)
@@ -12,8 +12,8 @@
     key: enum.ReagentGrinderUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.ReagentGrinderUiKey.Key
-      type: ReagentGrinderBoundUserInterface
+      enum.ReagentGrinderUiKey.Key:
+        type: ReagentGrinderBoundUserInterface
   - type: Appearance
   - type: GenericVisualizer
     visuals:
   - type: DrainableSolution
     solution: output
   - type: ExaminableSolution
-    solution: output
\ No newline at end of file
+    solution: output
index 948b3f84b2675cbdc344967c7ef81d92d1d70c9c..498759df3c95ed1d90c4c7feb26a384bb1bbba33 100644 (file)
@@ -83,8 +83,8 @@
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.ResearchClientUiKey.Key
-      type: ResearchClientBoundUserInterface
+      enum.ResearchClientUiKey.Key:
+        type: ResearchClientBoundUserInterface
   - type: Appearance
   - type: GenericVisualizer
     visuals:
index a17eed5712a92d75a03f742f3e42b48dff69b37c..cafdc7cef2aeeea1eb2056c7b4da4b6232f029e9 100644 (file)
@@ -28,8 +28,8 @@
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.SalvageMagnetUiKey.Key
-      type: SalvageMagnetBoundUserInterface
+      enum.SalvageMagnetUiKey.Key:
+        type: SalvageMagnetBoundUserInterface
   - type: Transform
     noRot: false
   - type: Appearance
index 1eeaec9b7c656d35f90d9d172b03ff8525ba4228..904bf46a0b72ade997c296eead3f0070ebd72c7a 100644 (file)
@@ -13,7 +13,7 @@
     - type: DeviceNetworkRequiresPower
     - type: UserInterface
       interfaces:
-        - key: enum.SurveillanceCameraSetupUiKey.Router
+        enum.SurveillanceCameraSetupUiKey.Router:
           type: SurveillanceCameraSetupBoundUi
     - type: Machine
       board: SurveillanceCameraRouterCircuitboard
     - type: DeviceNetworkRequiresPower
     - type: UserInterface
       interfaces:
-        - key: enum.SurveillanceCameraSetupUiKey.Router
+        enum.SurveillanceCameraSetupUiKey.Router:
           type: SurveillanceCameraSetupBoundUi
     - type: Machine
       board: SurveillanceCameraWirelessRouterCircuitboard
index 6f28b533507a8ce68669aed3cfd35ba9e533bcbb..16a5aa55d4e77dbb546aa525eab0844385ead602 100644 (file)
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.VendingMachineUiKey.Key
-      type: VendingMachineBoundUserInterface
-    - key: enum.WiresUiKey.Key
-      type: WiresBoundUserInterface
+      enum.VendingMachineUiKey.Key:
+        type: VendingMachineBoundUserInterface
+      enum.WiresUiKey.Key:
+        type: WiresBoundUserInterface
   - type: WiresPanel
   - type: Wires
     boardName: wires-board-name-vendingmachine
index d69eb96f6237ea420f6eb41f526874bd4d409560..fc8f31535cdb891472740485bd6efc19b5db798b 100644 (file)
@@ -33,7 +33,7 @@
       range: 10
     - type: UserInterface
       interfaces:
-        - key: enum.SurveillanceCameraSetupUiKey.Camera
+        enum.SurveillanceCameraSetupUiKey.Camera:
           type: SurveillanceCameraSetupBoundUi
   placement:
     mode: SnapgridCenter
index 4bea87f8175ae017f6c1f6a1e7fc9d4c2e70d27e..fa5804c64525ef4930bf7b319795b87358e7cd5f 100644 (file)
@@ -51,8 +51,8 @@
     enabled: false
   - type: UserInterface
     interfaces:
-      - key: enum.GasPressurePumpUiKey.Key
-        type: GasPressurePumpBoundUserInterface
+        enum.GasPressurePumpUiKey.Key:
+          type: GasPressurePumpBoundUserInterface
   - type: Construction
     graph: GasBinary
     node: pressurepump
@@ -92,7 +92,7 @@
       enabled: false
     - type: UserInterface
       interfaces:
-        - key: enum.GasVolumePumpUiKey.Key
+        enum.GasVolumePumpUiKey.Key:
           type: GasVolumePumpBoundUserInterface
     - type: Construction
       graph: GasBinary
index 316c403d7aa7070fb40263cc55ec2fc877782711..200df727b3b5467364930fdde3ee8e6eb90f2825 100644 (file)
         layer:
         - MachineLayer
   - type: ApcPowerReceiver
-    powerDisabled: true #starts off 
+    powerDisabled: true #starts off
   - type: Sprite
     sprite: Structures/Piping/Atmospherics/Portable/portable_sheater.rsi
     noRot: true
   - type: WiresVisuals
   - type: UserInterface
     interfaces:
-    - key: enum.SpaceHeaterUiKey.Key
-      type: SpaceHeaterBoundUserInterface
+      enum.SpaceHeaterUiKey.Key:
+        type: SpaceHeaterBoundUserInterface
   - type: ActivatableUI
     inHandsOnly: false
     key: enum.SpaceHeaterUiKey.Key
   suffix: Anchored, Enabled
   components:
   - type: ApcPowerReceiver
-    powerDisabled: false
\ No newline at end of file
+    powerDisabled: false
index d0f239b338be86b5f8d3d86de740ff02f07c1b39..46eb57c388dc83220729b9af8e28b98b18c3609b 100644 (file)
@@ -53,7 +53,7 @@
     - type: PipeColorVisuals
     - type: UserInterface
       interfaces:
-        - key: enum.GasFilterUiKey.Key
+        enum.GasFilterUiKey.Key:
           type: GasFilterBoundUserInterface
     - type: GasFilter
       enabled: false
     - type: PipeColorVisuals
     - type: UserInterface
       interfaces:
-        - key: enum.GasMixerUiKey.Key
+        enum.GasMixerUiKey.Key:
           type: GasMixerBoundUserInterface
     - type: GasMixer
       enabled: false
index e046fb831a008fc0fafd3a4cf1b3efca3ae0bf23..c0664602b498b6cf111c5b38cfed1c30ba9d4864 100644 (file)
     - type: AtmosDevice
     - type: UserInterface
       interfaces:
-      - key: enum.ThermomachineUiKey.Key
-        type: GasThermomachineBoundUserInterface
+        enum.ThermomachineUiKey.Key:
+          type: GasThermomachineBoundUserInterface
     - type: ActivatableUI
       inHandsOnly: false
       key: enum.ThermomachineUiKey.Key
index 218b532efcd1dcf6b1bebdd45bc299ae3e4ba72b..0224105117922bb31d148e11950a767579969076 100644 (file)
     key: enum.DisposalTaggerUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.DisposalTaggerUiKey.Key
-      type: DisposalTaggerBoundUserInterface
+      enum.DisposalTaggerUiKey.Key:
+        type: DisposalTaggerBoundUserInterface
   - type: Construction
     graph: DisposalPipe
     node: tagger
     key: enum.DisposalRouterUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.DisposalRouterUiKey.Key
-      type: DisposalRouterBoundUserInterface
+      enum.DisposalRouterUiKey.Key:
+        type: DisposalRouterBoundUserInterface
   - type: Fixtures
     fixtures:
       fix1:
index 43dc63445ce8dcdc060907cae0968eea84b52561..b4a5f61ffafbc4a762180639d6b93537a77c481d 100644 (file)
@@ -56,8 +56,8 @@
   - type: Appearance
   - type: UserInterface
     interfaces:
-    - key: enum.DisposalUnitUiKey.Key
-      type: DisposalUnitBoundUserInterface
+      enum.DisposalUnitUiKey.Key:
+        type: DisposalUnitBoundUserInterface
   - type: ContainerContainer
     containers:
       disposals: !type:Container
@@ -79,8 +79,8 @@
   - type: DisposalUnit
   - type: UserInterface
     interfaces:
-    - key: enum.DisposalUnitUiKey.Key
-      type: DisposalUnitBoundUserInterface
+      enum.DisposalUnitUiKey.Key:
+        type: DisposalUnitBoundUserInterface
   - type: RatKingRummageable
 
 - type: entity
   - type: Appearance
   - type: UserInterface
     interfaces:
-    - key: enum.MailingUnitUiKey.Key
-      type: DisposalUnitBoundUserInterface
-    - key: enum.ConfigurationUiKey.Key
-      type: ConfigurationBoundUserInterface
+      enum.MailingUnitUiKey.Key:
+        type: DisposalUnitBoundUserInterface
+      enum.ConfigurationUiKey.Key:
+        type: ConfigurationBoundUserInterface
index ca0cebffecd4778d18715ab7d48ed686ae631eff..96392ecd0050071aa0894d733ff8d9f4c709c17d 100644 (file)
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-    - key: enum.ParticleAcceleratorControlBoxUiKey.Key
-      type: ParticleAcceleratorBoundUserInterface
-    - key: enum.WiresUiKey.Key
-      type: WiresBoundUserInterface
+      enum.ParticleAcceleratorControlBoxUiKey.Key:
+        type: ParticleAcceleratorBoundUserInterface
+      enum.WiresUiKey.Key:
+        type: WiresBoundUserInterface
   - type: WiresPanel
   - type: Wires
     boardName: wires-board-name-pa
index c88adca76d74bdb466b0dba6f79d03aef3c6fcfd..4e4ef8bdbcf37d50ba6812e33b3caf3435869bff 100644 (file)
@@ -65,8 +65,8 @@
     key: enum.AmeControllerUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.AmeControllerUiKey.Key
-      type: AmeControllerBoundUserInterface
+      enum.AmeControllerUiKey.Key:
+        type: AmeControllerBoundUserInterface
   - type: Appearance
   - type: GenericVisualizer
     visuals:
index dbaacd6abc2ed9848f564f2b75564d344a9fe8e5..d735d9607c372d33b866e06c74c4a3fdb7202198 100644 (file)
@@ -44,7 +44,7 @@
     - type: WiresPanel
     - type: UserInterface
       interfaces:
-        - key: enum.GeneratorComponentUiKey.Key
+        enum.GeneratorComponentUiKey.Key:
           type: PortableGeneratorBoundUserInterface
     - type: ActivatableUI
       key: enum.GeneratorComponentUiKey.Key
index 4df502791f3125a39a0c6b83c560408c71caf3bc..71e450649544035eb8e5100448543b879725770c 100644 (file)
@@ -81,8 +81,8 @@
   - type: ExtensionCableProvider
   - type: UserInterface
     interfaces:
-    - key: enum.ApcUiKey.Key
-      type: ApcBoundUserInterface
+      enum.ApcUiKey.Key:
+        type: ApcBoundUserInterface
   - type: ActivatableUI
     inHandsOnly: false
     singleUser: true
index 2591b3f3408ed13f68850405f1a0a9ac9f814ce2..9fd05beaeea08436c93ee15ec7a6064d31e8b8c9 100644 (file)
       fillBaseName: cart_water-
     - type: UserInterface
       interfaces:
-      - key: enum.StorageUiKey.Key
-        type: StorageBoundUserInterface
+        enum.StorageUiKey.Key:
+          type: StorageBoundUserInterface
     - type: Drink
       solution: bucket
     - type: ContainerContainer
index cd44f5f585a3c14eb5e65ee1979efda7a0dea4b9..b38ef61791c8ef17ffc143662b5f2f58a9939f57 100644 (file)
@@ -36,7 +36,7 @@
             3: { state: can-o3, shader: "unshaded" }
     - type: UserInterface
       interfaces:
-        - key: enum.GasCanisterUiKey.Key
+        enum.GasCanisterUiKey.Key:
           type: GasCanisterBoundUserInterface
     - type: Destructible
       thresholds:
index d341c017a708b0c15d0707bc1c27cac896abca34..08db462be017ed6218c2df7292f31b7d7b76f8b1 100644 (file)
@@ -24,8 +24,8 @@
       map: ["openLayer"]
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: Transform
     noRot: true
   - type: Fixtures
   - type: Appearance
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: Transform
     noRot: true
   - type: Fixtures
index 961d7854c08b8ced17b2e85689a2f36a4720dce8..b26bb2c954f16790d6c2cd90a0c0ccd76d49f9a5 100644 (file)
@@ -60,8 +60,8 @@
       - Ore
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: ContainerContainer
     containers:
       storagebase: !type:Container
index 62f2000593b2c2ac520b8dc8561ab7e16cc99134..7f306bbf94612b31522caa0a6cb7690a23de2135 100644 (file)
   - type: InteractionOutline
   - type: UserInterface
     interfaces:
-    - key: enum.SharedAirAlarmInterfaceKey.Key
-      type: AirAlarmBoundUserInterface
-    - key: enum.WiresUiKey.Key
-      type: WiresBoundUserInterface
+      enum.SharedAirAlarmInterfaceKey.Key:
+        type: AirAlarmBoundUserInterface
+      enum.WiresUiKey.Key:
+        type: WiresBoundUserInterface
   - type: WiresPanel
   - type: Wires
     boardName: wires-board-name-airalarm
index 05988fbc217e3b566c5ca1298e3d92d57c9008c8..3088e0a00151e562680f6cef0e55181735d585d8 100644 (file)
@@ -60,8 +60,8 @@
       delta: fire_3
   - type: UserInterface
     interfaces:
-    - key: enum.WiresUiKey.Key
-      type: WiresBoundUserInterface
+      enum.WiresUiKey.Key:
+        type: WiresBoundUserInterface
   - type: WiresPanel
   - type: Wires
     boardName: wires-board-name-firealarm
index 037a89a98863a9b9184ce681ca2cc7ba53e052c4..2cf77d843c50f2741697d62001d889edd403334e 100644 (file)
@@ -63,9 +63,9 @@
     key: enum.IntercomUiKey.Key
   - type: UserInterface
     interfaces:
-      - key: enum.IntercomUiKey.Key
+      enum.IntercomUiKey.Key:
         type: IntercomBoundUserInterface
-      - key: enum.WiresUiKey.Key
+      enum.WiresUiKey.Key:
         type: WiresBoundUserInterface
   - type: Construction
     graph: Intercom
index b524f099bfbc77a1a86bc1a1ddff8e65760cbcfd..d02bce020daaa324d6a6cebb19b4b8a5cf79b762 100644 (file)
@@ -16,5 +16,5 @@
     key: enum.MagicMirrorUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.MagicMirrorUiKey.Key
-      type: MagicMirrorBoundUserInterface
+      enum.MagicMirrorUiKey.Key:
+        type: MagicMirrorBoundUserInterface
index 451495f58d2c603783c9281f918260eaae220433..408ab6b67c35a6839a48587d5b91e930feeaa2af 100644 (file)
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-      - key: enum.SurveillanceCameraMonitorUiKey.Key
-        type: SurveillanceCameraMonitorBoundUserInterface
+        enum.SurveillanceCameraMonitorUiKey.Key:
+          type: SurveillanceCameraMonitorBoundUserInterface
 
 # Wall Televisions
 
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
-      - key: enum.SurveillanceCameraMonitorUiKey.Key
-        type: SurveillanceCameraMonitorBoundUserInterface
+        enum.SurveillanceCameraMonitorUiKey.Key:
+          type: SurveillanceCameraMonitorBoundUserInterface
   - type: PointLight
     radius: 1.5
     energy: 1.6
index 421ab93be97f9e41633a108a8d451a19a814588e..f2315583e3ccb52674c3f27d4448e241d8a844c1 100644 (file)
@@ -50,8 +50,8 @@
         - Write
   - type: UserInterface
     interfaces:
-    - key: enum.StorageUiKey.Key
-      type: StorageBoundUserInterface
+      enum.StorageUiKey.Key:
+        type: StorageBoundUserInterface
   - type: ContainerContainer
     containers:
       storagebase: !type:Container
index d1df619b7a4eee288e115f84e2a975f1ad398421..2ae5040910e19cb1d691212dc69acf3fe7712fbe 100644 (file)
@@ -86,7 +86,7 @@
               acts: [ "Destruction" ]
     - type: UserInterface
       interfaces:
-        - key: enum.StationMapUiKey.Key
+        enum.StationMapUiKey.Key:
           type: StationMapBoundUserInterface
 
 - type: entity
index dfbe99b2d2acba8668383fc68ced5944f411e737..2ac81b463af47b2a80f9998d12d5d73c2e2d5542 100644 (file)
@@ -42,9 +42,9 @@
       InUse: camera_in_use
   - type: UserInterface
     interfaces:
-      - key: enum.SurveillanceCameraSetupUiKey.Camera
+      enum.SurveillanceCameraSetupUiKey.Camera:
         type: SurveillanceCameraSetupBoundUi
-      - key: enum.WiresUiKey.Key
+      enum.WiresUiKey.Key:
         type: WiresBoundUserInterface
   - type: StaticPrice
     price: 200
index 0c284eec7afcc2516ecc901defcb26e33ee4dd98..dd7eb5bea82a7183104bf01c38c6f206432ccbaf 100644 (file)
@@ -32,8 +32,8 @@
     key: enum.SignalTimerUiKey.Key
   - type: UserInterface
     interfaces:
-    - key: enum.SignalTimerUiKey.Key
-      type: SignalTimerBoundUserInterface
+      enum.SignalTimerUiKey.Key:
+        type: SignalTimerBoundUserInterface
   - type: ApcPowerReceiver
     powerLoad: 100
   - type: Electrified
index 9063e8b1385c02ac61f1fdec256d000fe6d6b84f..bdb8862a8293a140ad0d7987cfc2c86083aed247 100644 (file)
@@ -12,8 +12,8 @@
       map: ["base"]
   - type: UserInterface
     interfaces:
-    - key: enum.CryostorageUIKey.Key
-      type: CryostorageBoundUserInterface
+      enum.CryostorageUIKey.Key:
+        type: CryostorageBoundUserInterface
   - type: ActivatableUI
     key: enum.CryostorageUIKey.Key
   - type: AccessReader
index 911c1c2e88eea6bb3a334400be9b27a1b70fd860..84df09af33d7feeb8cc82d47326e4c5f03807e4a 100644 (file)
   permanentComponents:
   - type: UserInterface
     interfaces:
-      - key: enum.SignalLinkerUiKey.Key
-        type: SignalPortSelectorBoundUserInterface
+        enum.SignalLinkerUiKey.Key:
+          type: SignalPortSelectorBoundUserInterface
   - type: ToolTileCompatible
   - type: Tool
     qualities: