Рост снова можно настраивать
This commit is contained in:
@@ -165,7 +165,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
|
|||||||
_profile = profile;
|
_profile = profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntityUid EnsurePreviewDummy(HumanoidCharacterProfile profile)
|
public EntityUid EnsurePreviewDummy(HumanoidCharacterProfile profile)
|
||||||
{
|
{
|
||||||
if (_previewDummy != null)
|
if (_previewDummy != null)
|
||||||
return _previewDummy.Value;
|
return _previewDummy.Value;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Content.Client._Amour.CustomHeight;
|
using Content.Client._Amour.CustomHeight;
|
||||||
|
using Content.Client.Lobby;
|
||||||
using Content.Shared._Amour.CustomHeight;
|
using Content.Shared._Amour.CustomHeight;
|
||||||
using Content.Shared._Amour.LoggerExtension;
|
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Range = Robust.Client.UserInterface.Controls.Range;
|
using Range = Robust.Client.UserInterface.Controls.Range;
|
||||||
|
|
||||||
@@ -38,7 +38,13 @@ public sealed partial class HumanoidProfileEditor
|
|||||||
if (Profile is null)
|
if (Profile is null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!_entMan.TryGetComponent<CustomHeightComponent>(_previewDummy, out _))
|
var controller = UserInterfaceManager.GetUIController<LobbyUIController>();
|
||||||
|
var dummy = controller.GetPreviewDummy();
|
||||||
|
|
||||||
|
if (!dummy.HasValue)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_entMan.TryGetComponent<CustomHeightComponent>(dummy, out _))
|
||||||
{
|
{
|
||||||
HeightContainer.Visible = false;
|
HeightContainer.Visible = false;
|
||||||
return;
|
return;
|
||||||
@@ -48,11 +54,19 @@ public sealed partial class HumanoidProfileEditor
|
|||||||
_height.Value = Profile.Appearance.Height;
|
_height.Value = Profile.Appearance.Height;
|
||||||
|
|
||||||
UpdateHeightText();
|
UpdateHeightText();
|
||||||
|
|
||||||
|
SetDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetDummyHeight(byte height, bool changeHeightValue = true)
|
public void SetDummyHeight(byte height, bool changeHeightValue = true)
|
||||||
{
|
{
|
||||||
if (Profile is null || !_entMan.TryGetComponent<CustomHeightComponent>(_previewDummy, out var a))
|
var controller = UserInterfaceManager.GetUIController<LobbyUIController>();
|
||||||
|
var dummy = controller.GetPreviewDummy();
|
||||||
|
|
||||||
|
if (!dummy.HasValue)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (Profile is null || !_entMan.TryGetComponent<CustomHeightComponent>(dummy, out var a))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(changeHeightValue)
|
if(changeHeightValue)
|
||||||
@@ -62,7 +76,7 @@ public sealed partial class HumanoidProfileEditor
|
|||||||
|
|
||||||
UpdateHeightText();
|
UpdateHeightText();
|
||||||
|
|
||||||
IsDirty = true;
|
SetDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateHeightText()
|
public void UpdateHeightText()
|
||||||
|
|||||||
Reference in New Issue
Block a user