fish-station/Content.Client/_Sunrise/Razor/RazorWindow.xaml.cs
pacable 0fbd734906
Фикс парикмахера (#278)
* fix

Signed-off-by: JDtrimble <igor.mamaev1@gmail.com>

* accessfix

Signed-off-by: JDtrimble <igor.mamaev1@gmail.com>

* locale fix

Signed-off-by: JDtrimble <igor.mamaev1@gmail.com>

* accessfix

Signed-off-by: JDtrimble <igor.mamaev1@gmail.com>

---------

Signed-off-by: JDtrimble <igor.mamaev1@gmail.com>
2024-08-14 20:36:11 +03:00

45 lines
1.7 KiB
C#

// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt;
using Content.Shared._Sunrise.Razor;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client._Sunrise.Razor;
[GenerateTypedNameReferences]
public sealed partial class RazorWindow : DefaultWindow
{
public Action<(int slot, string id)>? OnHairSelected;
public Action<int>? OnHairSlotRemoved;
public Action? OnHairSlotAdded;
public Action<(int slot, string id)>? OnFacialHairSelected;
public Action<int>? OnFacialHairSlotRemoved;
public Action? OnFacialHairSlotAdded;
public RazorWindow()
{
RobustXamlLoader.Load(this);
HairPicker.OnMarkingSelect += args => OnHairSelected!(args);
HairPicker.OnSlotRemove += args => OnHairSlotRemoved!(args);
HairPicker.OnSlotAdd += delegate { OnHairSlotAdded!(); };
FacialHairPicker.OnMarkingSelect += args => OnFacialHairSelected!(args);
FacialHairPicker.OnSlotRemove += args => OnFacialHairSlotRemoved!(args);
FacialHairPicker.OnSlotAdd += delegate { OnFacialHairSlotAdded!(); };
}
public void UpdateState(RazorUiState state)
{
HairPicker.UpdateData(state.Hair, state.Species, state.HairSlotTotal);
FacialHairPicker.UpdateData(state.FacialHair, state.Species, state.FacialHairSlotTotal);
if (!HairPicker.Visible && !FacialHairPicker.Visible)
{
AddChild(new Label { Text = Loc.GetString("magic-mirror-component-activate-user-has-no-hair") });
}
}
}