MeleeSpeechWindow.xaml.cs 571 B

12345678910111213141516171819202122232425262728
  1. using Robust.Client.AutoGenerated;
  2. using Robust.Client.UserInterface.CustomControls;
  3. using Robust.Client.UserInterface.XAML;
  4. namespace Content.Client.Weapons.Melee.UI;
  5. [GenerateTypedNameReferences]
  6. public sealed partial class MeleeSpeechWindow : DefaultWindow
  7. {
  8. public event Action<string>? OnBattlecryEntered;
  9. public MeleeSpeechWindow()
  10. {
  11. RobustXamlLoader.Load(this);
  12. BattlecryLineEdit.OnTextEntered += e => OnBattlecryEntered?.Invoke(e.Text);
  13. }
  14. public void SetCurrentBattlecry(string battlecry)
  15. {
  16. BattlecryLineEdit.Text = battlecry;
  17. }
  18. }