From 38ce9aaa83544882079eb13c3a4fb53e9623c0bb Mon Sep 17 00:00:00 2001 From: Ertanic Date: Fri, 27 Sep 2024 05:45:05 +0300 Subject: [PATCH] try revert "upstream" This reverts commit 756904abbaccc0214340197bf99b9b4f18442db5, reversing changes made to 2ff04d152502d4867f65c6055957f4ce2ff63d64. --- .vscode/launch.json | 2 +- Content.Client/Actions/ActionsSystem.cs | 27 - .../UI/SetOutfit/SetOutfitMenu.xaml.cs | 19 +- Content.Client/Buckle/BuckleSystem.cs | 17 + .../Cartridges/WantedListUi.cs | 30 - .../Cartridges/WantedListUiFragment.cs | 237 - .../Cartridges/WantedListUiFragment.xaml | 50 - Content.Client/Explosion/ExplosionSystem.cs | 5 +- Content.Client/Flash/FlashOverlay.cs | 4 +- .../GPS/Components/HandheldGPSComponent.cs | 9 + .../GPS/Systems/HandheldGpsSystem.cs | 2 +- .../GPS/UI/HandheldGpsStatusControl.cs | 15 +- .../UI/HealthAnalyzerWindow.xaml | 8 +- .../UI/HealthAnalyzerWindow.xaml.cs | 14 +- Content.Client/Lobby/UI/LobbyGui.xaml | 2 +- Content.Client/Mapping/MappingScreen.xaml | 1 - Content.Client/Mapping/MappingScreen.xaml.cs | 16 - .../CrewMonitoring/CrewMonitoringWindow.xaml | 3 - .../CrewMonitoringWindow.xaml.cs | 5 - .../Paper/UI/PaperBoundUserInterface.cs | 5 - Content.Client/Paper/UI/PaperWindow.xaml | 11 +- Content.Client/Paper/UI/PaperWindow.xaml.cs | 55 +- .../UI/StationMapBeaconControl.xaml | 19 - .../UI/StationMapBeaconControl.xaml.cs | 50 - .../UI/StationMapBoundUserInterface.cs | 11 +- .../Pinpointer/UI/StationMapWindow.xaml | 23 +- .../Pinpointer/UI/StationMapWindow.xaml.cs | 55 +- .../Shuttles/UI/ShuttleNavControl.xaml.cs | 49 +- Content.Client/Stylesheets/StyleNano.cs | 13 +- .../Controls/DialogWindow.xaml.cs | 3 - .../VendingMachineBoundUserInterface.cs | 22 +- .../VendingMachines/VendingMachineSystem.cs | 10 - Content.Client/Verbs/VerbSystem.cs | 153 +- .../VoiceMask/VoiceMaskBoundUserInterface.cs | 2 +- .../VoiceMaskNameChangeWindow.xaml.cs | 7 +- Content.Client/Voting/UI/VoteCallMenu.xaml | 19 +- Content.Client/Voting/UI/VoteCallMenu.xaml.cs | 191 +- Content.Client/Voting/UI/VotePopup.xaml | 5 +- Content.Client/Voting/UI/VotePopup.xaml.cs | 34 +- Content.Client/Voting/VoteManager.cs | 24 +- Content.Client/Voting/VotingSystem.cs | 34 - .../Tests/Buckle/BuckleTest.Interact.cs | 108 - .../Tests/Buckle/BuckleTest.cs | 4 +- .../Interaction/ComputerContruction.cs | 4 +- .../Access/Systems/AgentIDCardSystem.cs | 8 +- .../Commands/RoleBanListCommand.cs | 74 +- .../Commands/SetOutfitCommand.cs | 36 - .../EntitySystems/AtmosphereSystem.Hotspot.cs | 33 +- .../Atmos/EntitySystems/AtmosphereSystem.cs | 19 - .../Unary/Components/GasVentPumpComponent.cs | 69 +- .../Unary/EntitySystems/GasVentPumpSystem.cs | 46 +- .../Bed/Cryostorage/CryostorageSystem.cs | 3 +- .../CartridgeLoader/CartridgeLoaderSystem.cs | 6 - .../Cartridges/AstroNavCartridgeComponent.cs | 6 - .../Cartridges/AstroNavCartridgeSystem.cs | 31 - .../Cartridges/WantedListCartridge.cs | 6 - Content.Server/Chat/Systems/ChatSystem.cs | 25 +- .../SolutionRegenerationComponent.cs | 12 +- .../SolutionRegenerationSystem.cs | 6 +- .../Construction/Completions/GivePrototype.cs | 54 +- .../Systems/CriminalRecordsConsoleSystem.cs | 40 +- .../Systems/CriminalRecordsSystem.cs | 92 +- Content.Server/Database/ServerDbBase.cs | 2 +- .../Behaviors/SolutionExplosionBehavior.cs | 2 +- .../Unit/EntitySystems/DisposalUnitSystem.cs | 6 +- Content.Server/Entry/IgnoredComponents.cs | 1 + .../Components/ExplosiveComponent.cs | 35 +- .../EntitySystems/ExplosionSystem.Airtight.cs | 4 +- .../EntitySystems/ExplosionSystem.CVars.cs | 4 +- .../EntitySystems/ExplosionSystem.GridMap.cs | 4 +- .../ExplosionSystem.Processing.cs | 10 +- .../EntitySystems/ExplosionSystem.TileFill.cs | 5 +- .../EntitySystems/ExplosionSystem.Visuals.cs | 6 +- .../EntitySystems/ExplosionSystem.cs | 19 +- Content.Server/Flash/FlashSystem.cs | 8 +- .../Kitchen/EntitySystems/SharpSystem.cs | 44 +- .../MassMedia/Systems/NewsSystem.cs | 5 +- .../Systems/StealConditionSystem.cs | 32 +- .../Power/EntitySystems/BatterySystem.cs | 4 +- .../Power/Generation/Teg/TegSystem.cs | 11 +- .../Radio/EntitySystems/RadioDeviceSystem.cs | 4 +- .../Radio/EntitySystems/RadioSystem.cs | 16 +- .../ContainmentFieldGeneratorSystem.cs | 7 - .../Speech/Components/ListenWireAction.cs | 63 +- .../Components/VoiceOverrideComponent.cs | 35 - .../EntitySystems/VoiceOverrideSystem.cs | 22 - .../SurveillanceCameraSpeakerSystem.cs | 3 +- .../VendingMachineContrabandWireAction.cs | 11 +- .../VendingMachines/VendingMachineSystem.cs | 43 +- .../VoiceMask/VoiceMaskComponent.cs | 31 +- .../VoiceMask/VoiceMaskSystem.Equip.cs | 49 + Content.Server/VoiceMask/VoiceMaskSystem.cs | 116 +- .../VoiceMask/VoiceMaskerComponent.cs | 20 + Content.Server/Voting/IVoteHandle.cs | 7 +- .../Voting/Managers/IVoteManager.cs | 4 +- .../Managers/VoteManager.DefaultVotes.cs | 415 +- Content.Server/Voting/Managers/VoteManager.cs | 84 +- Content.Server/Voting/VoteCommands.cs | 10 +- Content.Server/Voting/VoteOptions.cs | 17 +- Content.Server/Voting/VotingSystem.cs | 121 - Content.Shared/Actions/BaseActionComponent.cs | 14 - Content.Shared/Actions/SharedActionsSystem.cs | 64 +- Content.Shared/Atmos/Atmospherics.cs | 3 +- .../Piping/Unary/VentScrewedDoAfterEvent.cs | 9 - .../Beeper/Systems/ProximityBeeperSystem.cs | 6 +- .../Buckle/Components/BuckleComponent.cs | 18 +- .../Buckle/Components/StrapComponent.cs | 8 +- .../Buckle/SharedBuckleSystem.Buckle.cs | 27 +- .../Buckle/SharedBuckleSystem.Interaction.cs | 25 +- Content.Shared/CCVar/CCVars.cs | 88 +- .../Cartridges/WantedListUiState.cs | 10 - Content.Shared/Chat/SharedChatEvents.cs | 24 - .../SharedChameleonClothingSystem.cs | 13 - .../Containers/ItemSlot/ItemSlotsSystem.cs | 69 +- Content.Shared/Contraband/ContrabandSystem.cs | 12 +- .../CriminalRecords/CriminalRecord.cs | 8 +- .../Systems/SharedCriminalRecordsSystem.cs | 21 - .../EntitySystems/SharedExplosionSystem.cs | 25 +- Content.Shared/Flash/SharedFlashSystem.cs | 13 +- .../Fluids/Components/DrainComponent.cs | 24 +- .../GPS/Components/HandheldGPSComponent.cs | 10 - .../Inventory/InventorySystem.Relay.cs | 2 - Content.Shared/Paper/PaperSystem.cs | 6 +- .../Placeable/PlaceableSurfaceSystem.cs | 29 +- .../ContainmentFieldGeneratorComponent.cs | 2 +- .../StatusEffect/StatusEffectsSystem.cs | 75 +- .../SharedEntityStorageSystem.cs | 5 +- .../EntitySystems/SharedStorageSystem.cs | 9 +- Content.Shared/Storage/StorageComponent.cs | 3 - .../Components/SharedHandheldGPSComponent.cs | 9 + .../SharedVendingMachineSystem.cs | 10 +- .../VendingMachineComponent.cs | 25 +- .../VendingMachineInterfaceState.cs | 11 + Content.Shared/Voting/MsgVoteData.cs | 8 +- Content.Shared/Voting/StandardVoteType.cs | 48 +- Content.Shared/Voting/VotingEvents.cs | 30 - Resources/Changelog/Admin.yml | 8 - Resources/Changelog/Changelog.yml | 741 +- Resources/Credits/GitHub.txt | 2 +- .../en-US/advertisements/vending/donut.ftl | 2 +- .../bed/cryostorage/cryogenic-storage.ftl | 2 +- .../en-US/cartridge-loader/cartridges.ftl | 31 - .../criminal-records/criminal-records.ftl | 2 +- .../Locale/en-US/flavors/flavor-profiles.ftl | 1 - .../components/crew-monitoring-component.ftl | 2 - .../en-US/navmap-beacons/station_map.ftl | 1 - .../nutrition/components/food-sequence.ftl | 2 - .../conditions/steal-target-groups.ftl | 1 - .../Locale/en-US/paper/paper-component.ftl | 3 - .../Locale/en-US/paper/stamp-component.ftl | 1 - Resources/Locale/en-US/seeds/seeds.ftl | 2 - .../Locale/en-US/store/uplink-catalog.ftl | 3 - Resources/Locale/en-US/voice-mask.ftl | 2 - .../en-US/voting/managers/vote-manager.ftl | 13 - .../Locale/en-US/voting/ui/vote-call-menu.ftl | 19 - .../Locale/en-US/voting/ui/vote-popup.ftl | 4 +- Resources/Locale/en-US/wires/wire-names.ftl | 1 - .../Maps/Shuttles/ShuttleEvent/instigator.yml | 4052 -- Resources/Maps/Shuttles/emergency_omega.yml | 288 +- Resources/Maps/cog.yml | 27671 ++++----- Resources/Maps/fland.yml | 242 +- Resources/Maps/meta.yml | 14 +- Resources/Maps/oasis.yml | 2305 +- Resources/Maps/omega.yml | 49908 +++++++--------- Resources/Maps/reach.yml | 17 +- Resources/Prototypes/Atmospherics/gases.yml | 4 +- .../Catalog/Cargo/cargo_emergency.yml | 2 +- .../Catalog/Cargo/cargo_engineering.yml | 2 +- .../Catalog/Fills/Crates/emergency.yml | 4 +- .../Catalog/Fills/Lockers/heads.yml | 2 - .../VendingMachines/Inventories/medidrobe.yml | 2 - .../Prototypes/Catalog/uplink_catalog.yml | 38 +- Resources/Prototypes/Decals/burnt.yml | 31 - .../Entities/Clothing/Head/hats.yml | 15 - .../Entities/Clothing/Masks/masks.yml | 2 +- .../Entities/Clothing/Masks/specific.yml | 6 +- .../Prototypes/Entities/Effects/mobspawn.yml | 56 +- .../Spawners/Random/Salvage/tables_loot.yml | 1 + .../Prototypes/Entities/Mobs/NPCs/animals.yml | 13 +- .../Entities/Mobs/NPCs/regalrat.yml | 1 - .../Prototypes/Entities/Mobs/NPCs/silicon.yml | 5 + .../Prototypes/Entities/Mobs/Species/base.yml | 2 + .../Entities/Mobs/Species/slime.yml | 2 + .../Objects/Consumable/Food/produce.yml | 40 - .../Objects/Devices/Electronics/misc.yml | 15 - .../Entities/Objects/Devices/cartridges.yml | 42 - .../Entities/Objects/Devices/pda.yml | 40 +- .../Prototypes/Entities/Objects/Fun/pai.yml | 4 + .../Entities/Objects/Misc/books.yml | 9 - .../Entities/Objects/Misc/paper.yml | 18 +- .../Prototypes/Entities/Objects/Misc/pen.yml | 1 - .../Entities/Objects/Misc/rubber_stamp.yml | 14 - .../Objects/Specific/Hydroponics/seeds.yml | 10 - .../Objects/Specific/Mech/mecha_equipment.yml | 2 +- .../Entities/Objects/Specific/Mech/mechs.yml | 3 - .../Objects/Specific/Research/anomaly.yml | 1 - .../Entities/Objects/Tools/blueprint.yml | 10 + .../Entities/Objects/Tools/thief_beacon.yml | 1 - .../Entities/Objects/Tools/tools.yml | 3 - .../Objects/Weapons/Guns/LMGs/lmgs.yml | 3 - .../Weapons/Guns/Projectiles/arrows.yml | 53 - .../Structures/Furniture/rollerbeds.yml | 1 + .../Computers/base_structurecomputers.yml | 29 - .../Machines/Computers/computers.yml | 184 +- .../Entities/Structures/Machines/lathe.yml | 3 +- .../Structures/Machines/vending_machines.yml | 7 +- .../Structures/Specific/Anomaly/cores.yml | 4 - .../Storage/Closets/Lockers/lockers.yml | 5 - .../Structures/Storage/Crates/crates.yml | 5 - .../Structures/Wallmounts/intercom.yml | 3 - Resources/Prototypes/Flavors/flavors.yml | 5 - .../Prototypes/GameRules/unknown_shuttles.yml | 11 - Resources/Prototypes/Hydroponics/seeds.yml | 38 - Resources/Prototypes/Maps/omega.yml | 1 - Resources/Prototypes/NPCs/mob.yml | 3 - .../Prototypes/Objectives/objectiveGroups.yml | 1 - .../Objectives/stealTargetGroups.yml | 7 - Resources/Prototypes/Objectives/thief.yml | 9 - .../Reagents/Consumable/Drink/alcohol.yml | 2 + .../Construction/Graphs/machines/computer.yml | 6 +- .../Graphs/weapons/improvised_arrow.yml | 3 + .../Recipes/Construction/weapons.yml | 16 - .../Recipes/Cooking/food_sequence_element.yml | 17 - .../Graphs/improvised/rolling_pin.yml | 15 - .../Crafting/Graphs/storage/cratefreezer.yml | 42 - .../Crafting/Graphs/storage/tallbox.yml | 3 + .../Prototypes/Recipes/Crafting/crates.yml | 8 - .../Recipes/Crafting/improvised.yml | 8 - .../Prototypes/Recipes/Crafting/tallbox.yml | 3 + .../Prototypes/Recipes/Lathes/electronics.yml | 5 - .../Prototypes/Recipes/Reactions/drinks.yml | 24 - .../Roles/Jobs/Cargo/quartermaster.yml | 2 + .../Prototypes/Roles/Jobs/Command/captain.yml | 2 + .../Roles/Jobs/Command/head_of_personnel.yml | 2 + .../Roles/Jobs/Engineering/chief_engineer.yml | 2 + .../Jobs/Medical/chief_medical_officer.yml | 2 + .../Roles/Jobs/Science/research_director.yml | 2 + .../Roles/Jobs/Security/head_of_security.yml | 2 + .../Roles/Jobs/Wildcards/psychologist.yml | 6 +- .../Shuttles/shuttle_incoming_event.yml | 5 - Resources/Prototypes/Wires/layouts.yml | 35 +- Resources/Prototypes/tags.yml | 3 - .../Hats/holyhatmelon.rsi/equipped-HELMET.png | Bin 593 -> 0 bytes .../Head/Hats/holyhatmelon.rsi/icon.png | Bin 334 -> 0 bytes .../Hats/holyhatmelon.rsi/inhand-left.png | Bin 491 -> 0 bytes .../Hats/holyhatmelon.rsi/inhand-right.png | Bin 502 -> 0 bytes .../Head/Hats/holyhatmelon.rsi/meta.json | 52 - .../Head/Helmets/bone_helmet.rsi/meta.json | 2 +- .../Textures/Decals/burnt.rsi/burnt1.png | Bin 896 -> 0 bytes .../Textures/Decals/burnt.rsi/burnt2.png | Bin 938 -> 0 bytes .../Textures/Decals/burnt.rsi/burnt3.png | Bin 928 -> 0 bytes .../Textures/Decals/burnt.rsi/burnt4.png | Bin 1041 -> 0 bytes Resources/Textures/Decals/burnt.rsi/meta.json | 27 - .../Misc/health_analyzer_out_of_range.png | Bin 224 -> 0 bytes .../Devices/cartridge.rsi/cart-nav.png | Bin 300 -> 0 bytes .../Devices/cartridge.rsi/cart-sec.png | Bin 314 -> 0 bytes .../Objects/Devices/cartridge.rsi/meta.json | 8 +- .../Objects/Misc/bureaucracy.rsi/meta.json | 5 +- .../paper_stamp-psychologist.png | Bin 188 -> 0 bytes .../Objects/Misc/stamps.rsi/meta.json | 5 +- .../Misc/stamps.rsi/stamp-psychologist.png | Bin 308 -> 0 bytes .../Hydroponics/anomaly_berry.rsi/dead.png | Bin 570 -> 0 bytes .../Hydroponics/anomaly_berry.rsi/harvest.png | Bin 589 -> 0 bytes .../Hydroponics/anomaly_berry.rsi/meta.json | 29 - .../Hydroponics/anomaly_berry.rsi/produce.png | Bin 548 -> 0 bytes .../Hydroponics/anomaly_berry.rsi/seed.png | Bin 403 -> 0 bytes .../Hydroponics/anomaly_berry.rsi/stage-1.png | Bin 389 -> 0 bytes .../Hydroponics/anomaly_berry.rsi/stage-2.png | Bin 491 -> 0 bytes .../Guns/LMGs/l6.rsi/equipped-SUITSTORAGE.png | Bin 1165 -> 0 bytes .../Weapons/Guns/LMGs/l6.rsi/meta.json | 4 - .../computers.rsi/generic_panel_open.png | Bin 405 -> 0 bytes .../Machines/computers.rsi/meta.json | 6 +- .../Storage/closet.rsi/freezer_icon.png | Bin 444 -> 0 bytes .../Structures/Storage/closet.rsi/meta.json | 3 - Resources/migration.yml | 3 - 275 files changed, 36527 insertions(+), 53931 deletions(-) delete mode 100644 Content.Client/CartridgeLoader/Cartridges/WantedListUi.cs delete mode 100644 Content.Client/CartridgeLoader/Cartridges/WantedListUiFragment.cs delete mode 100644 Content.Client/CartridgeLoader/Cartridges/WantedListUiFragment.xaml create mode 100644 Content.Client/GPS/Components/HandheldGPSComponent.cs delete mode 100644 Content.Client/Pinpointer/UI/StationMapBeaconControl.xaml delete mode 100644 Content.Client/Pinpointer/UI/StationMapBeaconControl.xaml.cs delete mode 100644 Content.Client/Voting/VotingSystem.cs delete mode 100644 Content.IntegrationTests/Tests/Buckle/BuckleTest.Interact.cs delete mode 100644 Content.Server/CartridgeLoader/Cartridges/AstroNavCartridgeComponent.cs delete mode 100644 Content.Server/CartridgeLoader/Cartridges/AstroNavCartridgeSystem.cs delete mode 100644 Content.Server/CartridgeLoader/Cartridges/WantedListCartridge.cs rename {Content.Shared => Content.Server}/Explosion/Components/ExplosiveComponent.cs (76%) delete mode 100644 Content.Server/Speech/Components/VoiceOverrideComponent.cs delete mode 100644 Content.Server/Speech/EntitySystems/VoiceOverrideSystem.cs create mode 100644 Content.Server/VoiceMask/VoiceMaskSystem.Equip.cs create mode 100644 Content.Server/VoiceMask/VoiceMaskerComponent.cs delete mode 100644 Content.Server/Voting/VotingSystem.cs delete mode 100644 Content.Shared/Atmos/Piping/Unary/VentScrewedDoAfterEvent.cs delete mode 100644 Content.Shared/CartridgeLoader/Cartridges/WantedListUiState.cs delete mode 100644 Content.Shared/Chat/SharedChatEvents.cs delete mode 100644 Content.Shared/GPS/Components/HandheldGPSComponent.cs create mode 100644 Content.Shared/Tools/Components/SharedHandheldGPSComponent.cs delete mode 100644 Content.Shared/Voting/VotingEvents.cs delete mode 100644 Resources/Maps/Shuttles/ShuttleEvent/instigator.yml delete mode 100644 Resources/Prototypes/Decals/burnt.yml delete mode 100644 Resources/Prototypes/Entities/Objects/Devices/Electronics/misc.yml delete mode 100644 Resources/Prototypes/Recipes/Crafting/Graphs/improvised/rolling_pin.yml delete mode 100644 Resources/Prototypes/Recipes/Crafting/Graphs/storage/cratefreezer.yml delete mode 100644 Resources/Textures/Clothing/Head/Hats/holyhatmelon.rsi/equipped-HELMET.png delete mode 100644 Resources/Textures/Clothing/Head/Hats/holyhatmelon.rsi/icon.png delete mode 100644 Resources/Textures/Clothing/Head/Hats/holyhatmelon.rsi/inhand-left.png delete mode 100644 Resources/Textures/Clothing/Head/Hats/holyhatmelon.rsi/inhand-right.png delete mode 100644 Resources/Textures/Clothing/Head/Hats/holyhatmelon.rsi/meta.json delete mode 100644 Resources/Textures/Decals/burnt.rsi/burnt1.png delete mode 100644 Resources/Textures/Decals/burnt.rsi/burnt2.png delete mode 100644 Resources/Textures/Decals/burnt.rsi/burnt3.png delete mode 100644 Resources/Textures/Decals/burnt.rsi/burnt4.png delete mode 100644 Resources/Textures/Decals/burnt.rsi/meta.json delete mode 100644 Resources/Textures/Interface/Misc/health_analyzer_out_of_range.png delete mode 100644 Resources/Textures/Objects/Devices/cartridge.rsi/cart-nav.png delete mode 100644 Resources/Textures/Objects/Devices/cartridge.rsi/cart-sec.png delete mode 100644 Resources/Textures/Objects/Misc/bureaucracy.rsi/paper_stamp-psychologist.png delete mode 100644 Resources/Textures/Objects/Misc/stamps.rsi/stamp-psychologist.png delete mode 100644 Resources/Textures/Objects/Specific/Hydroponics/anomaly_berry.rsi/dead.png delete mode 100644 Resources/Textures/Objects/Specific/Hydroponics/anomaly_berry.rsi/harvest.png delete mode 100644 Resources/Textures/Objects/Specific/Hydroponics/anomaly_berry.rsi/meta.json delete mode 100644 Resources/Textures/Objects/Specific/Hydroponics/anomaly_berry.rsi/produce.png delete mode 100644 Resources/Textures/Objects/Specific/Hydroponics/anomaly_berry.rsi/seed.png delete mode 100644 Resources/Textures/Objects/Specific/Hydroponics/anomaly_berry.rsi/stage-1.png delete mode 100644 Resources/Textures/Objects/Specific/Hydroponics/anomaly_berry.rsi/stage-2.png delete mode 100644 Resources/Textures/Objects/Weapons/Guns/LMGs/l6.rsi/equipped-SUITSTORAGE.png delete mode 100644 Resources/Textures/Structures/Machines/computers.rsi/generic_panel_open.png delete mode 100644 Resources/Textures/Structures/Storage/closet.rsi/freezer_icon.png diff --git a/.vscode/launch.json b/.vscode/launch.json index 1d339fc7a1c616..5390b9140938db 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -52,4 +52,4 @@ "preLaunchTask": "build" } ] -} +} \ No newline at end of file diff --git a/Content.Client/Actions/ActionsSystem.cs b/Content.Client/Actions/ActionsSystem.cs index 7b13233bab5cd5..26a22fa8b8df37 100644 --- a/Content.Client/Actions/ActionsSystem.cs +++ b/Content.Client/Actions/ActionsSystem.cs @@ -51,29 +51,6 @@ public override void Initialize() SubscribeLocalEvent(OnEntityWorldTargetHandleState); } - public override void FrameUpdate(float frameTime) - { - base.FrameUpdate(frameTime); - - var worldActionQuery = EntityQueryEnumerator(); - while (worldActionQuery.MoveNext(out var uid, out var action)) - { - UpdateAction(uid, action); - } - - var instantActionQuery = EntityQueryEnumerator(); - while (instantActionQuery.MoveNext(out var uid, out var action)) - { - UpdateAction(uid, action); - } - - var entityActionQuery = EntityQueryEnumerator(); - while (entityActionQuery.MoveNext(out var uid, out var action)) - { - UpdateAction(uid, action); - } - } - private void OnInstantHandleState(EntityUid uid, InstantActionComponent component, ref ComponentHandleState args) { if (args.Current is not InstantActionComponentState state) @@ -118,8 +95,6 @@ private void BaseHandleState(EntityUid uid, BaseActionComponent component, Ba component.Icon = state.Icon; component.IconOn = state.IconOn; component.IconColor = state.IconColor; - component.OriginalIconColor = state.OriginalIconColor; - component.DisabledIconColor = state.DisabledIconColor; component.Keywords.Clear(); component.Keywords.UnionWith(state.Keywords); component.Enabled = state.Enabled; @@ -150,8 +125,6 @@ public override void UpdateAction(EntityUid? actionId, BaseActionComponent? acti if (!ResolveActionData(actionId, ref action)) return; - action.IconColor = action.Charges < 1 ? action.DisabledIconColor : action.OriginalIconColor; - base.UpdateAction(actionId, action); if (_playerManager.LocalEntity != action.AttachedEntity) return; diff --git a/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml.cs b/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml.cs index a7c7824e77adfc..7cb32b43df59f3 100644 --- a/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml.cs +++ b/Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml.cs @@ -1,12 +1,14 @@ -using System.Linq; using System.Numerics; -using Content.Shared.Preferences.Loadouts; +using Content.Client.UserInterface.Controls; using Content.Shared.Roles; using Robust.Client.AutoGenerated; using Robust.Client.Console; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; +using Robust.Shared.Localization; using Robust.Shared.Prototypes; namespace Content.Client.Administration.UI.SetOutfit @@ -63,18 +65,9 @@ private void SearchBarOnOnTextChanged(LineEdit.LineEditEventArgs obj) PopulateByFilter(SearchBar.Text); } - private IEnumerable GetPrototypes() - { - // Filter out any StartingGearPrototypes that belong to loadouts - var loadouts = _prototypeManager.EnumeratePrototypes(); - var loadoutGears = loadouts.Select(l => l.StartingGear); - return _prototypeManager.EnumeratePrototypes() - .Where(p => !loadoutGears.Contains(p.ID)); - } - private void PopulateList() { - foreach (var gear in GetPrototypes()) + foreach (var gear in _prototypeManager.EnumeratePrototypes()) { OutfitList.Add(GetItem(gear, OutfitList)); } @@ -83,7 +76,7 @@ private void PopulateList() private void PopulateByFilter(string filter) { OutfitList.Clear(); - foreach (var gear in GetPrototypes()) + foreach (var gear in _prototypeManager.EnumeratePrototypes()) { if (!string.IsNullOrEmpty(filter) && gear.ID.ToLowerInvariant().Contains(filter.Trim().ToLowerInvariant())) diff --git a/Content.Client/Buckle/BuckleSystem.cs b/Content.Client/Buckle/BuckleSystem.cs index 7a6ec2e4960856..6770899e0aa293 100644 --- a/Content.Client/Buckle/BuckleSystem.cs +++ b/Content.Client/Buckle/BuckleSystem.cs @@ -3,6 +3,7 @@ using Content.Shared.Buckle.Components; using Content.Shared.Rotation; using Robust.Client.GameObjects; +using Robust.Shared.GameStates; namespace Content.Client.Buckle; @@ -14,6 +15,7 @@ public override void Initialize() { base.Initialize(); + SubscribeLocalEvent(OnHandleState); SubscribeLocalEvent(OnAppearanceChange); SubscribeLocalEvent(OnStrapMoveEvent); } @@ -55,6 +57,21 @@ private void OnStrapMoveEvent(EntityUid uid, StrapComponent component, ref MoveE } } + private void OnHandleState(Entity ent, ref ComponentHandleState args) + { + if (args.Current is not BuckleState state) + return; + + ent.Comp.DontCollide = state.DontCollide; + ent.Comp.BuckleTime = state.BuckleTime; + var strapUid = EnsureEntity(state.BuckledTo, ent); + + SetBuckledTo(ent, strapUid == null ? null : new (strapUid.Value, null)); + + var (uid, component) = ent; + + } + private void OnAppearanceChange(EntityUid uid, BuckleComponent component, ref AppearanceChangeEvent args) { if (!TryComp(uid, out var rotVisuals)) diff --git a/Content.Client/CartridgeLoader/Cartridges/WantedListUi.cs b/Content.Client/CartridgeLoader/Cartridges/WantedListUi.cs deleted file mode 100644 index 3c97b8b37d1545..00000000000000 --- a/Content.Client/CartridgeLoader/Cartridges/WantedListUi.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Content.Client.UserInterface.Fragments; -using Content.Shared.CartridgeLoader.Cartridges; -using Robust.Client.UserInterface; - -namespace Content.Client.CartridgeLoader.Cartridges; - -public sealed partial class WantedListUi : UIFragment -{ - private WantedListUiFragment? _fragment; - - public override Control GetUIFragmentRoot() - { - return _fragment!; - } - - public override void Setup(BoundUserInterface userInterface, EntityUid? fragmentOwner) - { - _fragment = new WantedListUiFragment(); - } - - public override void UpdateState(BoundUserInterfaceState state) - { - switch (state) - { - case WantedListUiState cast: - _fragment?.UpdateState(cast.Records); - break; - } - } -} diff --git a/Content.Client/CartridgeLoader/Cartridges/WantedListUiFragment.cs b/Content.Client/CartridgeLoader/Cartridges/WantedListUiFragment.cs deleted file mode 100644 index c6064102f6ef73..00000000000000 --- a/Content.Client/CartridgeLoader/Cartridges/WantedListUiFragment.cs +++ /dev/null @@ -1,237 +0,0 @@ -using System.Linq; -using Content.Client.UserInterface.Controls; -using Content.Shared.CriminalRecords.Systems; -using Content.Shared.Security; -using Content.Shared.StatusIcon; -using Robust.Client.AutoGenerated; -using Robust.Client.GameObjects; -using Robust.Client.UserInterface.Controls; -using Robust.Client.UserInterface.XAML; -using Robust.Shared.Input; -using Robust.Shared.Prototypes; -using Robust.Shared.Utility; - -namespace Content.Client.CartridgeLoader.Cartridges; - -[GenerateTypedNameReferences] -public sealed partial class WantedListUiFragment : BoxContainer -{ - [Dependency] private readonly IEntitySystemManager _entitySystem = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - private readonly SpriteSystem _spriteSystem; - - private string? _selectedTargetName; - private List _wantedRecords = new(); - - public WantedListUiFragment() - { - RobustXamlLoader.Load(this); - IoCManager.InjectDependencies(this); - _spriteSystem = _entitySystem.GetEntitySystem(); - - SearchBar.OnTextChanged += OnSearchBarTextChanged; - } - - private void OnSearchBarTextChanged(LineEdit.LineEditEventArgs args) - { - var found = !String.IsNullOrWhiteSpace(args.Text) - ? _wantedRecords.FindAll(r => - r.TargetInfo.Name.Contains(args.Text) || - r.Status.ToString().Contains(args.Text, StringComparison.OrdinalIgnoreCase)) - : _wantedRecords; - - UpdateState(found, false); - } - - public void UpdateState(List records, bool refresh = true) - { - if (records.Count == 0) - { - NoRecords.Visible = true; - RecordsList.Visible = false; - RecordUnselected.Visible = false; - PersonContainer.Visible = false; - - _selectedTargetName = null; - if (refresh) - _wantedRecords.Clear(); - - RecordsList.PopulateList(new List()); - - return; - } - - NoRecords.Visible = false; - RecordsList.Visible = true; - RecordUnselected.Visible = true; - PersonContainer.Visible = false; - - var dataList = records.Select(r => new StatusListData(r)).ToList(); - - RecordsList.GenerateItem = GenerateItem; - RecordsList.ItemPressed = OnItemSelected; - RecordsList.PopulateList(dataList); - - if (refresh) - _wantedRecords = records; - } - - private void OnItemSelected(BaseButton.ButtonEventArgs args, ListData data) - { - if (data is not StatusListData(var record)) - return; - - FormattedMessage GetLoc(string fluentId, params (string,object)[] args) - { - var msg = new FormattedMessage(); - var fluent = Loc.GetString(fluentId, args); - msg.AddMarkupPermissive(fluent); - return msg; - } - - // Set personal info - PersonName.Text = record.TargetInfo.Name; - TargetAge.SetMessage(GetLoc( - "wanted-list-age-label", - ("age", record.TargetInfo.Age) - )); - TargetJob.SetMessage(GetLoc( - "wanted-list-job-label", - ("job", record.TargetInfo.JobTitle.ToLower()) - )); - TargetSpecies.SetMessage(GetLoc( - "wanted-list-species-label", - ("species", record.TargetInfo.Species.ToLower()) - )); - TargetGender.SetMessage(GetLoc( - "wanted-list-gender-label", - ("gender", record.TargetInfo.Gender) - )); - - // Set reason - WantedReason.SetMessage(GetLoc( - "wanted-list-reason-label", - ("reason", record.Reason ?? Loc.GetString("wanted-list-unknown-reason-label")) - )); - - // Set status - PersonState.SetMessage(GetLoc( - "wanted-list-status-label", - ("status", record.Status.ToString().ToLower()) - )); - - // Set initiator - InitiatorName.SetMessage(GetLoc( - "wanted-list-initiator-label", - ("initiator", record.Initiator ?? Loc.GetString("wanted-list-unknown-initiator-label")) - )); - - // History table - // Clear table if it exists - HistoryTable.RemoveAllChildren(); - - HistoryTable.AddChild(new Label() - { - Text = Loc.GetString("wanted-list-history-table-time-col"), - StyleClasses = { "LabelSmall" }, - HorizontalAlignment = HAlignment.Center, - }); - HistoryTable.AddChild(new Label() - { - Text = Loc.GetString("wanted-list-history-table-reason-col"), - StyleClasses = { "LabelSmall" }, - HorizontalAlignment = HAlignment.Center, - HorizontalExpand = true, - }); - - HistoryTable.AddChild(new Label() - { - Text = Loc.GetString("wanted-list-history-table-initiator-col"), - StyleClasses = { "LabelSmall" }, - HorizontalAlignment = HAlignment.Center, - }); - - if (record.History.Count > 0) - { - HistoryTable.Visible = true; - - foreach (var history in record.History.OrderByDescending(h => h.AddTime)) - { - HistoryTable.AddChild(new Label() - { - Text = $"{history.AddTime.Hours:00}:{history.AddTime.Minutes:00}:{history.AddTime.Seconds:00}", - StyleClasses = { "LabelSmall" }, - VerticalAlignment = VAlignment.Top, - }); - - HistoryTable.AddChild(new RichTextLabel() - { - Text = $"[color=white]{history.Crime}[/color]", - HorizontalExpand = true, - VerticalAlignment = VAlignment.Top, - StyleClasses = { "LabelSubText" }, - Margin = new(10f, 0f), - }); - - HistoryTable.AddChild(new RichTextLabel() - { - Text = $"[color=white]{history.InitiatorName}[/color]", - StyleClasses = { "LabelSubText" }, - VerticalAlignment = VAlignment.Top, - }); - } - } - - RecordUnselected.Visible = false; - PersonContainer.Visible = true; - - // Save selected item - _selectedTargetName = record.TargetInfo.Name; - } - - private void GenerateItem(ListData data, ListContainerButton button) - { - if (data is not StatusListData(var record)) - return; - - var box = new BoxContainer() { Orientation = LayoutOrientation.Horizontal, HorizontalExpand = true }; - var label = new Label() { Text = record.TargetInfo.Name }; - var rect = new TextureRect() - { - TextureScale = new(2.2f), - VerticalAlignment = VAlignment.Center, - HorizontalAlignment = HAlignment.Center, - Margin = new(0f, 0f, 6f, 0f), - }; - - if (record.Status is not SecurityStatus.None) - { - var proto = "SecurityIcon" + record.Status switch - { - SecurityStatus.Detained => "Incarcerated", - _ => record.Status.ToString(), - }; - - if (_prototypeManager.TryIndex(proto, out var prototype)) - { - rect.Texture = _spriteSystem.Frame0(prototype.Icon); - } - } - - box.AddChild(rect); - box.AddChild(label); - button.AddChild(box); - button.AddStyleClass(ListContainer.StyleClassListContainerButton); - - if (record.TargetInfo.Name.Equals(_selectedTargetName)) - { - button.Pressed = true; - // For some reason the event is not called when `Pressed` changed, call it manually. - OnItemSelected( - new(button, new(new(), BoundKeyState.Down, new(), false, new(), new())), - data); - } - } -} - -internal record StatusListData(WantedRecord Record) : ListData; diff --git a/Content.Client/CartridgeLoader/Cartridges/WantedListUiFragment.xaml b/Content.Client/CartridgeLoader/Cartridges/WantedListUiFragment.xaml deleted file mode 100644 index 7b5d116ad74b8e..00000000000000 --- a/Content.Client/CartridgeLoader/Cartridges/WantedListUiFragment.xaml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - diff --git a/Content.Client/Explosion/ExplosionSystem.cs b/Content.Client/Explosion/ExplosionSystem.cs index 692782ded4b77b..a2ed2d50e0d1ef 100644 --- a/Content.Client/Explosion/ExplosionSystem.cs +++ b/Content.Client/Explosion/ExplosionSystem.cs @@ -2,4 +2,7 @@ namespace Content.Client.Explosion.EntitySystems; -public sealed class ExplosionSystem : SharedExplosionSystem; +public sealed class ExplosionSystem : SharedExplosionSystem +{ + +} diff --git a/Content.Client/Flash/FlashOverlay.cs b/Content.Client/Flash/FlashOverlay.cs index 8e41c382dd7e7c..046be2aa62142c 100644 --- a/Content.Client/Flash/FlashOverlay.cs +++ b/Content.Client/Flash/FlashOverlay.cs @@ -16,7 +16,6 @@ public sealed class FlashOverlay : Overlay [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IGameTiming _timing = default!; - private readonly SharedFlashSystem _flash; private readonly StatusEffectsSystem _statusSys; public override OverlaySpace Space => OverlaySpace.WorldSpace; @@ -28,7 +27,6 @@ public FlashOverlay() { IoCManager.InjectDependencies(this); _shader = _prototypeManager.Index("FlashedEffect").InstanceUnique(); - _flash = _entityManager.System(); _statusSys = _entityManager.System(); } @@ -43,7 +41,7 @@ protected override void FrameUpdate(FrameEventArgs args) || !_entityManager.TryGetComponent(playerEntity, out var status)) return; - if (!_statusSys.TryGetTime(playerEntity.Value, _flash.FlashedKey, out var time, status)) + if (!_statusSys.TryGetTime(playerEntity.Value, SharedFlashSystem.FlashedKey, out var time, status)) return; var curTime = _timing.CurTime; diff --git a/Content.Client/GPS/Components/HandheldGPSComponent.cs b/Content.Client/GPS/Components/HandheldGPSComponent.cs new file mode 100644 index 00000000000000..0f5271fd80c45b --- /dev/null +++ b/Content.Client/GPS/Components/HandheldGPSComponent.cs @@ -0,0 +1,9 @@ +using Content.Shared.GPS; + +namespace Content.Client.GPS.Components +{ + [RegisterComponent] + public sealed partial class HandheldGPSComponent : SharedHandheldGPSComponent + { + } +} diff --git a/Content.Client/GPS/Systems/HandheldGpsSystem.cs b/Content.Client/GPS/Systems/HandheldGpsSystem.cs index 69e488c1c71ff4..cc2b888da37f3d 100644 --- a/Content.Client/GPS/Systems/HandheldGpsSystem.cs +++ b/Content.Client/GPS/Systems/HandheldGpsSystem.cs @@ -1,6 +1,6 @@ +using Content.Client.GPS.Components; using Content.Client.GPS.UI; using Content.Client.Items; -using Content.Shared.GPS.Components; namespace Content.Client.GPS.Systems; diff --git a/Content.Client/GPS/UI/HandheldGpsStatusControl.cs b/Content.Client/GPS/UI/HandheldGpsStatusControl.cs index 653ee422274249..7dcf3f29c5197e 100644 --- a/Content.Client/GPS/UI/HandheldGpsStatusControl.cs +++ b/Content.Client/GPS/UI/HandheldGpsStatusControl.cs @@ -1,6 +1,6 @@ +using Content.Client.GPS.Components; using Content.Client.Message; using Content.Client.Stylesheets; -using Content.Shared.GPS.Components; using Robust.Client.GameObjects; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; @@ -30,13 +30,6 @@ protected override void FrameUpdate(FrameEventArgs args) { base.FrameUpdate(args); - // don't display the label if the gps component is being removed - if (_parent.Comp.LifeStage > ComponentLifeStage.Running) - { - _label.Visible = false; - return; - } - _updateDif += args.DeltaSeconds; if (_updateDif < _parent.Comp.UpdateRate) return; @@ -51,9 +44,9 @@ private void UpdateGpsDetails() var posText = "Error"; if (_entMan.TryGetComponent(_parent, out TransformComponent? transComp)) { - var pos = _transform.GetMapCoordinates(_parent.Owner, xform: transComp); - var x = (int)pos.X; - var y = (int)pos.Y; + var pos = _transform.GetMapCoordinates(_parent.Owner, xform: transComp); + var x = (int) pos.X; + var y = (int) pos.Y; posText = $"({x}, {y})"; } _label.SetMarkup(Loc.GetString("handheld-gps-coordinates-title", ("coordinates", posText))); diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml index 33c836b67a89cb..97968c4b990b3d 100644 --- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml +++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml @@ -21,7 +21,6 @@ Orientation="Vertical"> - diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs index b06139b7b4d9bc..9b96f5d3fe9284 100644 --- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs +++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs @@ -1,22 +1,28 @@ using System.Linq; using System.Numerics; -using Content.Client.UserInterface.Controls; +using Content.Client.Message; using Content.Shared.Atmos; +using Content.Client.UserInterface.Controls; +using Content.Shared.Alert; using Content.Shared.Damage; using Content.Shared.Damage.Prototypes; using Content.Shared.FixedPoint; using Content.Shared.Humanoid; using Content.Shared.Humanoid.Prototypes; using Content.Shared.IdentityManagement; +using Content.Shared.Inventory; using Content.Shared.MedicalScanner; using Content.Shared.Mobs; using Content.Shared.Mobs.Components; +using Content.Shared.Mobs.Systems; +using Content.Shared.Nutrition.Components; using Robust.Client.AutoGenerated; +using Robust.Client.UserInterface.XAML; using Robust.Client.GameObjects; using Robust.Client.Graphics; -using Robust.Client.ResourceManagement; using Robust.Client.UserInterface.Controls; -using Robust.Client.UserInterface.XAML; +using Robust.Client.ResourceManagement; +using Robust.Client.UserInterface; using Robust.Shared.Prototypes; using Robust.Shared.Utility; @@ -67,8 +73,6 @@ public void Populate(HealthAnalyzerScannedUserMessage msg) // Patient Information SpriteView.SetEntity(target.Value); - SpriteView.Visible = msg.ScanMode.HasValue && msg.ScanMode.Value; - NoDataTex.Visible = !SpriteView.Visible; var name = new FormattedMessage(); name.PushColor(Color.White); diff --git a/Content.Client/Lobby/UI/LobbyGui.xaml b/Content.Client/Lobby/UI/LobbyGui.xaml index 4a158fd811f15e..c3bd0da642a634 100644 --- a/Content.Client/Lobby/UI/LobbyGui.xaml +++ b/Content.Client/Lobby/UI/LobbyGui.xaml @@ -14,7 +14,7 @@ Stretch="KeepAspectCovered" /> - + diff --git a/Content.Client/Mapping/MappingScreen.xaml b/Content.Client/Mapping/MappingScreen.xaml index 9cc3e734f0e9ee..b64136084788ac 100644 --- a/Content.Client/Mapping/MappingScreen.xaml +++ b/Content.Client/Mapping/MappingScreen.xaml @@ -78,7 +78,6 @@ ToolTip="Pick (Hold 5)" /> - diff --git a/Content.Client/Mapping/MappingScreen.xaml.cs b/Content.Client/Mapping/MappingScreen.xaml.cs index 46c0e51fad69b4..b2ad2fd83fbb8d 100644 --- a/Content.Client/Mapping/MappingScreen.xaml.cs +++ b/Content.Client/Mapping/MappingScreen.xaml.cs @@ -96,22 +96,6 @@ public MappingScreen() Pick.Texture.TexturePath = "/Textures/Interface/eyedropper.svg.png"; Delete.Texture.TexturePath = "/Textures/Interface/eraser.svg.png"; - Flip.Texture.TexturePath = "/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png"; - Flip.OnPressed += args => FlipSides(); - } - - public void FlipSides() - { - ScreenContainer.Flip(); - - if (SpawnContainer.GetPositionInParent() == 0) - { - Flip.Texture.TexturePath = "/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png"; - } - else - { - Flip.Texture.TexturePath = "/Textures/Interface/VerbIcons/rotate_ccw.svg.192dpi.png"; - } } private void OnDecalColorPicked(Color color) diff --git a/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml b/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml index dd40749d33b2bd..660f2e5e11f5ed 100644 --- a/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml +++ b/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml @@ -15,9 +15,6 @@ - - departmentSens // Populate departments foreach (var sensor in departmentSensors) { - if (!string.IsNullOrEmpty(SearchLineEdit.Text) - && !sensor.Name.Contains(SearchLineEdit.Text, StringComparison.CurrentCultureIgnoreCase) - && !sensor.Job.Contains(SearchLineEdit.Text, StringComparison.CurrentCultureIgnoreCase)) - continue; - var coordinates = _entManager.GetCoordinates(sensor.Coordinates); // Add a button that will hold a username and other details diff --git a/Content.Client/Paper/UI/PaperBoundUserInterface.cs b/Content.Client/Paper/UI/PaperBoundUserInterface.cs index a38ed83c302e9f..63645bc01e910d 100644 --- a/Content.Client/Paper/UI/PaperBoundUserInterface.cs +++ b/Content.Client/Paper/UI/PaperBoundUserInterface.cs @@ -1,4 +1,3 @@ -using Content.Shared.Paper; using JetBrains.Annotations; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; @@ -24,10 +23,6 @@ protected override void Open() _window = this.CreateWindow(); _window.OnSaved += InputOnTextEntered; - if (EntMan.TryGetComponent(Owner, out var paper)) - { - _window.MaxInputLength = paper.ContentSize; - } if (EntMan.TryGetComponent(Owner, out var visuals)) { _window.InitVisuals(Owner, visuals); diff --git a/Content.Client/Paper/UI/PaperWindow.xaml b/Content.Client/Paper/UI/PaperWindow.xaml index 503ae928a3ed14..2344afd5ef708b 100644 --- a/Content.Client/Paper/UI/PaperWindow.xaml +++ b/Content.Client/Paper/UI/PaperWindow.xaml @@ -15,13 +15,10 @@ - - - - - + + + diff --git a/Content.Client/Paper/UI/PaperWindow.xaml.cs b/Content.Client/Paper/UI/PaperWindow.xaml.cs index 4d7cb5d7bcd156..81b831068c3929 100644 --- a/Content.Client/Paper/UI/PaperWindow.xaml.cs +++ b/Content.Client/Paper/UI/PaperWindow.xaml.cs @@ -4,12 +4,12 @@ using Robust.Client.Graphics; using Robust.Client.Input; using Robust.Client.ResourceManagement; -using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; -using Robust.Client.UserInterface.RichText; +using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; -using Robust.Shared.Input; using Robust.Shared.Utility; +using Robust.Client.UserInterface.RichText; +using Robust.Shared.Input; namespace Content.Client.Paper.UI { @@ -48,20 +48,6 @@ public sealed partial class PaperWindow : BaseWindow public event Action? OnSaved; - private int _MaxInputLength = -1; - public int MaxInputLength - { - get - { - return _MaxInputLength; - } - set - { - _MaxInputLength = value; - UpdateFillState(); - } - } - public PaperWindow() { IoCManager.InjectDependencies(this); @@ -77,21 +63,11 @@ public PaperWindow() { if (args.Function == EngineKeyFunctions.MultilineTextSubmit) { - // SaveButton is disabled when we hit the max input limit. Just check - // that flag instead of trying to calculate the input length again - if (!SaveButton.Disabled) - { - RunOnSaved(); - args.Handle(); - } + RunOnSaved(); + args.Handle(); } }; - Input.OnTextChanged += args => - { - UpdateFillState(); - }; - SaveButton.OnPressed += _ => { RunOnSaved(); @@ -150,7 +126,6 @@ public void InitVisuals(EntityUid entity, PaperVisualsComponent visuals) PaperContent.ModulateSelfOverride = visuals.ContentImageModulate; WrittenTextLabel.ModulateSelfOverride = visuals.FontAccentColor; - FillStatus.ModulateSelfOverride = visuals.FontAccentColor; var contentImage = visuals.ContentImagePath != null ? _resCache.GetResource(visuals.ContentImagePath) : null; if (contentImage != null) @@ -321,25 +296,5 @@ private void RunOnSaved() { OnSaved?.Invoke(Rope.Collapse(Input.TextRope)); } - - private void UpdateFillState() - { - if (MaxInputLength != -1) - { - var inputLength = Input.TextLength; - - FillStatus.Text = Loc.GetString("paper-ui-fill-level", - ("currentLength", inputLength), - ("maxLength", MaxInputLength)); - - // Disable the save button if we've gone over the limit - SaveButton.Disabled = inputLength > MaxInputLength; - } - else - { - FillStatus.Text = ""; - SaveButton.Disabled = false; - } - } } } diff --git a/Content.Client/Pinpointer/UI/StationMapBeaconControl.xaml b/Content.Client/Pinpointer/UI/StationMapBeaconControl.xaml deleted file mode 100644 index e1c55131cd6b25..00000000000000 --- a/Content.Client/Pinpointer/UI/StationMapBeaconControl.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - diff --git a/Content.Client/Pinpointer/UI/StationMapBeaconControl.xaml.cs b/Content.Client/Pinpointer/UI/StationMapBeaconControl.xaml.cs deleted file mode 100644 index a4d4055c7dfe1b..00000000000000 --- a/Content.Client/Pinpointer/UI/StationMapBeaconControl.xaml.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Content.Shared.Pinpointer; -using Robust.Client.AutoGenerated; -using Robust.Client.Graphics; -using Robust.Client.UserInterface; -using Robust.Client.UserInterface.XAML; -using Robust.Shared.Map; - -namespace Content.Client.Pinpointer.UI; - -[GenerateTypedNameReferences] -public sealed partial class StationMapBeaconControl : Control, IComparable -{ - [Dependency] private readonly IEntityManager _entMan = default!; - - public readonly EntityCoordinates BeaconPosition; - public Action? OnPressed; - public string? Label => BeaconNameLabel.Text; - private StyleBoxFlat _styleBox; - public Color Color => _styleBox.BackgroundColor; - - public StationMapBeaconControl(EntityUid mapUid, SharedNavMapSystem.NavMapBeacon beacon) - { - RobustXamlLoader.Load(this); - IoCManager.InjectDependencies(this); - - BeaconPosition = new EntityCoordinates(mapUid, beacon.Position); - - _styleBox = new StyleBoxFlat { BackgroundColor = beacon.Color }; - ColorPanel.PanelOverride = _styleBox; - BeaconNameLabel.Text = beacon.Text; - - MainButton.OnPressed += args => OnPressed?.Invoke(BeaconPosition); - } - - public int CompareTo(StationMapBeaconControl? other) - { - if (other == null) - return 1; - - // Group by color - var colorCompare = Color.ToArgb().CompareTo(other.Color.ToArgb()); - if (colorCompare != 0) - { - return colorCompare; - } - - // If same color, sort by text - return string.Compare(Label, other.Label); - } -} diff --git a/Content.Client/Pinpointer/UI/StationMapBoundUserInterface.cs b/Content.Client/Pinpointer/UI/StationMapBoundUserInterface.cs index 3d1eb1723c31ec..91fb4ef71bd6c9 100644 --- a/Content.Client/Pinpointer/UI/StationMapBoundUserInterface.cs +++ b/Content.Client/Pinpointer/UI/StationMapBoundUserInterface.cs @@ -24,16 +24,9 @@ protected override void Open() _window = this.CreateWindow(); _window.Title = EntMan.GetComponent(Owner).EntityName; - - string stationName = string.Empty; - if(EntMan.TryGetComponent(gridUid, out var gridMetaData)) - { - stationName = gridMetaData.EntityName; - } - if (EntMan.TryGetComponent(Owner, out var comp) && comp.ShowLocation) - _window.Set(stationName, gridUid, Owner); + _window.Set(gridUid, Owner); else - _window.Set(stationName, gridUid, null); + _window.Set(gridUid, null); } } diff --git a/Content.Client/Pinpointer/UI/StationMapWindow.xaml b/Content.Client/Pinpointer/UI/StationMapWindow.xaml index c79fc8f9e7b8d0..00424a3566aa42 100644 --- a/Content.Client/Pinpointer/UI/StationMapWindow.xaml +++ b/Content.Client/Pinpointer/UI/StationMapWindow.xaml @@ -3,28 +3,11 @@ xmlns:ui="clr-namespace:Content.Client.Pinpointer.UI" Title="{Loc 'station-map-window-title'}" Resizable="False" - SetSize="868 748" - MinSize="868 748"> + SetSize="668 713" + MinSize="668 713"> - - - - - - - + - - - - - - - - - - diff --git a/Content.Client/Pinpointer/UI/StationMapWindow.xaml.cs b/Content.Client/Pinpointer/UI/StationMapWindow.xaml.cs index f652dc80b0e403..7cbb8b7d0dbc22 100644 --- a/Content.Client/Pinpointer/UI/StationMapWindow.xaml.cs +++ b/Content.Client/Pinpointer/UI/StationMapWindow.xaml.cs @@ -1,6 +1,5 @@ using System.Numerics; using Content.Client.UserInterface.Controls; -using Content.Shared.Pinpointer; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.XAML; using Robust.Shared.Map; @@ -10,68 +9,18 @@ namespace Content.Client.Pinpointer.UI; [GenerateTypedNameReferences] public sealed partial class StationMapWindow : FancyWindow { - [Dependency] private readonly IEntityManager _entMan = default!; - - private readonly List _buttons = new(); - public StationMapWindow() { RobustXamlLoader.Load(this); - IoCManager.InjectDependencies(this); - - FilterBar.OnTextChanged += (bar) => OnFilterChanged(bar.Text); } - public void Set(string stationName, EntityUid? mapUid, EntityUid? trackedEntity) + public void Set(EntityUid? mapUid, EntityUid? trackedEntity) { NavMapScreen.MapUid = mapUid; if (trackedEntity != null) NavMapScreen.TrackedCoordinates.Add(new EntityCoordinates(trackedEntity.Value, Vector2.Zero), (true, Color.Cyan)); - if (!string.IsNullOrEmpty(stationName)) - { - StationName.Text = stationName; - } - NavMapScreen.ForceNavMapUpdate(); - UpdateBeaconList(mapUid); - } - - public void OnFilterChanged(string newFilter) - { - foreach (var button in _buttons) - { - button.Visible = string.IsNullOrEmpty(newFilter) || ( - !string.IsNullOrEmpty(button.Label) && - button.Label.Contains(newFilter, StringComparison.OrdinalIgnoreCase) - ); - }; - } - - public void UpdateBeaconList(EntityUid? mapUid) - { - BeaconButtons.Children.Clear(); - _buttons.Clear(); - - if (!mapUid.HasValue) - return; - - if (!_entMan.TryGetComponent(mapUid, out var navMap)) - return; - - foreach (var beacon in navMap.Beacons.Values) - { - var button = new StationMapBeaconControl(mapUid.Value, beacon); - - button.OnPressed += NavMapScreen.CenterToCoordinates; - - _buttons.Add(button); - } - - _buttons.Sort(); - - foreach (var button in _buttons) - BeaconButtons.AddChild(button); } -} \ No newline at end of file +} diff --git a/Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs b/Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs index 2d3557d81ee89c..64ead32586d27e 100644 --- a/Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs +++ b/Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs @@ -7,11 +7,13 @@ using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.XAML; +using Robust.Shared.Collections; using Robust.Shared.Input; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; +using Robust.Shared.Utility; namespace Content.Client.Shuttles.UI; @@ -197,9 +199,7 @@ protected override void Draw(DrawingHandleScreen handle) var gridMatrix = _transform.GetWorldMatrix(gUid); var matty = Matrix3x2.Multiply(gridMatrix, ourWorldMatrixInvert); - - var labelColor = _shuttles.GetIFFColor(grid, self: false, iff); - var coordColor = new Color(labelColor.R * 0.8f, labelColor.G * 0.8f, labelColor.B * 0.8f, 0.5f); + var color = _shuttles.GetIFFColor(grid, self: false, iff); // Others default: // Color.FromHex("#FFC000FF") @@ -213,52 +213,25 @@ protected override void Draw(DrawingHandleScreen handle) var gridCentre = Vector2.Transform(gridBody.LocalCenter, matty); gridCentre.Y = -gridCentre.Y; - var distance = gridCentre.Length(); var labelText = Loc.GetString("shuttle-console-iff-label", ("name", labelName), ("distance", $"{distance:0.0}")); - var mapCoords = _transform.GetWorldPosition(gUid); - var coordsText = $"({mapCoords.X:0.0}, {mapCoords.Y:0.0})"; - // yes 1.0 scale is intended here. var labelDimensions = handle.GetDimensions(Font, labelText, 1f); - var coordsDimensions = handle.GetDimensions(Font, coordsText, 0.7f); // y-offset the control to always render below the grid (vertically) var yOffset = Math.Max(gridBounds.Height, gridBounds.Width) * MinimapScale / 1.8f; - // The actual position in the UI. We centre the label by offsetting the matrix position - // by half the label's width, plus the y-offset - var gridScaledPosition = ScalePosition(gridCentre) - new Vector2(0, -yOffset); + // The actual position in the UI. We offset the matrix position to render it off by half its width + // plus by the offset. + var uiPosition = ScalePosition(gridCentre)- new Vector2(labelDimensions.X / 2f, -yOffset); - // Normalize the grid position if it exceeds the viewport bounds - // normalizing it instead of clamping it preserves the direction of the vector and prevents corner-hugging - var gridOffset = gridScaledPosition / PixelSize - new Vector2(0.5f, 0.5f); - var offsetMax = Math.Max(Math.Abs(gridOffset.X), Math.Abs(gridOffset.Y)) * 2f; - if (offsetMax > 1) - { - gridOffset = new Vector2(gridOffset.X / offsetMax, gridOffset.Y / offsetMax); - - gridScaledPosition = (gridOffset + new Vector2(0.5f, 0.5f)) * PixelSize; - } + // Look this is uggo so feel free to cleanup. We just need to clamp the UI position to within the viewport. + uiPosition = new Vector2(Math.Clamp(uiPosition.X, 0f, PixelWidth - labelDimensions.X ), + Math.Clamp(uiPosition.Y, 0f, PixelHeight - labelDimensions.Y)); - var labelUiPosition = gridScaledPosition - new Vector2(labelDimensions.X / 2f, 0); - var coordUiPosition = gridScaledPosition - new Vector2(coordsDimensions.X / 2f, -labelDimensions.Y); - - // clamp the IFF label's UI position to within the viewport extents so it hugs the edges of the viewport - // coord label intentionally isn't clamped so we don't get ugly clutter at the edges - var controlExtents = PixelSize - new Vector2(labelDimensions.X, labelDimensions.Y); //new Vector2(labelDimensions.X * 2f, labelDimensions.Y); - labelUiPosition = Vector2.Clamp(labelUiPosition, Vector2.Zero, controlExtents); - - // draw IFF label - handle.DrawString(Font, labelUiPosition, labelText, labelColor); - - // only draw coords label if close enough - if (offsetMax < 1) - { - handle.DrawString(Font, coordUiPosition, coordsText, 0.7f, coordColor); - } + handle.DrawString(Font, uiPosition, labelText, color); } // Detailed view @@ -268,7 +241,7 @@ protected override void Draw(DrawingHandleScreen handle) if (!gridAABB.Intersects(viewAABB)) continue; - DrawGrid(handle, matty, grid, labelColor); + DrawGrid(handle, matty, grid, color); DrawDocks(handle, gUid, matty); } } diff --git a/Content.Client/Stylesheets/StyleNano.cs b/Content.Client/Stylesheets/StyleNano.cs index 5f3dabd1eb8a40..0bd75003a209fe 100644 --- a/Content.Client/Stylesheets/StyleNano.cs +++ b/Content.Client/Stylesheets/StyleNano.cs @@ -14,6 +14,7 @@ using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; +using Robust.Shared.Graphics; using static Robust.Client.UserInterface.StylesheetHelpers; namespace Content.Client.Stylesheets @@ -694,18 +695,6 @@ public StyleNano(IResourceCache resCache) : base(resCache) new StyleProperty("font-color", Color.FromHex("#E5E5E581")), }), - // ItemStatus for hands - Element() - .Class(StyleClassItemStatusNotHeld) - .Prop("font", notoSansItalic10) - .Prop("font-color", ItemStatusNotHeldColor) - .Prop(nameof(Control.Margin), new Thickness(4, 0, 0, 2)), - - Element() - .Class(StyleClassItemStatus) - .Prop(nameof(RichTextLabel.LineHeightScale), 0.7f) - .Prop(nameof(Control.Margin), new Thickness(4, 0, 0, 2)), - // Context Menu window Element().Class(ContextMenuPopup.StyleClassContextMenuPopup) .Prop(PanelContainer.StylePropertyPanel, contextMenuBackground), diff --git a/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs b/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs index 733dbe326583a8..f50aca581bdf35 100644 --- a/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs +++ b/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs @@ -87,9 +87,6 @@ public DialogWindow(string title, List entries, bool ok = true Prompts.AddChild(box); } - // Grab keyboard focus for the first dialog entry - _promptLines[0].Item2.GrabKeyboardFocus(); - OkButton.OnPressed += _ => Confirm(); CancelButton.OnPressed += _ => diff --git a/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs b/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs index 0705847e76b392..f8313882a2fee0 100644 --- a/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs +++ b/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs @@ -1,9 +1,9 @@ -using System.Linq; using Content.Client.UserInterface.Controls; using Content.Client.VendingMachines.UI; using Content.Shared.VendingMachines; using Robust.Client.UserInterface; using Robust.Shared.Input; +using System.Linq; namespace Content.Client.VendingMachines { @@ -23,17 +23,29 @@ protected override void Open() { base.Open(); + var vendingMachineSys = EntMan.System(); + + _cachedInventory = vendingMachineSys.GetAllInventory(Owner); + _menu = this.CreateWindow(); _menu.OpenCenteredLeft(); _menu.Title = EntMan.GetComponent(Owner).EntityName; + _menu.OnItemSelected += OnItemSelected; - Refresh(); + + _menu.Populate(_cachedInventory); + + _menu.OpenCenteredLeft(); } - public void Refresh() + protected override void UpdateState(BoundUserInterfaceState state) { - var system = EntMan.System(); - _cachedInventory = system.GetAllInventory(Owner); + base.UpdateState(state); + + if (state is not VendingMachineInterfaceState newState) + return; + + _cachedInventory = newState.Inventory; _menu?.Populate(_cachedInventory); } diff --git a/Content.Client/VendingMachines/VendingMachineSystem.cs b/Content.Client/VendingMachines/VendingMachineSystem.cs index 1b1dde2b67ef5b..922a75d24a2686 100644 --- a/Content.Client/VendingMachines/VendingMachineSystem.cs +++ b/Content.Client/VendingMachines/VendingMachineSystem.cs @@ -8,7 +8,6 @@ public sealed class VendingMachineSystem : SharedVendingMachineSystem { [Dependency] private readonly AnimationPlayerSystem _animationPlayer = default!; [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; - [Dependency] private readonly SharedUserInterfaceSystem _uiSystem = default!; public override void Initialize() { @@ -16,15 +15,6 @@ public override void Initialize() SubscribeLocalEvent(OnAppearanceChange); SubscribeLocalEvent(OnAnimationCompleted); - SubscribeLocalEvent(OnVendingAfterState); - } - - private void OnVendingAfterState(EntityUid uid, VendingMachineComponent component, ref AfterAutoHandleStateEvent args) - { - if (_uiSystem.TryGetOpenUi(uid, VendingMachineUiKey.Key, out var bui)) - { - bui.Refresh(); - } } private void OnAnimationCompleted(EntityUid uid, VendingMachineComponent component, AnimationCompletedEvent args) diff --git a/Content.Client/Verbs/VerbSystem.cs b/Content.Client/Verbs/VerbSystem.cs index f592303d281980..f990c83d7c2a9f 100644 --- a/Content.Client/Verbs/VerbSystem.cs +++ b/Content.Client/Verbs/VerbSystem.cs @@ -1,9 +1,9 @@ using System.Diagnostics.CodeAnalysis; +using System.Linq; using System.Numerics; using Content.Client.Examine; using Content.Client.Gameplay; using Content.Client.Popups; -using Content.Shared.CCVar; using Content.Shared.Examine; using Content.Shared.Tag; using Content.Shared.Verbs; @@ -13,8 +13,6 @@ using Robust.Client.Graphics; using Robust.Client.Player; using Robust.Client.State; -using Robust.Shared.Configuration; -using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Utility; @@ -30,11 +28,11 @@ public sealed class VerbSystem : SharedVerbSystem [Dependency] private readonly IStateManager _stateManager = default!; [Dependency] private readonly IEyeManager _eyeManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly SharedContainerSystem _containers = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; - private float _lookupSize; + /// + /// When a user right clicks somewhere, how large is the box we use to get entities for the context menu? + /// + public const float EntityMenuLookupSize = 0.25f; /// /// These flags determine what entities the user can see on the context menu. @@ -43,127 +41,114 @@ public sealed class VerbSystem : SharedVerbSystem public Action? OnVerbsResponse; + private List _entities = new(); + public override void Initialize() { base.Initialize(); SubscribeNetworkEvent(HandleVerbResponse); - Subs.CVar(_cfg, CCVars.GameEntityMenuLookup, OnLookupChanged, true); - } - - private void OnLookupChanged(float val) - { - _lookupSize = val; } /// - /// Get all of the entities in an area for displaying on the context menu. + /// Get all of the entities in an area for displaying on the context menu. /// - /// True if any entities were found. - public bool TryGetEntityMenuEntities(MapCoordinates targetPos, [NotNullWhen(true)] out List? entities) + public bool TryGetEntityMenuEntities(MapCoordinates targetPos, [NotNullWhen(true)] out List? result) { - entities = null; + result = null; - if (_stateManager.CurrentState is not GameplayStateBase) + if (_stateManager.CurrentState is not GameplayStateBase gameScreenBase) return false; - if (_playerManager.LocalEntity is not { } player) + var player = _playerManager.LocalEntity; + if (player == null) return false; // If FOV drawing is disabled, we will modify the visibility option to ignore visiblity checks. - var visibility = _eyeManager.CurrentEye.DrawFov ? Visibility : Visibility | MenuVisibility.NoFov; + var visibility = _eyeManager.CurrentEye.DrawFov + ? Visibility + : Visibility | MenuVisibility.NoFov; - var ev = new MenuVisibilityEvent + var ev = new MenuVisibilityEvent() { TargetPos = targetPos, Visibility = visibility, }; - RaiseLocalEvent(player, ref ev); + RaiseLocalEvent(player.Value, ref ev); visibility = ev.Visibility; - // Initially, we include all entities returned by a sprite area lookup - var box = Box2.CenteredAround(targetPos.Position, new Vector2(_lookupSize, _lookupSize)); - var queryResult = _tree.QueryAabb(targetPos.MapId, box); - entities = new List(queryResult.Count); - foreach (var ent in queryResult) - { - entities.Add(ent.Uid); - } + // Get entities + _entities.Clear(); + var entitiesUnderMouse = _tree.QueryAabb(targetPos.MapId, Box2.CenteredAround(targetPos.Position, new Vector2(EntityMenuLookupSize, EntityMenuLookupSize))); - // If we're in a container list all other entities in it. - // E.g., allow players in lockers to examine / interact with other entities in the same locker - if (_containers.TryGetContainingContainer((player, null), out var container)) + // Do we have to do FoV checks? + if ((visibility & MenuVisibility.NoFov) == 0) { - // Only include the container contents when clicking near it. - if (entities.Contains(container.Owner) - || _containers.TryGetOuterContainer(container.Owner, Transform(container.Owner), out var outer) - && entities.Contains(outer.Owner)) + bool Predicate(EntityUid e) => e == player; + + TryComp(player.Value, out ExaminerComponent? examiner); + + foreach (var ent in entitiesUnderMouse) { - // The container itself might be in some other container, so it might not have been added by the - // sprite tree lookup. - if (!entities.Contains(container.Owner)) - entities.Add(container.Owner); - - // TODO Context Menu - // This might miss entities in some situations. E.g., one of the contained entities entity in it, that - // itself has another entity attached to it, then we should be able to "see" that entity. - // E.g., if a security guard is on a segway and gets thrown in a locker, this wouldn't let you see the guard. - foreach (var ent in container.ContainedEntities) - { - if (!entities.Contains(ent)) - entities.Add(ent); - } + if (_examine.CanExamine(player.Value, targetPos, Predicate, ent.Uid, examiner)) + _entities.Add(ent.Uid); } } - - if ((visibility & MenuVisibility.InContainer) != 0) + else { - // This is inefficient, but I'm lazy and CBF implementing my own recursive container method. Note that - // this might actually fail to add the contained children of some entities in the menu. E.g., an entity - // with a large sprite aabb, but small broadphase might appear in the menu, but have its children added - // by this. - var flags = LookupFlags.All & ~LookupFlags.Sensors; - foreach (var e in _lookup.GetEntitiesInRange(targetPos, _lookupSize, flags: flags)) + foreach (var ent in entitiesUnderMouse) { - if (!entities.Contains(e)) - entities.Add(e); + _entities.Add(ent.Uid); } } - // Do we have to do FoV checks? - if ((visibility & MenuVisibility.NoFov) == 0) + if (_entities.Count == 0) + return false; + + if (visibility == MenuVisibility.All) { - TryComp(player, out ExaminerComponent? examiner); - for (var i = entities.Count - 1; i >= 0; i--) + result = new (_entities); + return true; + } + + // remove any entities in containers + if ((visibility & MenuVisibility.InContainer) == 0) + { + for (var i = _entities.Count - 1; i >= 0; i--) { - if (!_examine.CanExamine(player, targetPos, e => e == player, entities[i], examiner)) - entities.RemoveSwap(i); + var entity = _entities[i]; + + if (ContainerSystem.IsInSameOrTransparentContainer(player.Value, entity)) + continue; + + _entities.RemoveSwap(i); } } - if ((visibility & MenuVisibility.Invisible) != 0) - return entities.Count != 0; - - for (var i = entities.Count - 1; i >= 0; i--) + // remove any invisible entities + if ((visibility & MenuVisibility.Invisible) == 0) { - if (_tagSystem.HasTag(entities[i], "HideContextMenu")) - entities.RemoveSwap(i); - } + var spriteQuery = GetEntityQuery(); - // Unless we added entities in containers, every entity should already have a visible sprite due to - // the fact that we used the sprite tree query. - if (container == null && (visibility & MenuVisibility.InContainer) == 0) - return entities.Count != 0; + for (var i = _entities.Count - 1; i >= 0; i--) + { + var entity = _entities[i]; - var spriteQuery = GetEntityQuery(); - for (var i = entities.Count - 1; i >= 0; i--) - { - if (!spriteQuery.TryGetComponent(entities[i], out var spriteComponent) || !spriteComponent.Visible) - entities.RemoveSwap(i); + if (!spriteQuery.TryGetComponent(entity, out var spriteComponent) || + !spriteComponent.Visible || + _tagSystem.HasTag(entity, "HideContextMenu")) + { + _entities.RemoveSwap(i); + } + } } - return entities.Count != 0; + if (_entities.Count == 0) + return false; + + result = new(_entities); + return true; } /// diff --git a/Content.Client/VoiceMask/VoiceMaskBoundUserInterface.cs b/Content.Client/VoiceMask/VoiceMaskBoundUserInterface.cs index bf38eb098668d3..891804674d3c95 100644 --- a/Content.Client/VoiceMask/VoiceMaskBoundUserInterface.cs +++ b/Content.Client/VoiceMask/VoiceMaskBoundUserInterface.cs @@ -1,4 +1,5 @@ using Content.Shared.VoiceMask; +using Robust.Client.GameObjects; using Robust.Client.UserInterface; using Robust.Shared.Prototypes; @@ -21,7 +22,6 @@ protected override void Open() _window = this.CreateWindow(); _window.ReloadVerbs(_protomanager); - _window.AddVerbs(); _window.OnNameChange += OnNameSelected; _window.OnVerbChange += verb => SendMessage(new VoiceMaskChangeVerbMessage(verb)); diff --git a/Content.Client/VoiceMask/VoiceMaskNameChangeWindow.xaml.cs b/Content.Client/VoiceMask/VoiceMaskNameChangeWindow.xaml.cs index 8d7318c6f805ff..0dc41f807ab127 100644 --- a/Content.Client/VoiceMask/VoiceMaskNameChangeWindow.xaml.cs +++ b/Content.Client/VoiceMask/VoiceMaskNameChangeWindow.xaml.cs @@ -1,6 +1,7 @@ using Content.Client.UserInterface.Controls; using Content.Shared.Speech; using Robust.Client.AutoGenerated; +using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; using Robust.Shared.Prototypes; @@ -30,6 +31,8 @@ public VoiceMaskNameChangeWindow() OnVerbChange?.Invoke((string?) args.Button.GetItemMetadata(args.Id)); SpeechVerbSelector.SelectId(args.Id); }; + + AddVerbs(); } public void ReloadVerbs(IPrototypeManager proto) @@ -41,7 +44,7 @@ public void ReloadVerbs(IPrototypeManager proto) _verbs.Sort((a, b) => a.Item1.CompareTo(b.Item1)); } - public void AddVerbs() + private void AddVerbs() { SpeechVerbSelector.Clear(); @@ -70,7 +73,7 @@ public void UpdateState(string name, string? verb) for (int id = 0; id < SpeechVerbSelector.ItemCount; id++) { - if (Equals(verb, SpeechVerbSelector.GetItemMetadata(id))) + if (string.Equals(verb, SpeechVerbSelector.GetItemMetadata(id))) { SpeechVerbSelector.SelectId(id); break; diff --git a/Content.Client/Voting/UI/VoteCallMenu.xaml b/Content.Client/Voting/UI/VoteCallMenu.xaml index c8b7ecaf56e219..cb03dd6bb883fc 100644 --- a/Content.Client/Voting/UI/VoteCallMenu.xaml +++ b/Content.Client/Voting/UI/VoteCallMenu.xaml @@ -1,7 +1,7 @@  + MouseFilter="Stop" MinSize="350 150"> @@ -13,17 +13,16 @@ - - - -