From 5e78ac2c22e02292e56ac9839317a1757aa9f291 Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:20:47 +0300 Subject: [PATCH] Revert "Ed 09 06 2024 upstream (#230)" This reverts commit 50470c3aaa28be2319951b05d80353423536455f. --- .github/CODEOWNERS | 2 - Content.Benchmarks/PvsBenchmark.cs | 41 +- .../UI/Tabs/ObjectsTab/ObjectsTab.xaml | 16 +- .../UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs | 119 +- .../UI/Tabs/ObjectsTab/ObjectsTabEntry.xaml | 8 +- .../Tabs/ObjectsTab/ObjectsTabEntry.xaml.cs | 6 +- .../UI/Tabs/ObjectsTab/ObjectsTabHeader.xaml | 21 - .../Tabs/ObjectsTab/ObjectsTabHeader.xaml.cs | 86 - .../UI/Tabs/PlayerTab/PlayerTab.xaml.cs | 5 +- .../Construction/ConstructionSystem.cs | 4 +- .../Construction/UI/FlatpackCreatorMenu.xaml | 2 +- .../UI/FlatpackCreatorMenu.xaml.cs | 43 +- Content.Client/Entry/EntryPoint.cs | 4 + .../GameTicking/Managers/ClientGameTicker.cs | 11 +- .../Components/GuideHelpComponent.cs | 8 +- .../Guidebook/Controls/GuidebookWindow.xaml | 10 +- .../Controls/GuidebookWindow.xaml.cs | 42 +- .../Guidebook/DocumentParsingManager.cs | 20 - .../Guidebook/GuideEntry.cs | 29 +- Content.Client/Guidebook/GuidebookSystem.cs | 10 +- Content.Client/Info/InfoSystem.cs | 25 + Content.Client/Info/RulesAndInfoWindow.cs | 14 +- Content.Client/Info/RulesControl.xaml | 24 +- Content.Client/Info/RulesControl.xaml.cs | 46 +- Content.Client/Info/RulesManager.cs | 105 + Content.Client/Info/RulesPopup.xaml | 10 +- Content.Client/Info/RulesPopup.xaml.cs | 2 + Content.Client/IoC/ClientContentIoC.cs | 2 + Content.Client/LateJoin/LateJoinGui.cs | 8 +- .../Light/RgbLightControllerSystem.cs | 5 +- Content.Client/Lobby/LobbyUIController.cs | 6 +- .../Lobby/UI/CharacterPickerButton.xaml.cs | 4 +- .../Lobby/UI/HumanoidProfileEditor.xaml.cs | 22 +- .../Lobby/UI/Roles/RequirementsSelector.xaml | 15 +- .../UI/Roles/RequirementsSelector.xaml.cs | 21 +- .../JobRequirementsManager.cs | 8 +- .../Silicons/Laws/Ui/LawDisplay.xaml.cs | 9 +- Content.Client/Stylesheets/StyleNano.cs | 6 - .../Controls/FancyWindow.xaml.cs | 5 +- .../Systems/Actions/Controls/ActionButton.cs | 4 - .../Systems/Admin/AdminUIController.cs | 7 +- .../Guidebook/GuidebookUIController.cs | 75 +- .../Systems/Info/InfoUIController.cs | 76 +- .../Pair/TestPair.Helpers.cs | 73 +- .../Pair/TestPair.Recycle.cs | 17 - Content.IntegrationTests/Pair/TestPair.cs | 5 +- Content.IntegrationTests/PoolManager.Cvars.cs | 1 - Content.IntegrationTests/Tests/EntityTest.cs | 1 - .../Tests/GameRules/AntagPreferenceTest.cs | 4 +- .../Tests/GameRules/NukeOpsTest.cs | 54 +- .../Guidebook/GuideEntryPrototypeTests.cs | 1 - .../Tests/MachineBoardTest.cs | 41 +- .../Tests/MaterialArbitrageTest.cs | 3 +- .../Tests/PostMapInitTest.cs | 21 +- .../Tests/Round/JobTest.cs | 222 - .../Tests/Station/StationJobsTest.cs | 13 +- .../Tests/Storage/StorageInteractionTest.cs | 12 - Content.Packaging/Program.cs | 5 - ...0606065731_RemoveLastReadRules.Designer.cs | 1909 --- .../20240606065731_RemoveLastReadRules.cs | 29 - ...0606175154_ReturnLastReadRules.Designer.cs | 1913 --- .../20240606175154_ReturnLastReadRules.cs | 29 - ...0606065717_RemoveLastReadRules.Designer.cs | 1834 -- .../20240606065717_RemoveLastReadRules.cs | 29 - ...0606175141_ReturnLastReadRules.Designer.cs | 1838 -- .../20240606175141_ReturnLastReadRules.cs | 29 - .../Logs/AdminLogManager.Json.cs | 4 - .../Administration/Managers/AdminManager.cs | 1 - .../Administration/Systems/AdminVerbSystem.cs | 107 +- Content.Server/Ame/AmeNodeGroup.cs | 2 +- Content.Server/Antag/AntagSelectionSystem.cs | 3 - .../AtmosphereSystem.BreathTool.cs | 14 +- .../Atmos/EntitySystems/GasTankSystem.cs | 2 +- .../Body/Components/InternalsComponent.cs | 2 +- .../Body/Systems/InternalsSystem.cs | 30 +- Content.Server/Body/Systems/LungSystem.cs | 2 +- Content.Server/Chat/Systems/ChatSystem.cs | 6 +- .../Construction/Components/IRefreshParts.cs | 10 + .../Components/MachineComponent.cs | 34 +- .../Components/MachineFrameComponent.cs | 19 +- .../Components/PartExchangerComponent.cs | 29 + .../Conditions/MachineFrameComplete.cs | 28 +- .../Construction/ConstructionSystem.Graph.cs | 8 +- .../Construction/ConstructionSystem.Guided.cs | 6 +- .../ConstructionSystem.Initial.cs | 8 +- .../ConstructionSystem.Machine.cs | 176 +- .../Construction/ConstructionSystem.cs | 1 + Content.Server/Construction/FlatpackSystem.cs | 50 +- .../Construction/MachineFrameSystem.cs | 128 +- .../Construction/PartExchangerSystem.cs | 180 + .../Damage/Systems/DamageOtherOnHitSystem.cs | 45 +- Content.Server/Database/ServerDbBase.cs | 7 +- Content.Server/Devour/DevourSystem.cs | 12 - Content.Server/Entry/EntryPoint.cs | 1 + .../EntitySystems/TriggerSystem.OnUse.cs | 3 +- .../GameTicking/GameTicker.RoundFlow.cs | 2 +- Content.Server/Ghost/GhostSystem.cs | 16 +- .../Roles/Components/GhostRoleComponent.cs | 4 - Content.Server/Info/InfoSystem.cs | 35 + Content.Server/Info/RulesManager.cs | 14 +- Content.Server/Info/ShowRulesCommand.cs | 14 +- .../Instruments/InstrumentSystem.cs | 7 +- .../Kitchen/EntitySystems/MicrowaveSystem.cs | 64 +- .../ParticleAcceleratorSystem.Emitter.cs | 2 +- .../PlayTimeTrackingSystem.cs | 39 +- .../Pointing/EntitySystems/PointingSystem.cs | 2 +- Content.Server/Prayer/PrayerSystem.cs | 4 +- .../Managers/ServerPreferencesManager.cs | 6 +- .../RandomMetadata/RandomMetadataSystem.cs | 11 +- .../Revenant/EntitySystems/CorporealSystem.cs | 10 +- .../Revenant/EntitySystems/RevenantSystem.cs | 12 +- .../EntitySystems/SingularitySystem.cs | 84 +- .../Components/SpawnPointComponent.cs | 9 +- .../EntitySystems/SpawnPointSystem.cs | 2 +- Content.Server/Stack/StackSystem.cs | 9 - .../Components/StationJobsComponent.cs | 48 +- .../Systems/StationJobsSystem.Roundstart.cs | 23 +- .../Station/Systems/StationJobsSystem.cs | 138 +- .../Teleportation/HandTeleporterSystem.cs | 2 +- Content.Shared/CCVar/CCVars.cs | 25 +- .../Components/MachineBoardComponent.cs | 83 +- .../Components/MachinePartComponent.cs | 24 + .../Construction/MachinePartSystem.cs | 50 +- .../Prototypes/MachinePartPrototype.cs | 28 + .../Construction/SharedConstructionSystem.cs | 11 - .../Construction/SharedFlatpackSystem.cs | 70 +- Content.Shared/Cuffs/SharedCuffableSystem.cs | 4 +- .../Components/OnUseTimerTriggerComponent.cs | 5 - .../GameTicking/SharedGameTicker.cs | 15 +- .../Ghost/Roles/GhostRolePrototype.cs | 12 +- .../Ghost/Roles/GhostRolesEuiMessages.cs | 5 - Content.Shared/Info/RulesMessages.cs | 41 - Content.Shared/Info/SharedInfo.cs | 28 + Content.Shared/Info/SharedRulesManager.cs | 60 + Content.Shared/Lathe/LatheComponent.cs | 2 + Content.Shared/Prayer/PrayableComponent.cs | 2 +- .../Preferences/HumanoidCharacterProfile.cs | 117 +- .../Preferences/Loadouts/RoleLoadout.cs | 23 +- .../Random/Helpers/SharedRandomExtensions.cs | 6 +- Content.Shared/Roles/AntagPrototype.cs | 12 +- Content.Shared/Roles/JobPrototype.cs | 14 +- .../Roles/JobRequirementOverridePrototype.cs | 20 - Content.Shared/Roles/JobRequirements.cs | 20 +- Content.Shared/Roles/Jobs/SharedJobSystem.cs | 12 - Content.Shared/Roles/SharedRoleSystem.cs | 52 +- .../Components/SingularityComponent.cs | 22 + .../EntitySystems/SharedStorageSystem.cs | 4 +- .../Components/HandTeleporterComponent.cs | 8 +- Resources/Audio/Effects/Smoke-grenade.ogg | Bin 93809 -> 98191 bytes Resources/Changelog/Admin.yml | 17 - Resources/Changelog/Changelog.yml | 370 +- .../ConfigPresets/WizardsDen/salamander.toml | 3 +- .../ConfigPresets/WizardsDen/wizardsDen.toml | 3 - .../en-US/_CP14/species/species-names.ftl | 12 +- .../administration/ui/tabs/object-tab.ftl | 2 - ...bitrary-insert-construction-graph-step.ftl | 10 +- .../criminal-records/criminal-records.ftl | 8 +- .../Locale/en-US/guidebook/guidebook.ftl | 4 +- Resources/Locale/en-US/guidebook/guides.ftl | 92 +- Resources/Locale/en-US/info/rules.ftl | 3 - .../interaction-popup-component.ftl | 27 +- .../Locale/en-US/speech/speech-chatsan.ftl | 8 +- .../Locale/en-US/store/revenant-catalog.ftl | 11 - .../ru-RU/_CP14/species/species-names.ftl | 12 +- .../ru-RU/administration/ui/admin-logs.ftl | 19 + .../components/ame-controller-component.ftl | 22 + .../ame-fuel-container-component.ftl | 1 + .../ame/components/ame-part-component.ftl | 2 + .../ru-RU/chat/sanitizer-replacements.ftl | 24 + .../disposal-mailing-unit-component.ftl | 7 + .../disposal/tube-connections-command.ftl | 2 + .../components/disposal-router-component.ftl | 6 + .../components/disposal-tagger-window.ftl | 3 + .../components/disposal-tube-component.ftl | 5 + .../components/disposal-unit-component.ftl | 31 + .../ru-RU/escape-menu/ui/options-menu.ftl | 1 + .../ru-RU/reagents/meta/physical-desc.ftl | 97 + Resources/Maps/Salvage/small-chapel.yml | 21 +- Resources/Maps/cluster.yml | 999 +- Resources/Maps/core.yml | 13866 ++++++++-------- Resources/Maps/saltern.yml | 18 +- .../Prototypes/Accents/word_replacements.yml | 2 - .../Catalog/Fills/Boxes/emergency.yml | 2 - .../Prototypes/Catalog/revenant_catalog.yml | 16 +- .../Clothing/Head/base_clothinghead.yml | 2 - .../Entities/Clothing/Head/eva-helmets.yml | 6 + .../Clothing/Head/hardsuit-helmets.yml | 31 + .../Entities/Clothing/Head/helmets.yml | 1 - .../Prototypes/Entities/Mobs/NPCs/animals.yml | 7 - .../Prototypes/Entities/Mobs/NPCs/silicon.yml | 4 +- .../Prototypes/Entities/Mobs/NPCs/slimes.yml | 2 +- .../Entities/Mobs/Species/diona.yml | 8 +- .../Entities/Mobs/Species/slime.yml | 2 +- .../Consumable/Drinks/drinks-cartons.yml | 2 +- .../Consumable/Drinks/drinks_bottles.yml | 62 +- .../Smokeables/Cigarettes/cigarette.yml | 2 - .../Consumable/Smokeables/Cigars/cigar.yml | 2 - .../Devices/Circuitboards/Machine/cannons.yml | 17 +- .../Machine/particle_accelerator.yml | 17 +- .../Circuitboards/Machine/production.yml | 352 +- .../Fun/Instruments/base_instruments.yml | 3 +- .../Fun/Instruments/instruments_misc.yml | 6 +- .../Entities/Objects/Misc/kudzu.yml | 2 +- .../Entities/Objects/Misc/machine_parts.yml | 11 +- .../Entities/Objects/Power/powercells.yml | 12 + .../Objects/Specific/Janitorial/janitor.yml | 34 +- .../Structures/Decoration/banners.yml | 4 +- .../Dispensers/base_structuredispensers.yml | 2 +- .../Computers/base_structurecomputers.yml | 1 - .../Machines/Medical/chemistry_machines.yml | 2 +- .../Machines/Medical/disease_diagnoser.yml | 4 +- .../Machines/Medical/vaccinator.yml | 1 - .../Structures/Machines/artifact_analyzer.yml | 3 +- .../Machines/base_structuremachines.yml | 7 - .../Structures/Machines/fax_machine.yml | 1 - .../Entities/Structures/Machines/lathe.yml | 1 - .../Structures/Machines/microwave.yml | 4 +- .../Structures/Machines/reagent_grinder.yml | 2 +- .../Machines/wireless_surveillance_camera.yml | 4 +- .../Piping/Atmospherics/portable.yml | 2 +- .../Structures/Piping/Atmospherics/unary.yml | 2 +- .../Structures/Piping/Disposal/units.yml | 1 - .../Power/Generation/Singularity/emitter.yml | 2 +- .../Power/Generation/portable_generator.yml | 4 +- .../Structures/Power/Generation/solar.yml | 3 - .../Entities/Structures/Power/chargers.yml | 3 - .../Structures/Storage/Tanks/tanks.yml | 4 +- .../Structures/Storage/filing_cabinets.yml | 1 - .../Entities/Structures/Walls/fence_wood.yml | 19 +- .../Entities/Structures/hydro_tray.yml | 4 +- Resources/Prototypes/Guidebook/botany.yml | 4 + Resources/Prototypes/Guidebook/cargo.yml | 6 - Resources/Prototypes/Guidebook/command.yml | 4 - Resources/Prototypes/Guidebook/medical.yml | 4 +- Resources/Prototypes/Guidebook/meta.yml | 6 + Resources/Prototypes/Guidebook/newplayer.yml | 32 - Resources/Prototypes/Guidebook/radio.yml | 4 + Resources/Prototypes/Guidebook/references.yml | 26 - Resources/Prototypes/Guidebook/rules.yml | 435 - Resources/Prototypes/Guidebook/salvage.yml | 4 + Resources/Prototypes/Guidebook/security.yml | 1 - Resources/Prototypes/Guidebook/service.yml | 31 - .../Prototypes/Guidebook/shiftandcrew.yml | 39 +- .../Guidebook/{station.yml => ss14.yml} | 13 +- .../Prototypes/InventoryTemplates/borg.yml | 5 +- .../Prototypes/MachineParts/machine_parts.yml | 20 + Resources/Prototypes/Maps/arenas.yml | 2 + Resources/Prototypes/Maps/atlas.yml | 60 +- Resources/Prototypes/Maps/bagel.yml | 65 +- Resources/Prototypes/Maps/box.yml | 65 +- Resources/Prototypes/Maps/cluster.yml | 64 +- Resources/Prototypes/Maps/core.yml | 68 +- Resources/Prototypes/Maps/debug.yml | 13 +- Resources/Prototypes/Maps/europa.yml | 70 +- Resources/Prototypes/Maps/fland.yml | 65 +- Resources/Prototypes/Maps/marathon.yml | 65 +- Resources/Prototypes/Maps/meta.yml | 63 +- Resources/Prototypes/Maps/oasis.yml | 66 +- Resources/Prototypes/Maps/omega.yml | 63 +- Resources/Prototypes/Maps/origin.yml | 67 +- Resources/Prototypes/Maps/packed.yml | 62 +- Resources/Prototypes/Maps/reach.yml | 37 +- Resources/Prototypes/Maps/saltern.yml | 63 +- Resources/Prototypes/Maps/train.yml | 65 +- Resources/Prototypes/Roles/Antags/ninja.yml | 3 +- Resources/Prototypes/Roles/Antags/nukeops.yml | 7 +- .../Prototypes/Roles/Antags/revolutionary.yml | 4 +- Resources/Prototypes/Roles/Antags/traitor.yml | 3 +- Resources/Prototypes/Roles/Antags/zombie.yml | 2 - .../Roles/Jobs/Civilian/assistant.yml | 2 +- .../Roles/Jobs/Civilian/janitor.yml | 6 +- .../Prototypes/Roles/Jobs/Command/captain.yml | 2 +- .../Jobs/Engineering/station_engineer.yml | 2 +- .../Roles/requirement_overrides.yml | 16 - .../Prototypes/Stacks/science_stacks.yml | 2 +- .../_CP14/Datasets/Names/species-names.yml | 2 +- Resources/Prototypes/_CP14/Maps/arenas.yml | 4 + Resources/Prototypes/lobbyscreens.yml | 3 +- .../Guidebook/Antagonist/Traitors.xml | 6 +- .../ServerInfo/Guidebook/Cargo/Cargo.xml | 37 +- Resources/ServerInfo/Guidebook/Command.xml | 56 - .../{NewPlayer => }/Controls/Controls.xml | 0 .../ServerInfo/Guidebook/Controls/Radio.xml | 28 + .../Guidebook/Engineering/Engineering.xml | 32 +- .../Guidebook/Engineering/Singularity.xml | 3 +- Resources/ServerInfo/Guidebook/Glossary.xml | 109 +- Resources/ServerInfo/Guidebook/Jobs.xml | 20 +- .../ServerInfo/Guidebook/Medical/Chemist.xml | 45 +- .../ServerInfo/Guidebook/Medical/Medical.xml | 36 +- .../Guidebook/Medical/MedicalDoctor.xml | 15 +- .../Guidebook/NewPlayer/CharacterCreation.xml | 70 - .../Guidebook/NewPlayer/Controls/Radio.xml | 64 - .../Guidebook/NewPlayer/NewPlayer.xml | 28 - .../NewPlayer/YourFirstCharacter.xml | 54 - .../Guidebook/ReferenceTables/Drinks.xml | 6 - Resources/ServerInfo/Guidebook/References.xml | 4 - .../ServerInfo/Guidebook/Science/Science.xml | 52 +- .../Guidebook/Security/Security.xml | 46 +- .../Guidebook/ServerRules/BanDurations.xml | 17 - .../Guidebook/ServerRules/BanTypes.xml | 11 - .../ServerRules/CoreRules/RuleC0.xml | 19 - .../ServerRules/CoreRules/RuleC10AHelp.xml | 29 - .../CoreRules/RuleC11AhelpThreats.xml | 20 - .../ServerRules/CoreRules/RuleC12MinAge.xml | 6 - .../CoreRules/RuleC13CharacterNames.xml | 68 - .../ServerRules/CoreRules/RuleC14ICinOOC.xml | 13 - .../ServerRules/CoreRules/RuleC1Admins.xml | 6 - .../ServerRules/CoreRules/RuleC2DBAD.xml | 7 - .../ServerRules/CoreRules/RuleC3NoHate.xml | 20 - .../ServerRules/CoreRules/RuleC4NoERP.xml | 23 - .../ServerRules/CoreRules/RuleC5Metacomms.xml | 18 - .../CoreRules/RuleC6BanEvasion.xml | 15 - .../CoreRules/RuleC7EnglishOnly.xml | 10 - .../ServerRules/CoreRules/RuleC8Exploits.xml | 12 - .../ServerRules/CoreRules/RuleC9Multikey.xml | 7 - .../Guidebook/ServerRules/DefaultRules.xml | 5 - .../Guidebook/ServerRules/README.txt | 5 - .../Guidebook/ServerRules/RoleTypes.xml | 21 - .../ServerRules/RoleplayRules/RuleR0.xml | 26 - .../RoleplayRules/RuleR10Subordination.xml | 26 - .../RuleR11-1AnimalEscalation.xml | 36 - .../RoleplayRules/RuleR11-2ConflictTypes.xml | 30 - .../RoleplayRules/RuleR11Escalation.xml | 67 - .../RoleplayRules/RuleR12RoleAbandonment.xml | 28 - .../RoleplayRules/RuleR13PerformRole.xml | 26 - .../RoleplayRules/RuleR14SecComStandard.xml | 37 - .../RoleplayRules/RuleR15SpaceLaw.xml | 30 - .../RoleplayRules/RuleR1Silicons.xml | 4 - .../RoleplayRules/RuleR2Familiars.xml | 6 - .../RoleplayRules/RuleR3NormalRP.xml | 20 - .../RoleplayRules/RuleR4Metashield.xml | 104 - .../RoleplayRules/RuleR5Arrivals.xml | 22 - .../RoleplayRules/RuleR6SelfAntag.xml | 22 - .../RoleplayRules/RuleR7RoundStalling.xml | 16 - .../RoleplayRules/RuleR8NoFriendlyAntag.xml | 22 - .../RoleplayRules/RuleR9MassSabotage.xml | 24 - .../ServerRules/SiliconRules/RuleS0.xml | 15 - .../SiliconRules/RuleS10OrderConflicts.xml | 9 - .../ServerRules/SiliconRules/RuleS1Laws.xml | 6 - .../SiliconRules/RuleS2LawPriority.xml | 9 - .../SiliconRules/RuleS3LawRedefinition.xml | 8 - .../SiliconRules/RuleS4RequestChanges.xml | 6 - .../SiliconRules/RuleS5FreeSilicon.xml | 4 - .../SiliconRules/RuleS6UnreasonableOrders.xml | 22 - .../SiliconRules/RuleS7Consistency.xml | 6 - .../RuleS8DefaultCrewDefinition.xml | 4 - .../RuleS9DefaultHarmDefinition.xml | 25 - .../SpaceLaw/SLControlledSubstances.xml | 14 - .../ServerRules/SpaceLaw/SLCrimeList.xml | 934 -- .../ServerRules/SpaceLaw/SLRestrictedGear.xml | 21 - .../SpaceLaw/SLRestrictedWeapons.xml | 14 - .../ServerRules/SpaceLaw/SpaceLaw.xml | 67 - .../ServerRules/WizDenCoreOnlyRules.xml | 26 - .../Guidebook/ServerRules/WizDenLRPRules.xml | 65 - .../Guidebook/ServerRules/WizDenMRPRules.xml | 65 - .../Guidebook/Service/Bartender.xml | 7 +- .../ServerInfo/Guidebook/Service/Botany.xml | 4 +- .../ServerInfo/Guidebook/Service/Chef.xml | 3 - .../ServerInfo/Guidebook/Service/Service.xml | 34 - .../ServerInfo/Guidebook/SpaceStation14.xml | 20 +- Resources/ServerInfo/Guidebook/Survival.xml | 27 +- Resources/ServerInfo/RP_Rules.txt | 127 + Resources/ServerInfo/Rules.txt | 115 + .../Textures/LobbyScreens/attributions.yml | 5 - .../Textures/LobbyScreens/janishootout.webp | Bin 201216 -> 0 bytes .../LobbyScreens/janishootout.webp.yml | 2 - .../Cigars/cigar-gold.rsi/lit-inhand-left.png | Bin 1374 -> 769 bytes .../cigar-gold.rsi/lit-inhand-right.png | Bin 1220 -> 542 bytes .../cigar-gold.rsi/unlit-inhand-left.png | Bin 306 -> 246 bytes .../cigar-gold.rsi/unlit-inhand-right.png | Bin 335 -> 263 bytes .../Cigars/cigar.rsi/lit-inhand-left.png | Bin 1374 -> 769 bytes .../Cigars/cigar.rsi/lit-inhand-right.png | Bin 1220 -> 542 bytes .../Cigars/cigar.rsi/unlit-inhand-left.png | Bin 306 -> 246 bytes .../Cigars/cigar.rsi/unlit-inhand-right.png | Bin 335 -> 263 bytes .../Specific/Janitorial/advmop.rsi/fill-1.png | Bin 200 -> 0 bytes .../Specific/Janitorial/advmop.rsi/fill-2.png | Bin 216 -> 0 bytes .../advmop.rsi/inhand-left-fill-1.png | Bin 155 -> 0 bytes .../advmop.rsi/inhand-left-fill-2.png | Bin 187 -> 0 bytes .../advmop.rsi/inhand-right-fill-1.png | Bin 157 -> 0 bytes .../advmop.rsi/inhand-right-fill-2.png | Bin 195 -> 0 bytes .../Specific/Janitorial/advmop.rsi/meta.json | 62 +- .../advmop.rsi/wielded-inhand-left-fill-1.png | Bin 252 -> 0 bytes .../advmop.rsi/wielded-inhand-left-fill-2.png | Bin 282 -> 0 bytes .../wielded-inhand-right-fill-1.png | Bin 254 -> 0 bytes .../wielded-inhand-right-fill-2.png | Bin 279 -> 0 bytes .../Specific/Janitorial/mop.rsi/fill-1.png | Bin 179 -> 0 bytes .../Specific/Janitorial/mop.rsi/fill-2.png | Bin 191 -> 0 bytes .../Specific/Janitorial/mop.rsi/fill-3.png | Bin 197 -> 0 bytes .../Janitorial/mop.rsi/inhand-left-fill-1.png | Bin 145 -> 0 bytes .../Janitorial/mop.rsi/inhand-left-fill-2.png | Bin 156 -> 0 bytes .../mop.rsi/inhand-right-fill-1.png | Bin 147 -> 0 bytes .../mop.rsi/inhand-right-fill-2.png | Bin 160 -> 0 bytes .../Specific/Janitorial/mop.rsi/meta.json | 65 +- .../mop.rsi/wielded-inhand-left-fill-1.png | Bin 153 -> 0 bytes .../mop.rsi/wielded-inhand-left-fill-2.png | Bin 186 -> 0 bytes .../mop.rsi/wielded-inhand-right-fill-1.png | Bin 151 -> 0 bytes .../mop.rsi/wielded-inhand-right-fill-2.png | Bin 189 -> 0 bytes .../Specific/Janitorial/rag.rsi/fill-1.png | Bin 133 -> 0 bytes .../Specific/Janitorial/rag.rsi/fill-2.png | Bin 163 -> 0 bytes .../Specific/Janitorial/rag.rsi/fill-3.png | Bin 173 -> 0 bytes .../Specific/Janitorial/rag.rsi/meta.json | 35 +- RobustToolbox | 2 +- 402 files changed, 11291 insertions(+), 21552 deletions(-) delete mode 100644 Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabHeader.xaml delete mode 100644 Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabHeader.xaml.cs rename {Content.Shared => Content.Client}/Guidebook/GuideEntry.cs (67%) create mode 100644 Content.Client/Info/InfoSystem.cs create mode 100644 Content.Client/Info/RulesManager.cs delete mode 100644 Content.IntegrationTests/Tests/Round/JobTest.cs delete mode 100644 Content.Server.Database/Migrations/Postgres/20240606065731_RemoveLastReadRules.Designer.cs delete mode 100644 Content.Server.Database/Migrations/Postgres/20240606065731_RemoveLastReadRules.cs delete mode 100644 Content.Server.Database/Migrations/Postgres/20240606175154_ReturnLastReadRules.Designer.cs delete mode 100644 Content.Server.Database/Migrations/Postgres/20240606175154_ReturnLastReadRules.cs delete mode 100644 Content.Server.Database/Migrations/Sqlite/20240606065717_RemoveLastReadRules.Designer.cs delete mode 100644 Content.Server.Database/Migrations/Sqlite/20240606065717_RemoveLastReadRules.cs delete mode 100644 Content.Server.Database/Migrations/Sqlite/20240606175141_ReturnLastReadRules.Designer.cs delete mode 100644 Content.Server.Database/Migrations/Sqlite/20240606175141_ReturnLastReadRules.cs create mode 100644 Content.Server/Construction/Components/IRefreshParts.cs create mode 100644 Content.Server/Construction/Components/PartExchangerComponent.cs create mode 100644 Content.Server/Construction/PartExchangerSystem.cs create mode 100644 Content.Server/Info/InfoSystem.cs create mode 100644 Content.Shared/Construction/Components/MachinePartComponent.cs create mode 100644 Content.Shared/Construction/Prototypes/MachinePartPrototype.cs delete mode 100644 Content.Shared/Info/RulesMessages.cs create mode 100644 Content.Shared/Info/SharedInfo.cs create mode 100644 Content.Shared/Info/SharedRulesManager.cs delete mode 100644 Content.Shared/Roles/JobRequirementOverridePrototype.cs delete mode 100644 Resources/Locale/en-US/administration/ui/tabs/object-tab.ftl delete mode 100644 Resources/Locale/en-US/store/revenant-catalog.ftl create mode 100644 Resources/Locale/ru-RU/administration/ui/admin-logs.ftl create mode 100644 Resources/Locale/ru-RU/ame/components/ame-controller-component.ftl create mode 100644 Resources/Locale/ru-RU/ame/components/ame-fuel-container-component.ftl create mode 100644 Resources/Locale/ru-RU/ame/components/ame-part-component.ftl create mode 100644 Resources/Locale/ru-RU/chat/sanitizer-replacements.ftl create mode 100644 Resources/Locale/ru-RU/disposal/mailing/components/disposal-mailing-unit-component.ftl create mode 100644 Resources/Locale/ru-RU/disposal/tube-connections-command.ftl create mode 100644 Resources/Locale/ru-RU/disposal/tube/components/disposal-router-component.ftl create mode 100644 Resources/Locale/ru-RU/disposal/tube/components/disposal-tagger-window.ftl create mode 100644 Resources/Locale/ru-RU/disposal/tube/components/disposal-tube-component.ftl create mode 100644 Resources/Locale/ru-RU/disposal/unit/components/disposal-unit-component.ftl create mode 100644 Resources/Locale/ru-RU/reagents/meta/physical-desc.ftl create mode 100644 Resources/Prototypes/Guidebook/botany.yml delete mode 100644 Resources/Prototypes/Guidebook/command.yml create mode 100644 Resources/Prototypes/Guidebook/meta.yml delete mode 100644 Resources/Prototypes/Guidebook/newplayer.yml create mode 100644 Resources/Prototypes/Guidebook/radio.yml delete mode 100644 Resources/Prototypes/Guidebook/references.yml delete mode 100644 Resources/Prototypes/Guidebook/rules.yml create mode 100644 Resources/Prototypes/Guidebook/salvage.yml delete mode 100644 Resources/Prototypes/Guidebook/service.yml rename Resources/Prototypes/Guidebook/{station.yml => ss14.yml} (71%) create mode 100644 Resources/Prototypes/MachineParts/machine_parts.yml delete mode 100644 Resources/Prototypes/Roles/requirement_overrides.yml delete mode 100644 Resources/ServerInfo/Guidebook/Command.xml rename Resources/ServerInfo/Guidebook/{NewPlayer => }/Controls/Controls.xml (100%) create mode 100644 Resources/ServerInfo/Guidebook/Controls/Radio.xml delete mode 100644 Resources/ServerInfo/Guidebook/NewPlayer/CharacterCreation.xml delete mode 100644 Resources/ServerInfo/Guidebook/NewPlayer/Controls/Radio.xml delete mode 100644 Resources/ServerInfo/Guidebook/NewPlayer/NewPlayer.xml delete mode 100644 Resources/ServerInfo/Guidebook/NewPlayer/YourFirstCharacter.xml delete mode 100644 Resources/ServerInfo/Guidebook/ReferenceTables/Drinks.xml delete mode 100644 Resources/ServerInfo/Guidebook/References.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/BanDurations.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/BanTypes.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC0.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC10AHelp.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC11AhelpThreats.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC12MinAge.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC13CharacterNames.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC14ICinOOC.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC1Admins.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC2DBAD.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC3NoHate.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC4NoERP.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC5Metacomms.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC6BanEvasion.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC7EnglishOnly.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC8Exploits.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/CoreRules/RuleC9Multikey.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/DefaultRules.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/README.txt delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleTypes.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR0.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR10Subordination.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR11-1AnimalEscalation.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR11-2ConflictTypes.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR11Escalation.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR12RoleAbandonment.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR13PerformRole.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR14SecComStandard.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR15SpaceLaw.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR1Silicons.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR2Familiars.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR3NormalRP.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR4Metashield.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR5Arrivals.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR6SelfAntag.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR7RoundStalling.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR8NoFriendlyAntag.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/RoleplayRules/RuleR9MassSabotage.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS0.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS10OrderConflicts.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS1Laws.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS2LawPriority.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS3LawRedefinition.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS4RequestChanges.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS5FreeSilicon.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS6UnreasonableOrders.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS7Consistency.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS8DefaultCrewDefinition.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SiliconRules/RuleS9DefaultHarmDefinition.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SpaceLaw/SLControlledSubstances.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SpaceLaw/SLCrimeList.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SpaceLaw/SLRestrictedGear.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SpaceLaw/SLRestrictedWeapons.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/SpaceLaw/SpaceLaw.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/WizDenCoreOnlyRules.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/WizDenLRPRules.xml delete mode 100644 Resources/ServerInfo/Guidebook/ServerRules/WizDenMRPRules.xml delete mode 100644 Resources/ServerInfo/Guidebook/Service/Service.xml create mode 100644 Resources/ServerInfo/RP_Rules.txt create mode 100644 Resources/ServerInfo/Rules.txt delete mode 100644 Resources/Textures/LobbyScreens/janishootout.webp delete mode 100644 Resources/Textures/LobbyScreens/janishootout.webp.yml delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/advmop.rsi/fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/advmop.rsi/fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/advmop.rsi/inhand-left-fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/advmop.rsi/inhand-left-fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/advmop.rsi/inhand-right-fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/advmop.rsi/inhand-right-fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/advmop.rsi/wielded-inhand-left-fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/advmop.rsi/wielded-inhand-left-fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/advmop.rsi/wielded-inhand-right-fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/advmop.rsi/wielded-inhand-right-fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/fill-3.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/inhand-left-fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/inhand-left-fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/inhand-right-fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/inhand-right-fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/wielded-inhand-left-fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/wielded-inhand-left-fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/wielded-inhand-right-fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/mop.rsi/wielded-inhand-right-fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/rag.rsi/fill-1.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/rag.rsi/fill-2.png delete mode 100644 Resources/Textures/Objects/Specific/Janitorial/rag.rsi/fill-3.png diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index da9d4d693a..21c3070b80 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -15,7 +15,6 @@ /Content.*/GameTicking/ @moonheart08 @EmoGarbage404 /Resources/ServerInfo/ @moonheart08 @Chief-Engineer /Resources/ServerInfo/Guidebook/ @moonheart08 @EmoGarbage404 -/Resources/ServerInfo/Guidebook/ServerRules/ @Chief-Engineer /Resources/engineCommandPerms.yml @moonheart08 @Chief-Engineer /Resources/clientCommandPerms.yml @moonheart08 @Chief-Engineer @@ -24,7 +23,6 @@ /Resources/Prototypes/Body/ @DrSmugleaf # suffering /Resources/Prototypes/Entities/Mobs/Player/ @DrSmugleaf /Resources/Prototypes/Entities/Mobs/Species/ @DrSmugleaf -/Resources/Prototypes/Guidebook/rules.yml @Chief-Engineer /Content.*/Body/ @DrSmugleaf /Content.YAMLLinter @DrSmugleaf /Content.Shared/Damage/ @DrSmugleaf diff --git a/Content.Benchmarks/PvsBenchmark.cs b/Content.Benchmarks/PvsBenchmark.cs index fa7f9d4542..0b4dd90762 100644 --- a/Content.Benchmarks/PvsBenchmark.cs +++ b/Content.Benchmarks/PvsBenchmark.cs @@ -1,17 +1,19 @@ #nullable enable using System; +using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; using BenchmarkDotNet.Attributes; using Content.IntegrationTests; using Content.IntegrationTests.Pair; -using Content.Server.Mind; using Content.Server.Warps; using Robust.Server.GameObjects; using Robust.Shared; using Robust.Shared.Analyzers; +using Robust.Shared.Enums; using Robust.Shared.GameObjects; +using Robust.Shared.GameStates; using Robust.Shared.Map; +using Robust.Shared.Network; using Robust.Shared.Player; using Robust.Shared.Random; @@ -56,20 +58,15 @@ public class PvsBenchmark _pair.Server.CfgMan.SetCVar(CVars.NetPvsAsync, false); _sys = _entMan.System(); - SetupAsync().Wait(); - } - - private async Task SetupAsync() - { // Spawn the map _pair.Server.ResolveDependency().SetSeed(42); - await _pair.Server.WaitPost(() => + _pair.Server.WaitPost(() => { var success = _entMan.System().TryLoad(_mapId, Map, out _); if (!success) throw new Exception("Map load failed"); _pair.Server.MapMan.DoMapInitialize(_mapId); - }); + }).Wait(); // Get list of ghost warp positions _spawns = _entMan.AllComponentsList() @@ -79,19 +76,17 @@ public class PvsBenchmark Array.Resize(ref _players, PlayerCount); - // Spawn "Players" - _players = await _pair.Server.AddDummySessions(PlayerCount); - await _pair.Server.WaitPost(() => + // Spawn "Players". + _pair.Server.WaitPost(() => { - var mind = _pair.Server.System(); for (var i = 0; i < PlayerCount; i++) { var pos = _spawns[i % _spawns.Length]; var uid =_entMan.SpawnEntity("MobHuman", pos); _pair.Server.ConsoleHost.ExecuteCommand($"setoutfit {_entMan.GetNetEntity(uid)} CaptainGear"); - mind.ControlMob(_players[i].UserId, uid); + _players[i] = new DummySession{AttachedEntity = uid}; } - }); + }).Wait(); // Repeatedly move players around so that they "explore" the map and see lots of entities. // This will populate their PVS data with out-of-view entities. @@ -173,4 +168,20 @@ public class PvsBenchmark }).Wait(); _pair.Server.PvsTick(_players); } + + private sealed class DummySession : ICommonSession + { + public SessionStatus Status => SessionStatus.InGame; + public EntityUid? AttachedEntity {get; set; } + public NetUserId UserId => default; + public string Name => string.Empty; + public short Ping => default; + public INetChannel Channel { get; set; } = default!; + public LoginType AuthType => default; + public HashSet ViewSubscriptions { get; } = new(); + public DateTime ConnectedTime { get; set; } + public SessionState State => default!; + public SessionData Data => default!; + public bool ClientSide { get; set; } + } } diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml index ea89916ba8..fb68e6c790 100644 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml +++ b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml @@ -1,21 +1,15 @@  + xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"> - - - - - - - + + + + diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs index 90559707f9..a5c3008436 100644 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs @@ -1,7 +1,5 @@ using Content.Client.Station; -using Content.Client.UserInterface.Controls; using Robust.Client.AutoGenerated; -using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.XAML; using Robust.Shared.Map.Components; @@ -12,20 +10,20 @@ namespace Content.Client.Administration.UI.Tabs.ObjectsTab; [GenerateTypedNameReferences] public sealed partial class ObjectsTab : Control { - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly EntityManager _entityManager = default!; [Dependency] private readonly IGameTiming _timing = default!; private readonly List _objects = new(); - private readonly List _selections = new(); - private bool _ascending = false; // Set to false for descending order by default - private ObjectsTabHeader.Header _headerClicked = ObjectsTabHeader.Header.ObjectName; - private readonly Color _altColor = Color.FromHex("#292B38"); - private readonly Color _defaultColor = Color.FromHex("#2F2F3B"); + private List _selections = new(); - public event Action? OnEntryKeyBindDown; + public event Action? OnEntryKeyBindDown; - private readonly TimeSpan _updateFrequency = TimeSpan.FromSeconds(2); - private TimeSpan _nextUpdate; + // Listen I could either have like 4 different event subscribers (for map / grid / station changes) and manage their lifetimes in AdminUIController + // OR + // I can do this. + private TimeSpan _updateFrequency = TimeSpan.FromSeconds(2); + + private TimeSpan _nextUpdate = TimeSpan.FromSeconds(2); public ObjectsTab() { @@ -44,30 +42,6 @@ public sealed partial class ObjectsTab : Control ObjectTypeOptions.AddItem(Enum.GetName((ObjectsTabSelection)type)!); } - ListHeader.OnHeaderClicked += HeaderClicked; - SearchList.SearchBar = SearchLineEdit; - SearchList.GenerateItem += GenerateButton; - SearchList.DataFilterCondition += DataFilterCondition; - - RefreshObjectList(); - // Set initial selection and refresh the list to apply the initial sort order - var defaultSelection = ObjectsTabSelection.Grids; - ObjectTypeOptions.SelectId((int)defaultSelection); // Set the default selection - RefreshObjectList(defaultSelection); // Refresh the list with the default selection - - // Initialize the next update time - _nextUpdate = TimeSpan.Zero; - } - - protected override void FrameUpdate(FrameEventArgs args) - { - base.FrameUpdate(args); - - if (_timing.CurTime < _nextUpdate) - return; - - _nextUpdate = _timing.CurTime + _updateFrequency; - RefreshObjectList(); } @@ -107,72 +81,32 @@ public sealed partial class ObjectsTab : Control throw new ArgumentOutOfRangeException(nameof(selection), selection, null); } - entities.Sort((a, b) => + foreach (var control in _objects) { - var valueA = GetComparableValue(a, _headerClicked); - var valueB = GetComparableValue(b, _headerClicked); - return _ascending ? Comparer.Default.Compare(valueA, valueB) : Comparer.Default.Compare(valueB, valueA); - }); - - var listData = new List(); - for (int index = 0; index < entities.Count; index++) - { - var info = entities[index]; - listData.Add(new ObjectsListData(info, $"{info.Name} {info.Entity}", index % 2 == 0 ? _altColor : _defaultColor)); + ObjectList.RemoveChild(control); } - SearchList.PopulateList(listData); + _objects.Clear(); + + foreach (var (name, nent) in entities) + { + var ctrl = new ObjectsTabEntry(name, nent); + _objects.Add(ctrl); + ObjectList.AddChild(ctrl); + ctrl.OnKeyBindDown += args => OnEntryKeyBindDown?.Invoke(ctrl, args); + } } - private void GenerateButton(ListData data, ListContainerButton button) + protected override void FrameUpdate(FrameEventArgs args) { - if (data is not ObjectsListData { Info: var info, BackgroundColor: var backgroundColor }) + base.FrameUpdate(args); + + if (_timing.CurTime < _nextUpdate) return; - var entry = new ObjectsTabEntry(info.Name, info.Entity, new StyleBoxFlat { BackgroundColor = backgroundColor }); - button.ToolTip = $"{info.Name}, {info.Entity}"; + // I do not care for precision. + _nextUpdate = _timing.CurTime + _updateFrequency; - // Add key binding event handler - entry.OnKeyBindDown += args => OnEntryKeyBindDown?.Invoke(args, data); - - button.AddChild(entry); - } - - private bool DataFilterCondition(string filter, ListData listData) - { - if (listData is not ObjectsListData { FilteringString: var filteringString }) - return false; - - // If the filter is empty, do not filter out any entries - if (string.IsNullOrEmpty(filter)) - return true; - - return filteringString.Contains(filter, StringComparison.CurrentCultureIgnoreCase); - } - - private object GetComparableValue((string Name, NetEntity Entity) entity, ObjectsTabHeader.Header header) - { - return header switch - { - ObjectsTabHeader.Header.ObjectName => entity.Name, - ObjectsTabHeader.Header.EntityID => entity.Entity.ToString(), - _ => entity.Name - }; - } - - private void HeaderClicked(ObjectsTabHeader.Header header) - { - if (_headerClicked == header) - { - _ascending = !_ascending; - } - else - { - _headerClicked = header; - _ascending = true; - } - - ListHeader.UpdateHeaderSymbols(_headerClicked, _ascending); RefreshObjectList(); } @@ -184,4 +118,3 @@ public sealed partial class ObjectsTab : Control } } -public record ObjectsListData((string Name, NetEntity Entity) Info, string FilteringString, Color BackgroundColor) : ListData; diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabEntry.xaml b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabEntry.xaml index 83c4cc5697..0f6975e365 100644 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabEntry.xaml +++ b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabEntry.xaml @@ -1,6 +1,6 @@ - + + @@ -14,4 +14,4 @@ HorizontalExpand="True" ClipText="True"/> - + diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabEntry.xaml.cs b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabEntry.xaml.cs index aab06c6ccd..c9b2cd8b57 100644 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabEntry.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabEntry.xaml.cs @@ -1,21 +1,19 @@ using Robust.Client.AutoGenerated; -using Robust.Client.Graphics; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; namespace Content.Client.Administration.UI.Tabs.ObjectsTab; [GenerateTypedNameReferences] -public sealed partial class ObjectsTabEntry : PanelContainer +public sealed partial class ObjectsTabEntry : ContainerButton { public NetEntity AssocEntity; - public ObjectsTabEntry(string name, NetEntity nent, StyleBox styleBox) + public ObjectsTabEntry(string name, NetEntity nent) { RobustXamlLoader.Load(this); AssocEntity = nent; EIDLabel.Text = nent.ToString(); NameLabel.Text = name; - BackgroundColorPanel.PanelOverride = styleBox; } } diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabHeader.xaml b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabHeader.xaml deleted file mode 100644 index 71a1f5c7bc..0000000000 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabHeader.xaml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabHeader.xaml.cs b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabHeader.xaml.cs deleted file mode 100644 index 3a91b5b948..0000000000 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabHeader.xaml.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Robust.Client.AutoGenerated; -using Robust.Client.UserInterface; -using Robust.Client.UserInterface.Controls; -using Robust.Client.UserInterface.XAML; -using Robust.Shared.Input; - -namespace Content.Client.Administration.UI.Tabs.ObjectsTab -{ - [GenerateTypedNameReferences] - public sealed partial class ObjectsTabHeader : Control - { - public event Action
? OnHeaderClicked; - - private const string ArrowUp = "↑"; - private const string ArrowDown = "↓"; - - public ObjectsTabHeader() - { - RobustXamlLoader.Load(this); - - ObjectNameLabel.OnKeyBindDown += ObjectNameClicked; - EntityIDLabel.OnKeyBindDown += EntityIDClicked; - } - - public Label GetHeader(Header header) - { - return header switch - { - Header.ObjectName => ObjectNameLabel, - Header.EntityID => EntityIDLabel, - _ => throw new ArgumentOutOfRangeException(nameof(header), header, null) - }; - } - - public void ResetHeaderText() - { - ObjectNameLabel.Text = Loc.GetString("object-tab-object-name"); - EntityIDLabel.Text = Loc.GetString("object-tab-entity-id"); - } - - public void UpdateHeaderSymbols(Header headerClicked, bool ascending) - { - ResetHeaderText(); - var arrow = ascending ? ArrowUp : ArrowDown; - GetHeader(headerClicked).Text += $" {arrow}"; - } - - private void HeaderClicked(GUIBoundKeyEventArgs args, Header header) - { - if (args.Function != EngineKeyFunctions.UIClick) - { - return; - } - - OnHeaderClicked?.Invoke(header); - args.Handle(); - } - - private void ObjectNameClicked(GUIBoundKeyEventArgs args) - { - HeaderClicked(args, Header.ObjectName); - } - - private void EntityIDClicked(GUIBoundKeyEventArgs args) - { - HeaderClicked(args, Header.EntityID); - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - if (disposing) - { - ObjectNameLabel.OnKeyBindDown -= ObjectNameClicked; - EntityIDLabel.OnKeyBindDown -= EntityIDClicked; - } - } - - public enum Header - { - ObjectName, - EntityID - } - } -} diff --git a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs index 826945e7cc..a8bfaddecf 100644 --- a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs @@ -53,7 +53,6 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab SearchList.ItemKeyBindDown += (args, data) => OnEntryKeyBindDown?.Invoke(args, data); RefreshPlayerList(_adminSystem.PlayerList); - } #region Antag Overlay @@ -111,9 +110,7 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab _players = players; PlayerCount.Text = $"Players: {_playerMan.PlayerCount}"; - var filteredPlayers = players.Where(info => _showDisconnected || info.Connected).ToList(); - - var sortedPlayers = new List(filteredPlayers); + var sortedPlayers = new List(players); sortedPlayers.Sort(Compare); UpdateHeaderSymbols(); diff --git a/Content.Client/Construction/ConstructionSystem.cs b/Content.Client/Construction/ConstructionSystem.cs index 453658bebf..66000a8457 100644 --- a/Content.Client/Construction/ConstructionSystem.cs +++ b/Content.Client/Construction/ConstructionSystem.cs @@ -27,7 +27,6 @@ namespace Content.Client.Construction [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!; - [Dependency] private readonly ExamineSystemShared _examineSystem = default!; [Dependency] private readonly SharedTransformSystem _transformSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; @@ -196,8 +195,9 @@ namespace Content.Client.Construction if (GhostPresent(loc)) return false; + // This InRangeUnobstructed should probably be replaced with "is there something blocking us in that tile?" var predicate = GetPredicate(prototype.CanBuildInImpassable, loc.ToMap(EntityManager, _transformSystem)); - if (!_examineSystem.InRangeUnOccluded(user, loc, 20f, predicate: predicate)) + if (!_interactionSystem.InRangeUnobstructed(user, loc, 20f, predicate: predicate)) return false; if (!CheckConstructionConditions(prototype, loc, dir, user, showPopup: true)) diff --git a/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml b/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml index 322e4e66a9..eec5c229cb 100644 --- a/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml +++ b/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml @@ -8,7 +8,7 @@ - + diff --git a/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml.cs b/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml.cs index 9f3d5695bb..ad19bc30f4 100644 --- a/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml.cs +++ b/Content.Client/Construction/UI/FlatpackCreatorMenu.xaml.cs @@ -23,6 +23,7 @@ public sealed partial class FlatpackCreatorMenu : FancyWindow private readonly ItemSlotsSystem _itemSlots; private readonly FlatpackSystem _flatpack; private readonly MaterialStorageSystem _materialStorage; + private readonly SpriteSystem _spriteSystem; private readonly EntityUid _owner; @@ -30,6 +31,7 @@ public sealed partial class FlatpackCreatorMenu : FancyWindow public const string NoBoardEffectId = "FlatpackerNoBoardEffect"; private EntityUid? _currentBoard = EntityUid.Invalid; + private EntityUid? _machinePreview; public event Action? PackButtonPressed; @@ -41,6 +43,7 @@ public sealed partial class FlatpackCreatorMenu : FancyWindow _itemSlots = _entityManager.System(); _flatpack = _entityManager.System(); _materialStorage = _entityManager.System(); + _spriteSystem = _entityManager.System(); _owner = uid; @@ -54,10 +57,17 @@ public sealed partial class FlatpackCreatorMenu : FancyWindow { base.FrameUpdate(args); + if (_machinePreview is not { } && _entityManager.Deleted(_machinePreview)) + { + _machinePreview = null; + MachineSprite.SetEntity(_machinePreview); + } + if (!_entityManager.TryGetComponent(_owner, out var flatpacker) || !_itemSlots.TryGetSlot(_owner, flatpacker.SlotId, out var itemSlot)) return; + MachineBoardComponent? machineBoardComp = null; if (flatpacker.Packing) { PackButton.Disabled = true; @@ -65,10 +75,11 @@ public sealed partial class FlatpackCreatorMenu : FancyWindow else if (_currentBoard != null) { Dictionary cost; - if (_entityManager.TryGetComponent(_currentBoard, out var machineBoardComp)) + if (_entityManager.TryGetComponent(_currentBoard, out machineBoardComp) && + machineBoardComp.Prototype is not null) cost = _flatpack.GetFlatpackCreationCost((_owner, flatpacker), (_currentBoard.Value, machineBoardComp)); else - cost = _flatpack.GetFlatpackCreationCost((_owner, flatpacker), null); + cost = _flatpack.GetFlatpackCreationCost((_owner, flatpacker)); PackButton.Disabled = !_materialStorage.CanChangeMaterialAmount(_owner, cost); } @@ -76,6 +87,9 @@ public sealed partial class FlatpackCreatorMenu : FancyWindow if (_currentBoard == itemSlot.Item) return; + if (_machinePreview != null) + _entityManager.DeleteEntity(_machinePreview); + _currentBoard = itemSlot.Item; CostHeaderLabel.Visible = _currentBoard != null; InsertLabel.Visible = _currentBoard == null; @@ -85,32 +99,35 @@ public sealed partial class FlatpackCreatorMenu : FancyWindow string? prototype = null; Dictionary? cost = null; - if (_entityManager.TryGetComponent(_currentBoard, out var newMachineBoardComp)) + if (machineBoardComp != null || _entityManager.TryGetComponent(_currentBoard, out machineBoardComp)) { - prototype = newMachineBoardComp.Prototype; - cost = _flatpack.GetFlatpackCreationCost((_owner, flatpacker), (_currentBoard.Value, newMachineBoardComp)); + prototype = machineBoardComp.Prototype; + cost = _flatpack.GetFlatpackCreationCost((_owner, flatpacker), (_currentBoard.Value, machineBoardComp)); } else if (_entityManager.TryGetComponent(_currentBoard, out var computerBoard)) { prototype = computerBoard.Prototype; - cost = _flatpack.GetFlatpackCreationCost((_owner, flatpacker), null); + cost = _flatpack.GetFlatpackCreationCost((_owner, flatpacker)); } if (prototype is not null && cost is not null) { var proto = _prototypeManager.Index(prototype); - MachineSprite.SetPrototype(prototype); + _machinePreview = _entityManager.Spawn(proto.ID); + _spriteSystem.ForceUpdate(_machinePreview.Value); MachineNameLabel.SetMessage(proto.Name); CostLabel.SetMarkup(GetCostString(cost)); } } else { - MachineSprite.SetPrototype(NoBoardEffectId); + _machinePreview = _entityManager.Spawn(NoBoardEffectId); CostLabel.SetMessage(Loc.GetString("flatpacker-ui-no-board-label")); MachineNameLabel.SetMessage(" "); PackButton.Disabled = true; } + + MachineSprite.SetEntity(_machinePreview); } private string GetCostString(Dictionary costs) @@ -132,7 +149,7 @@ public sealed partial class FlatpackCreatorMenu : FancyWindow ("amount", amountText), ("material", Loc.GetString(matProto.Name))); - msg.TryAddMarkup(text, out _); + msg.AddMarkup(text); if (i != orderedCosts.Length - 1) msg.PushNewline(); @@ -140,4 +157,12 @@ public sealed partial class FlatpackCreatorMenu : FancyWindow return msg.ToMarkup(); } + + public override void Close() + { + base.Close(); + + _entityManager.DeleteEntity(_machinePreview); + _machinePreview = null; + } } diff --git a/Content.Client/Entry/EntryPoint.cs b/Content.Client/Entry/EntryPoint.cs index bc3b9b6dec..452b091ea6 100644 --- a/Content.Client/Entry/EntryPoint.cs +++ b/Content.Client/Entry/EntryPoint.cs @@ -2,9 +2,11 @@ using Content.Client.Administration.Managers; using Content.Client.Changelog; using Content.Client.Chat.Managers; using Content.Client.Eui; +using Content.Client.Flash; using Content.Client.Fullscreen; using Content.Client.GhostKick; using Content.Client.Guidebook; +using Content.Client.Info; using Content.Client.Input; using Content.Client.IoC; using Content.Client.Launcher; @@ -51,6 +53,7 @@ namespace Content.Client.Entry [Dependency] private readonly IScreenshotHook _screenshotHook = default!; [Dependency] private readonly FullscreenHook _fullscreenHook = default!; [Dependency] private readonly ChangelogManager _changelogManager = default!; + [Dependency] private readonly RulesManager _rulesManager = default!; [Dependency] private readonly ViewportManager _viewportManager = default!; [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; [Dependency] private readonly IInputManager _inputManager = default!; @@ -123,6 +126,7 @@ namespace Content.Client.Entry _screenshotHook.Initialize(); _fullscreenHook.Initialize(); _changelogManager.Initialize(); + _rulesManager.Initialize(); _viewportManager.Initialize(); _ghostKick.Initialize(); _extendedDisconnectInformation.Initialize(); diff --git a/Content.Client/GameTicking/Managers/ClientGameTicker.cs b/Content.Client/GameTicking/Managers/ClientGameTicker.cs index fcf5ae91a4..309db2eb4e 100644 --- a/Content.Client/GameTicking/Managers/ClientGameTicker.cs +++ b/Content.Client/GameTicking/Managers/ClientGameTicker.cs @@ -4,12 +4,10 @@ using Content.Client.Lobby; using Content.Client.RoundEnd; using Content.Shared.GameTicking; using Content.Shared.GameWindow; -using Content.Shared.Roles; using JetBrains.Annotations; using Robust.Client.Graphics; using Robust.Client.State; using Robust.Client.UserInterface; -using Robust.Shared.Prototypes; namespace Content.Client.GameTicking.Managers { @@ -19,9 +17,10 @@ namespace Content.Client.GameTicking.Managers [Dependency] private readonly IStateManager _stateManager = default!; [Dependency] private readonly IClientAdminManager _admin = default!; [Dependency] private readonly IClyde _clyde = default!; + [Dependency] private readonly SharedMapSystem _map = default!; [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; - private Dictionary, int?>> _jobsAvailable = new(); + private Dictionary> _jobsAvailable = new(); private Dictionary _stationNames = new(); [ViewVariables] public bool AreWeReady { get; private set; } @@ -33,13 +32,13 @@ namespace Content.Client.GameTicking.Managers [ViewVariables] public TimeSpan StartTime { get; private set; } [ViewVariables] public new bool Paused { get; private set; } - [ViewVariables] public IReadOnlyDictionary, int?>> JobsAvailable => _jobsAvailable; + [ViewVariables] public IReadOnlyDictionary> JobsAvailable => _jobsAvailable; [ViewVariables] public IReadOnlyDictionary StationNames => _stationNames; public event Action? InfoBlobUpdated; public event Action? LobbyStatusUpdated; public event Action? LobbyLateJoinStatusUpdated; - public event Action, int?>>>? LobbyJobsAvailableUpdated; + public event Action>>? LobbyJobsAvailableUpdated; public override void Initialize() { @@ -70,7 +69,7 @@ namespace Content.Client.GameTicking.Managers // reading the console. E.g., logs like this one could leak the nuke station/grid: // > Grid NT-Arrivals 1101 (122/n25896) changed parent. Old parent: map 10 (121/n25895). New parent: FTL (123/n26470) #if !DEBUG - EntityManager.System().Log.Level = _admin.IsAdmin() ? LogLevel.Info : LogLevel.Warning; + _map.Log.Level = _admin.IsAdmin() ? LogLevel.Info : LogLevel.Warning; #endif } diff --git a/Content.Client/Guidebook/Components/GuideHelpComponent.cs b/Content.Client/Guidebook/Components/GuideHelpComponent.cs index bb1d30bbc1..db19bb9dcc 100644 --- a/Content.Client/Guidebook/Components/GuideHelpComponent.cs +++ b/Content.Client/Guidebook/Components/GuideHelpComponent.cs @@ -1,5 +1,4 @@ -using Content.Shared.Guidebook; -using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; namespace Content.Client.Guidebook.Components; @@ -14,8 +13,9 @@ public sealed partial class GuideHelpComponent : Component /// What guides to include show when opening the guidebook. The first entry will be used to select the currently /// selected guidebook. /// - [DataField(required: true)] - public List> Guides = new(); + [DataField("guides", customTypeSerializer: typeof(PrototypeIdListSerializer), required: true)] + [ViewVariables] + public List Guides = new(); /// /// Whether or not to automatically include the children of the given guides. diff --git a/Content.Client/Guidebook/Controls/GuidebookWindow.xaml b/Content.Client/Guidebook/Controls/GuidebookWindow.xaml index b52eacfa72..8dbfde3c47 100644 --- a/Content.Client/Guidebook/Controls/GuidebookWindow.xaml +++ b/Content.Client/Guidebook/Controls/GuidebookWindow.xaml @@ -2,7 +2,7 @@ xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls" xmlns:fancyTree="clr-namespace:Content.Client.UserInterface.Controls.FancyTree" xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" - SetSize="850 700" + SetSize="750 700" MinSize="100 200" Resizable="True" Title="{Loc 'guidebook-window-title'}"> @@ -18,16 +18,12 @@ Name="SearchBar" PlaceHolder="{Loc 'guidebook-filter-placeholder-text'}" HorizontalExpand="True" - Margin="0 5 10 5"> + Margin="0 5 10 5"> - - public sealed partial class DocumentParsingManager { - [Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IResourceManager _resourceManager = default!; [Dependency] private readonly ISandboxHelper _sandboxHelper = default!; private readonly Dictionary> _tagControlParsers = new(); @@ -42,21 +37,6 @@ public sealed partial class DocumentParsingManager ControlParser = SkipWhitespaces.Then(_controlParser.Many()); } - public bool TryAddMarkup(Control control, ProtoId entryId, bool log = true) - { - if (!_prototype.TryIndex(entryId, out var entry)) - return false; - - using var file = _resourceManager.ContentFileReadText(entry.Text); - return TryAddMarkup(control, file.ReadToEnd(), log); - } - - public bool TryAddMarkup(Control control, GuideEntry entry, bool log = true) - { - using var file = _resourceManager.ContentFileReadText(entry.Text); - return TryAddMarkup(control, file.ReadToEnd(), log); - } - public bool TryAddMarkup(Control control, string text, bool log = true) { try diff --git a/Content.Shared/Guidebook/GuideEntry.cs b/Content.Client/Guidebook/GuideEntry.cs similarity index 67% rename from Content.Shared/Guidebook/GuideEntry.cs rename to Content.Client/Guidebook/GuideEntry.cs index d39e6c9315..3f9ce31ad0 100644 --- a/Content.Shared/Guidebook/GuideEntry.cs +++ b/Content.Client/Guidebook/GuideEntry.cs @@ -1,13 +1,8 @@ using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; using Robust.Shared.Utility; -namespace Content.Shared.Guidebook; - -[Prototype("guideEntry")] -public sealed partial class GuideEntryPrototype : GuideEntry, IPrototype -{ - public string ID => Id; -} +namespace Content.Client.Guidebook; [Virtual] public class GuideEntry @@ -15,7 +10,7 @@ public class GuideEntry /// /// The file containing the contents of this guide. /// - [DataField(required: true)] public ResPath Text = default!; + [DataField("text", required: true)] public ResPath Text = default!; /// /// The unique id for this guide. @@ -26,27 +21,31 @@ public class GuideEntry /// /// The name of this guide. This gets localized. /// - [DataField(required: true)] public string Name = default!; + [DataField("name", required: true)] public string Name = default!; /// /// The "children" of this guide for when guides are shown in a tree / table of contents. /// - [DataField] - public List> Children = new(); + [DataField("children", customTypeSerializer:typeof(PrototypeIdListSerializer))] + public List Children = new(); /// /// Enable filtering of items. /// - [DataField] public bool FilterEnabled = default!; - - [DataField] public bool RuleEntry; + [DataField("filterEnabled")] public bool FilterEnabled = default!; /// /// Priority for sorting top-level guides when shown in a tree / table of contents. /// If the guide is the child of some other guide, the order simply determined by the order of children in . /// - [DataField] public int Priority = 0; + [DataField("priority")] public int Priority = 0; [DataField] public bool CrystallPunkAllowed = false; } + +[Prototype("guideEntry")] +public sealed partial class GuideEntryPrototype : GuideEntry, IPrototype +{ + public string ID => Id; +} diff --git a/Content.Client/Guidebook/GuidebookSystem.cs b/Content.Client/Guidebook/GuidebookSystem.cs index 9bc44aa916..a0532294d6 100644 --- a/Content.Client/Guidebook/GuidebookSystem.cs +++ b/Content.Client/Guidebook/GuidebookSystem.cs @@ -2,7 +2,6 @@ using System.Linq; using Content.Client.Guidebook.Components; using Content.Client.Light; using Content.Client.Verbs; -using Content.Shared.Guidebook; using Content.Shared.Interaction; using Content.Shared.Light.Components; using Content.Shared.Speech; @@ -35,12 +34,7 @@ public sealed class GuidebookSystem : EntitySystem [Dependency] private readonly IPrototypeManager _proto = default!; //CrystallPunk guidebook filter - public event Action>, - List>?, - ProtoId?, - bool, - ProtoId?>? OnGuidebookOpen; - + public event Action, List?, string?, bool, string?>? OnGuidebookOpen; public const string GuideEmbedTag = "GuideEmbeded"; private EntityUid _defaultUser; @@ -105,7 +99,7 @@ public sealed class GuidebookSystem : EntitySystem }); } - public void OpenHelp(List> guides) + public void OpenHelp(List guides) { OnGuidebookOpen?.Invoke(guides, null, null, true, guides[0]); } diff --git a/Content.Client/Info/InfoSystem.cs b/Content.Client/Info/InfoSystem.cs new file mode 100644 index 0000000000..b697994981 --- /dev/null +++ b/Content.Client/Info/InfoSystem.cs @@ -0,0 +1,25 @@ +using Content.Shared.Info; +using Robust.Shared.Log; + +namespace Content.Client.Info; + +public sealed class InfoSystem : EntitySystem +{ + public RulesMessage Rules = new RulesMessage("Server Rules", "The server did not send any rules."); + [Dependency] private readonly RulesManager _rules = default!; + + public override void Initialize() + { + base.Initialize(); + SubscribeNetworkEvent(OnRulesReceived); + Log.Debug("Requested server info."); + RaiseNetworkEvent(new RequestRulesMessage()); + } + + private void OnRulesReceived(RulesMessage message, EntitySessionEventArgs eventArgs) + { + Log.Debug("Received server rules."); + Rules = message; + _rules.UpdateRules(); + } +} diff --git a/Content.Client/Info/RulesAndInfoWindow.cs b/Content.Client/Info/RulesAndInfoWindow.cs index b9131dcb3c..7a763a1d6f 100644 --- a/Content.Client/Info/RulesAndInfoWindow.cs +++ b/Content.Client/Info/RulesAndInfoWindow.cs @@ -1,8 +1,10 @@ using System.Numerics; using Content.Client.UserInterface.Systems.EscapeMenu; +using Robust.Client.ResourceManagement; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; +using Robust.Shared.Configuration; using Robust.Shared.ContentPack; namespace Content.Client.Info @@ -10,6 +12,7 @@ namespace Content.Client.Info public sealed class RulesAndInfoWindow : DefaultWindow { [Dependency] private readonly IResourceManager _resourceManager = default!; + [Dependency] private readonly RulesManager _rules = default!; public RulesAndInfoWindow() { @@ -19,14 +22,8 @@ namespace Content.Client.Info var rootContainer = new TabContainer(); - var rulesList = new RulesControl - { - Margin = new Thickness(10) - }; - var tutorialList = new Info - { - Margin = new Thickness(10) - }; + var rulesList = new Info(); + var tutorialList = new Info(); rootContainer.AddChild(rulesList); rootContainer.AddChild(tutorialList); @@ -34,6 +31,7 @@ namespace Content.Client.Info TabContainer.SetTabTitle(rulesList, Loc.GetString("ui-info-tab-rules")); TabContainer.SetTabTitle(tutorialList, Loc.GetString("ui-info-tab-tutorial")); + AddSection(rulesList, _rules.RulesSection()); PopulateTutorial(tutorialList); Contents.AddChild(rootContainer); diff --git a/Content.Client/Info/RulesControl.xaml b/Content.Client/Info/RulesControl.xaml index 04fa719123..3b24764688 100644 --- a/Content.Client/Info/RulesControl.xaml +++ b/Content.Client/Info/RulesControl.xaml @@ -1,18 +1,6 @@ - - - - - - -