From ddb49508eab54a6fe158051870e48f072d1f9a1c Mon Sep 17 00:00:00 2001 From: Jabak <163307958+Jabaks@users.noreply.github.com> Date: Wed, 31 Jul 2024 02:28:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=BE=D1=81=D1=82=20=D1=81=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=20=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=20=D0=BD=D0=B0?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B0=D0=B8=D0=B2=D0=B0=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Client/Lobby/LobbyUIController.cs | 2 +- .../HumanoidProfileEditor.Height.cs | 22 +++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Content.Client/Lobby/LobbyUIController.cs b/Content.Client/Lobby/LobbyUIController.cs index 9eb259657d..a1cebb8de1 100644 --- a/Content.Client/Lobby/LobbyUIController.cs +++ b/Content.Client/Lobby/LobbyUIController.cs @@ -165,7 +165,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered(_previewDummy, out _)) + var controller = UserInterfaceManager.GetUIController(); + var dummy = controller.GetPreviewDummy(); + + if (!dummy.HasValue) + return; + + if (!_entMan.TryGetComponent(dummy, out _)) { HeightContainer.Visible = false; return; @@ -48,11 +54,19 @@ public sealed partial class HumanoidProfileEditor _height.Value = Profile.Appearance.Height; UpdateHeightText(); + + SetDirty(); } public void SetDummyHeight(byte height, bool changeHeightValue = true) { - if (Profile is null || !_entMan.TryGetComponent(_previewDummy, out var a)) + var controller = UserInterfaceManager.GetUIController(); + var dummy = controller.GetPreviewDummy(); + + if (!dummy.HasValue) + return; + + if (Profile is null || !_entMan.TryGetComponent(dummy, out var a)) return; if(changeHeightValue) @@ -62,7 +76,7 @@ public sealed partial class HumanoidProfileEditor UpdateHeightText(); - IsDirty = true; + SetDirty(); } public void UpdateHeightText()