1
0

InfoSection.xaml.cs 698 B

12345678910111213141516171819202122232425
  1. using Robust.Client.AutoGenerated;
  2. using Robust.Client.UserInterface.Controls;
  3. using Robust.Client.UserInterface.XAML;
  4. using Robust.Shared.Utility;
  5. namespace Content.Client.Info;
  6. [GenerateTypedNameReferences]
  7. public sealed partial class InfoSection : BoxContainer
  8. {
  9. public InfoSection(string title, string text, bool markup = false)
  10. {
  11. RobustXamlLoader.Load(this);
  12. SetText(title, text, markup);
  13. }
  14. public void SetText(string title, string text, bool markup = false)
  15. {
  16. TitleLabel.Text = title;
  17. if (markup)
  18. Content.SetMessage(FormattedMessage.FromMarkupOrThrow(text.Trim()));
  19. else
  20. Content.SetMessage(text);
  21. }
  22. }