From f024f46b0b4c517848471be9ef6cac1c695d57b3 Mon Sep 17 00:00:00 2001 From: Lyndomen <49795619+Lyndomen@users.noreply.github.com> Date: Tue, 11 Mar 2025 11:34:45 -0400 Subject: [PATCH] Port Height & Records Computer from Cosmatic Drift (#2236) * Port character records from CD * Make species' base scales respected by CD heights * Hide the height editor in the humanoid profile editor --------- Co-authored-by: Janet Blackquill --- .../UI/Tabs/AdminTab/AdminTab.xaml | 3 + .../Humanoid/HumanoidAppearanceSystem.cs | 10 + .../Lobby/UI/HumanoidProfileEditor.xaml | 9 + .../Lobby/UI/HumanoidProfileEditor.xaml.cs | 104 + .../_CD/Admin/UI/ModifyCharacterRecords.xaml | 14 + .../Admin/UI/ModifyCharacterRecords.xaml.cs | 48 + ...haracterRecordConsoleBoundUserInterface.cs | 75 + .../_CD/Records/UI/CharacterRecordViewer.xaml | 117 + .../Records/UI/CharacterRecordViewer.xaml.cs | 450 ++++ .../Records/UI/RecordEditorEntrySelector.xaml | 14 + .../UI/RecordEditorEntrySelector.xaml.cs | 135 + .../_CD/Records/UI/RecordEditorGui.xaml | 68 + .../_CD/Records/UI/RecordEditorGui.xaml.cs | 155 ++ .../_CD/Records/UI/RecordEntryEditPopup.xaml | 36 + .../Records/UI/RecordEntryEditPopup.xaml.cs | 145 ++ .../_CD/Records/UI/RecordEntryViewPopup.xaml | 38 + .../Records/UI/RecordEntryViewPopup.xaml.cs | 46 + .../_CD/Records/UI/RecordLongItemDisplay.cs | 65 + .../_CD/Records/UI/UnitConversion.cs | 16 + Content.Server.Database/CDModel.cs | 56 + ..._CosmaticDriftCharacterRecords.Designer.cs | 2216 +++++++++++++++++ ...303043202_CosmaticDriftCharacterRecords.cs | 86 + .../PostgresServerDbContextModelSnapshot.cs | 104 + ..._CosmaticDriftCharacterRecords.Designer.cs | 2137 ++++++++++++++++ ...303043130_CosmaticDriftCharacterRecords.cs | 84 + .../SqliteServerDbContextModelSnapshot.cs | 101 + Content.Server.Database/Model.cs | 16 + Content.Server.Database/ModelSqlite.cs | 6 + Content.Server/Database/ServerDbBase.cs | 30 +- .../CharacterRecordKeyStorageComponent.cs | 17 + .../_CD/Records/CharacterRecordsComponent.cs | 31 + .../_CD/Records/CharacterRecordsSystem.cs | 194 ++ .../Records/Commands/DelRecordEntryCommand.cs | 55 + .../Commands/PurgeCharacterRecordsCommand.cs | 42 + .../CharacterRecordConsoleComponent.cs | 17 + .../Consoles/CharacterRecordConsoleSystem.cs | 152 ++ .../_CD/Records/RecordsSerialization.cs | 93 + .../SkipLoadingCharacterRecordsComponent.cs | 4 + .../Humanoid/HumanoidAppearanceComponent.cs | 8 + .../Humanoid/Prototypes/SpeciesPrototype.cs | 46 + .../SharedHumanoidAppearanceSystem.cs | 3 + .../Preferences/HumanoidCharacterProfile.cs | 61 +- .../_CD/Records/FullCharacterRecords.cs | 94 + .../Records/PlayerProvidedCharacterRecords.cs | 268 ++ .../Records/SharedCharacterRecordConsole.cs | 80 + Resources/Locale/en-US/_CD/admin/admin.ftl | 11 + .../Locale/en-US/_CD/guidebook/guides.ftl | 16 + .../ui/humanoid-profile-editor.ftl | 2 + .../Locale/en-US/_CD/records/corrections.ftl | 5 + Resources/Locale/en-US/_CD/records/editor.ftl | 40 + Resources/Locale/en-US/_CD/records/viewer.ftl | 26 + .../Entities/Mobs/Player/admin_ghost.yml | 28 + .../Machines/Computers/computers.yml | 34 +- Resources/Prototypes/Guidebook/newplayer.yml | 3 +- .../Prototypes/Nyanotrasen/Species/Oni.yml | 1 + .../Nyanotrasen/Species/felinid.yml | 1 + .../Prototypes/_CD/Guidebook/features.yml | 4 + Resources/Prototypes/_DV/Species/harpy.yml | 1 + Resources/Prototypes/_DV/Species/rodentia.yml | 1 + .../Prototypes/_Impstation/Species/thaven.yml | 1 + .../ServerInfo/Guidebook/_CD/Records.xml | 40 + 61 files changed, 7753 insertions(+), 10 deletions(-) create mode 100644 Content.Client/_CD/Admin/UI/ModifyCharacterRecords.xaml create mode 100644 Content.Client/_CD/Admin/UI/ModifyCharacterRecords.xaml.cs create mode 100644 Content.Client/_CD/Records/UI/CharacterRecordConsoleBoundUserInterface.cs create mode 100644 Content.Client/_CD/Records/UI/CharacterRecordViewer.xaml create mode 100644 Content.Client/_CD/Records/UI/CharacterRecordViewer.xaml.cs create mode 100644 Content.Client/_CD/Records/UI/RecordEditorEntrySelector.xaml create mode 100644 Content.Client/_CD/Records/UI/RecordEditorEntrySelector.xaml.cs create mode 100644 Content.Client/_CD/Records/UI/RecordEditorGui.xaml create mode 100644 Content.Client/_CD/Records/UI/RecordEditorGui.xaml.cs create mode 100644 Content.Client/_CD/Records/UI/RecordEntryEditPopup.xaml create mode 100644 Content.Client/_CD/Records/UI/RecordEntryEditPopup.xaml.cs create mode 100644 Content.Client/_CD/Records/UI/RecordEntryViewPopup.xaml create mode 100644 Content.Client/_CD/Records/UI/RecordEntryViewPopup.xaml.cs create mode 100644 Content.Client/_CD/Records/UI/RecordLongItemDisplay.cs create mode 100644 Content.Client/_CD/Records/UI/UnitConversion.cs create mode 100644 Content.Server.Database/CDModel.cs create mode 100644 Content.Server.Database/Migrations/Postgres/20250303043202_CosmaticDriftCharacterRecords.Designer.cs create mode 100644 Content.Server.Database/Migrations/Postgres/20250303043202_CosmaticDriftCharacterRecords.cs create mode 100644 Content.Server.Database/Migrations/Sqlite/20250303043130_CosmaticDriftCharacterRecords.Designer.cs create mode 100644 Content.Server.Database/Migrations/Sqlite/20250303043130_CosmaticDriftCharacterRecords.cs create mode 100644 Content.Server/_CD/Records/CharacterRecordKeyStorageComponent.cs create mode 100644 Content.Server/_CD/Records/CharacterRecordsComponent.cs create mode 100644 Content.Server/_CD/Records/CharacterRecordsSystem.cs create mode 100644 Content.Server/_CD/Records/Commands/DelRecordEntryCommand.cs create mode 100644 Content.Server/_CD/Records/Commands/PurgeCharacterRecordsCommand.cs create mode 100644 Content.Server/_CD/Records/Consoles/CharacterRecordConsoleComponent.cs create mode 100644 Content.Server/_CD/Records/Consoles/CharacterRecordConsoleSystem.cs create mode 100644 Content.Server/_CD/Records/RecordsSerialization.cs create mode 100644 Content.Server/_CD/Records/SkipLoadingCharacterRecordsComponent.cs create mode 100644 Content.Shared/_CD/Records/FullCharacterRecords.cs create mode 100644 Content.Shared/_CD/Records/PlayerProvidedCharacterRecords.cs create mode 100644 Content.Shared/_CD/Records/SharedCharacterRecordConsole.cs create mode 100644 Resources/Locale/en-US/_CD/admin/admin.ftl create mode 100644 Resources/Locale/en-US/_CD/guidebook/guides.ftl create mode 100644 Resources/Locale/en-US/_CD/preferences/ui/humanoid-profile-editor.ftl create mode 100644 Resources/Locale/en-US/_CD/records/corrections.ftl create mode 100644 Resources/Locale/en-US/_CD/records/editor.ftl create mode 100644 Resources/Locale/en-US/_CD/records/viewer.ftl create mode 100644 Resources/Prototypes/_CD/Guidebook/features.yml create mode 100644 Resources/ServerInfo/Guidebook/_CD/Records.xml diff --git a/Content.Client/Administration/UI/Tabs/AdminTab/AdminTab.xaml b/Content.Client/Administration/UI/Tabs/AdminTab/AdminTab.xaml index 8b68487547..b558d6114e 100644 --- a/Content.Client/Administration/UI/Tabs/AdminTab/AdminTab.xaml +++ b/Content.Client/Administration/UI/Tabs/AdminTab/AdminTab.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls" xmlns:at="clr-namespace:Content.Client.Administration.UI.Tabs.AdminTab" + xmlns:cdAdmin="clr-namespace:Content.Client._CD.Admin.UI" Margin="4" MinSize="50 50"> @@ -16,6 +17,8 @@ + + diff --git a/Content.Client/Humanoid/HumanoidAppearanceSystem.cs b/Content.Client/Humanoid/HumanoidAppearanceSystem.cs index 0416f4b813..d735e264ce 100644 --- a/Content.Client/Humanoid/HumanoidAppearanceSystem.cs +++ b/Content.Client/Humanoid/HumanoidAppearanceSystem.cs @@ -5,6 +5,8 @@ using Content.Shared.Preferences; using Robust.Client.GameObjects; using Robust.Shared.Prototypes; using Robust.Shared.Utility; +using System.Numerics; // CD - Character Records +using Robust.Client.Console; // CD - Character Records namespace Content.Client.Humanoid; @@ -30,6 +32,13 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem UpdateLayers(component, sprite); ApplyMarkingSet(component, sprite); + // Begin CD - Character Records + var speciesPrototype = _prototypeManager.Index(component.Species); + var height = Math.Clamp(MathF.Round(component.Height, 2), speciesPrototype.MinHeight, speciesPrototype.MaxHeight); // should NOT be locked, at all + + sprite.Scale = speciesPrototype.BaseScale * new Vector2(speciesPrototype.ScaleHeight ? height : 1f, height); // DV - CD Character Records shouldn't nuke species heights + // End CD - Character Records + sprite[sprite.LayerMapReserveBlank(HumanoidVisualLayers.Eyes)].Color = component.EyeColor; } @@ -199,6 +208,7 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem humanoid.Species = profile.Species; humanoid.SkinColor = profile.Appearance.SkinColor; humanoid.EyeColor = profile.Appearance.EyeColor; + humanoid.Height = profile.Height; // CD - Character Records UpdateSprite(humanoid, Comp(uid)); } diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml index 703b64bce3..54c6356d68 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml @@ -67,6 +67,15 @@ + + +