Barber scissors fix (#22895)
* barber! * 5% change to maintenance * some fixes * refactor some * ElectroJR fix merge * aoa * remvoe humanoid * Magic mirror cleanup * Cleanup * Bunch more fixes * Fix nohair + range bugs * Fixes --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -30,6 +30,7 @@ public sealed class MagicMirrorBoundUserInterface : BoundUserInterface
|
||||
_window.OnFacialHairSlotAdded += delegate () { AddSlot(MagicMirrorCategory.FacialHair); };
|
||||
_window.OnFacialHairSlotRemoved += args => RemoveSlot(MagicMirrorCategory.FacialHair, args);
|
||||
|
||||
_window.OnClose += Close;
|
||||
_window.OpenCentered();
|
||||
}
|
||||
|
||||
@@ -53,17 +54,18 @@ public sealed class MagicMirrorBoundUserInterface : BoundUserInterface
|
||||
SendMessage(new MagicMirrorAddSlotMessage(category));
|
||||
}
|
||||
|
||||
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.ReceiveMessage(message);
|
||||
base.UpdateState(state);
|
||||
|
||||
if (message is not MagicMirrorUiData data || _window == null)
|
||||
if (state is not MagicMirrorUiState data || _window == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_window.UpdateState(data);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
|
||||
@@ -21,8 +21,6 @@ public sealed partial class MagicMirrorWindow : DefaultWindow
|
||||
public Action<int>? OnFacialHairSlotRemoved;
|
||||
public Action? OnFacialHairSlotAdded;
|
||||
|
||||
private bool _noHair;
|
||||
|
||||
public MagicMirrorWindow()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
@@ -38,15 +36,14 @@ public sealed partial class MagicMirrorWindow : DefaultWindow
|
||||
FacialHairPicker.OnSlotAdd += delegate { OnFacialHairSlotAdded!(); };
|
||||
}
|
||||
|
||||
public void UpdateState(MagicMirrorUiData state)
|
||||
public void UpdateState(MagicMirrorUiState state)
|
||||
{
|
||||
HairPicker.UpdateData(state.Hair, state.Species, state.HairSlotTotal);
|
||||
FacialHairPicker.UpdateData(state.FacialHair, state.Species, state.FacialHairSlotTotal);
|
||||
|
||||
if (!HairPicker.Visible && !FacialHairPicker.Visible && !_noHair)
|
||||
if (!HairPicker.Visible && !FacialHairPicker.Visible)
|
||||
{
|
||||
AddChild(new Label { Text = Loc.GetString("magic-mirror-component-activate-user-has-no-hair") });
|
||||
_noHair = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user