From f44178bec3db0358ffcc6b55866cef1f68341c60 Mon Sep 17 00:00:00 2001 From: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Date: Tue, 4 Aug 2026 11:27:55 -0500 Subject: [PATCH] Character Height Slider + Character Height Changes (#6320) * Do the thing for everyone. Height is now +/- 20% for everyone. * Make the height slider show height. Solve for special cases. Solve world hunger. * Fixed some minor things. * Adjust some densities * Smaller character balance * Comment * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Oops, that was from a failed thing. * Size calc correction * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * people are tall in the future * I need to refactor a bit still. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor into a system * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * smol * Fixed remaining scale visual components and species * Remove MockScale. Just add scale visuals for Allalulo to compensate. * PR feedback * Slight refactor. Moved profile/species scale out of the scale system and put it into the HumanoidProfileSystem. Removed some CD logic that is no longer needed. * how'd this get in there * Move the other motorkind.yml to AprilFools dir * NO NO_PENTALTY lol * Other PR stuff * Other PR stuff * Add a dirty * Add some networking to the comp * Add small character to cloning * One more fixX --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../UI/HumanoidProfileEditor.Appearance.cs | 18 ++- .../Lobby/UI/HumanoidProfileEditor.xaml | 8 +- .../Lobby/UI/HumanoidProfileEditor.xaml.cs | 42 ++--- .../_CD/Records/UI/CharacterRecordViewer.xaml | 5 - .../Records/UI/CharacterRecordViewer.xaml.cs | 3 +- .../_CD/Records/UI/RecordEditorGui.xaml | 6 - .../_CD/Records/UI/RecordEditorGui.xaml.cs | 17 +- .../_CD/Records/UI/UnitConversion.cs | 40 ++++- Content.Shared/Body/SharedVisualBodySystem.cs | 33 +--- .../Humanoid/HumanoidProfileSystem.cs | 17 ++ .../Humanoid/Prototypes/SpeciesPrototype.cs | 7 +- .../Movement/Pulling/Systems/PullingSystem.cs | 12 ++ .../Preferences/HumanoidCharacterProfile.cs | 2 +- .../Sprite/ScaleVisualsComponent.cs | 8 - .../Sprite/SharedScaleVisualsSystem.cs | 7 +- .../Components/SmallCharacterComponent.cs | 23 +++ .../UnaffectedBySizePenaltyComponent.cs | 12 ++ .../_DV/Body/Systems/SmallCharacterSystem.cs | 97 ++++++++++++ .../ui/humanoid-profile-editor.ftl | 3 +- Resources/Prototypes/Body/Species/dwarf.yml | 4 +- .../Prototypes/Entities/Mobs/Player/clone.yml | 2 + .../Entities/Structures/base_structure.yml | 1 + Resources/Prototypes/Species/dwarf.yml | 1 + Resources/Prototypes/_DEN/Species/Ovinia.yml | 5 +- .../Species/{ => AprilFools}/motorkind.yml | 2 - .../Prototypes/_DV/Body/Species/felinid.yml | 2 - .../Prototypes/_DV/Body/Species/harpy.yml | 3 +- Resources/Prototypes/_DV/Body/Species/oni.yml | 2 - .../Prototypes/_DV/Body/Species/ovinia.yml | 4 +- .../Prototypes/_DV/Body/Species/rodentia.yml | 2 - .../Prototypes/_DV/Body/Species/shadekin.yml | 2 - .../Species/{ => AprilFools}/motorkind.yml | 5 +- Resources/Prototypes/_DV/Species/Oni.yml | 3 +- Resources/Prototypes/_DV/Species/felinid.yml | 3 +- Resources/Prototypes/_DV/Species/harpy.yml | 6 +- Resources/Prototypes/_DV/Species/kitsune.yml | 4 +- Resources/Prototypes/_DV/Species/rodentia.yml | 1 - .../_Impstation/Body/Species/thaven.yml | 4 +- .../Entities/Mobs/Player/allulalo.yml | 2 +- .../Entities/Mobs/Species/allulalo.yml | 106 +------------ .../_Impstation/Species/allulalo.yml | 149 +----------------- .../Prototypes/_Impstation/Species/thaven.yml | 1 - Resources/Prototypes/_RMC14/Species/avali.yml | 1 - .../Interface/Misc/Interface - Shortcut.lnk | Bin 1547 -> 0 bytes 44 files changed, 258 insertions(+), 417 deletions(-) create mode 100644 Content.Shared/_DV/Body/Components/SmallCharacterComponent.cs create mode 100644 Content.Shared/_DV/Body/Components/UnaffectedBySizePenaltyComponent.cs create mode 100644 Content.Shared/_DV/Body/Systems/SmallCharacterSystem.cs rename Resources/Prototypes/_DV/Body/Species/{ => AprilFools}/motorkind.yml (99%) rename Resources/Prototypes/_DV/Species/{ => AprilFools}/motorkind.yml (79%) delete mode 100644 Resources/Textures/_Impstation/Interface/Misc/Interface - Shortcut.lnk diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs index 6434aa5be99..6d92a109457 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs @@ -9,6 +9,8 @@ using Content.Shared.Preferences; using Robust.Client.UserInterface.Controls; using Robust.Shared.Enums; using Robust.Shared.Prototypes; +using Content.Client._CD.Records.UI; // DeltaV +using Content.Shared._DV.Body.Systems; // DeltaV namespace Content.Client.Lobby.UI; @@ -193,6 +195,7 @@ public sealed partial class HumanoidProfileEditor RefreshLoadouts(); UpdateSexControls(); // update sex for new species UpdateSpeciesGuidebookIcon(); + UpdateHeightControls(); // DeltaV ReloadPreview(); } @@ -204,23 +207,22 @@ public sealed partial class HumanoidProfileEditor ReloadProfilePreview(); } - private void UpdateHeightControls() { if (Profile == null) - { return; - } - var species = _species.Find(x => x.ID == Profile.Species); - if (species != null) - _defaultHeight = species.DefaultHeight; + var prototype = _prototypeManager.Index(Profile.Species); + _defaultHeight = prototype.DefaultHeight; - var prototype = _prototypeManager.Index(Profile.Species); var sliderPercent = (Profile.Height - prototype.MinHeight) / (prototype.MaxHeight - prototype.MinHeight); CDHeightSlider.Value = sliderPercent; - CDHeight.Text = Profile.Height.ToString(CultureInfo.InvariantCulture); + + var scaleReference = _defaultHeight * prototype.BaseScale.Y; + var newHeight = MathF.Round(MathHelper.Lerp(prototype.MinHeight, prototype.MaxHeight, sliderPercent), 2); + CDHeightLabel.Text = UnitConversion.GetMetricAndImperialDisplayFromScale(scaleReference * newHeight); + CDPullSpeedReductionLabel.Text = SmallCharacterSystem.GetPullSpeedPenaltyDisplayFromScale(newHeight); } // End CD - Character Records diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml index 06a33cd01b1..e0c9f1544aa 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml @@ -73,9 +73,13 @@