From fb5d1592a0df27ee8236b7d3172ef38ed2914c98 Mon Sep 17 00:00:00 2001 From: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Date: Wed, 30 Aug 2023 23:26:42 -0700 Subject: [PATCH] Loadout Improvements (#197) # Changelog :cl: - fix: Fixed loadouts duplicating infinitely when the server restarted - add: Loadouts can now be previewed in character selection - add: Clothing and Loadout previews can be disabled or enabled individually on the first character editor tab - add: Added various new loadout items --- .../Lobby/UI/LobbyCharacterPreviewPanel.cs | 15 + .../Preferences/UI/HumanoidProfileEditor.xaml | 124 ++-- .../UI/HumanoidProfileEditor.xaml.cs | 182 +++--- Content.Server/Database/ServerDbBase.cs | 8 +- .../GameTicking/GameTicker.Spawning.cs | 60 +- Content.Shared/CCVar/CCVars.cs | 14 + Content.Shared/Clothing/LoadoutSystem.cs | 86 +++ .../Loadouts/LoadoutPrototype.cs | 61 +- .../SimpleStation14/Parkstation.toml | 2 + .../ui/humanoid-profile-editor.ftl | 5 + .../Catalog/Fills/Lockers/heads.yml | 54 -- .../Loadouts/!loadoutexamples.yaml | 70 --- .../Loadouts/Jobs/Heads/chiefEngineer.yml | 31 + .../Jobs/Heads/chiefMedicalOfficer.yml | 51 ++ .../Loadouts/Jobs/Heads/headOfPersonnel.yml | 52 ++ .../Loadouts/Jobs/Heads/headOfSecurity.yml | 149 +++++ .../Loadouts/Jobs/Heads/quarterMaster.yml | 32 + .../Loadouts/Jobs/Heads/researchDirector.yml | 31 + .../Loadouts/Jobs/engineering.yml | 139 ++++ .../SimpleStation14/Loadouts/Jobs/medical.yml | 136 ++++ .../SimpleStation14/Loadouts/Jobs/science.yml | 36 ++ .../Loadouts/Jobs/security.yml | 106 ++++ .../SimpleStation14/Loadouts/Jobs/service.yml | 175 ++++++ .../SimpleStation14/Loadouts/eyes.yml | 8 - .../SimpleStation14/Loadouts/head.yml | 90 --- .../SimpleStation14/Loadouts/items.yml | 50 +- .../SimpleStation14/Loadouts/jobs.yml | 591 ------------------ .../SimpleStation14/Loadouts/neck.yml | 81 +-- .../Loadouts/outerClothing.yml | 40 -- .../SimpleStation14/Loadouts/shoes.yml | 92 +++ 30 files changed, 1429 insertions(+), 1142 deletions(-) create mode 100644 Content.Shared/Clothing/LoadoutSystem.cs delete mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/!loadoutexamples.yaml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/Heads/chiefEngineer.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/Heads/chiefMedicalOfficer.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/Heads/headOfPersonnel.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/Heads/headOfSecurity.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/Heads/quarterMaster.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/Heads/researchDirector.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/engineering.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/medical.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/science.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/security.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/Jobs/service.yml delete mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/jobs.yml create mode 100644 Resources/Prototypes/SimpleStation14/Loadouts/shoes.yml diff --git a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs index abfda7da2f..edc8431abe 100644 --- a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs +++ b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs @@ -1,13 +1,17 @@ using System.Linq; using System.Numerics; using Content.Client.Alerts; +using Content.Client.Hands.Systems; using Content.Client.Humanoid; using Content.Client.Inventory; using Content.Client.Preferences; using Content.Client.UserInterface.Controls; +using Content.Shared.Clothing; +using Content.Shared.Clothing.Components; using Content.Shared.GameTicking; using Content.Shared.Humanoid.Prototypes; using Content.Shared.Inventory; +using Content.Shared.SimpleStation14.Loadouts; using Content.Shared.Preferences; using Content.Shared.Roles; using Content.Shared.Traits; @@ -136,6 +140,7 @@ public void UpdateUI() _summaryLabel.Text = selectedCharacter.Summary; _entityManager.System().LoadProfile(_previewDummy.Value, selectedCharacter); GiveDummyJobClothes(_previewDummy.Value, selectedCharacter); + GiveDummyLoadoutItems(_previewDummy.Value, selectedCharacter); // Parkstation-Loadouts } } } @@ -190,5 +195,15 @@ public static void GiveDummyJobClothes(EntityUid dummy, HumanoidCharacterProfile } } } + + // Parkstation-Loadouts-Start + public static void GiveDummyLoadoutItems(EntityUid dummy, HumanoidCharacterProfile profile) + { + var highPriorityJobId = profile.JobPriorities.FirstOrDefault(j => j.Value == JobPriority.High).Key; + var highPriorityJob = IoCManager.Resolve().Index(highPriorityJobId ?? SharedGameTicker.FallbackOverflowJob); + + EntitySystem.Get().ApplyCharacterLoadout(dummy, highPriorityJob, profile); + } + // Parkstation-Loadouts-End } } diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml index 6060b3d21f..9f44029a49 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml @@ -62,75 +62,72 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -