- add: More controls
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:humanoidProfileEditorExt="clr-namespace:Content.Client._Amour.HumanoidProfileEditorExt">
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<Label Text="{Loc 'genitals-group'}"/>
|
||||
<BoxContainer>
|
||||
<Label Text="{Loc 'genitals-group'}"/>
|
||||
<CheckBox Text="{Loc 'genitals-exide'}" Name="Exide"/>
|
||||
</BoxContainer>
|
||||
<BoxContainer Name="Container" Orientation="Vertical"></BoxContainer>
|
||||
</BoxContainer>
|
||||
</humanoidProfileEditorExt:GenitalBoxView>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client._Amour.HumanoidProfileEditorExt;
|
||||
@@ -10,6 +11,7 @@ public sealed partial class GenitalBoxView : Control
|
||||
public GenitalBoxView()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
}
|
||||
|
||||
public void AddChild(Control control)
|
||||
@@ -21,5 +23,10 @@ public sealed partial class GenitalBoxView : Control
|
||||
{
|
||||
Container.RemoveAllChildren();
|
||||
}
|
||||
|
||||
public void OnExide(Action<BaseButton.ButtonEventArgs> action)
|
||||
{
|
||||
Exide.OnPressed += action;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
using System.Linq;
|
||||
using Content.Client._Amour.Hole;
|
||||
using Content.Client._Amour.HumanoidProfileEditorExt;
|
||||
using Content.Shared._Amour.Hole;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
namespace Content.Client.Preferences.UI;
|
||||
|
||||
public sealed partial class HumanoidProfileEditor
|
||||
{
|
||||
private Dictionary<string, Genital> _genitals = new();
|
||||
private HoleSystem _holeSystem = default!;
|
||||
|
||||
private void InitializeGenitals()
|
||||
{
|
||||
_holeSystem = _entMan.System<HoleSystem>();
|
||||
GenitalBoxView.OnExide(OnExide);
|
||||
}
|
||||
|
||||
private void OnExide(BaseButton.ButtonEventArgs obj)
|
||||
{
|
||||
if (_entMan.TryGetComponent<HoleContainerComponent>(_previewDummy, out var component))
|
||||
{
|
||||
foreach (var entity in component.Slot.ContainedEntities)
|
||||
{
|
||||
_holeSystem.Exide(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateGenitalsControls()
|
||||
|
||||
Reference in New Issue
Block a user