- add: interaction part 2

This commit is contained in:
2024-02-23 18:52:03 +03:00
parent 28c8b45eec
commit 2ec981e9e6
22 changed files with 608 additions and 79 deletions

View File

@@ -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);
}
}