- add: interaction part 2
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client._Amour.InteractionPanel.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class InteractionPanelButton : ContainerButton
|
||||
{
|
||||
public event Action<string>? OnInteraction;
|
||||
|
||||
private string _interactionId = "Interaction";
|
||||
public string InteractionId
|
||||
{
|
||||
get => _interactionId;
|
||||
set
|
||||
{
|
||||
_interactionId = value;
|
||||
InteractionName.Text = Loc.GetString($"interaction-name-{_interactionId.ToLower()}");
|
||||
}
|
||||
}
|
||||
|
||||
public InteractionPanelButton()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
OnPressed += OnOnPressed;
|
||||
}
|
||||
|
||||
private void OnOnPressed(ButtonEventArgs obj)
|
||||
{
|
||||
OnInteraction?.Invoke(InteractionId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user