Xaml Rules and Info (#5741)
* XAMLify rules and info * Fix errors * Combine AddSection methods * Readd AddSection
This commit is contained in:
23
Content.Client/Info/InfoSection.xaml.cs
Normal file
23
Content.Client/Info/InfoSection.xaml.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Utility.Markup;
|
||||
|
||||
namespace Content.Client.Info;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class InfoSection : BoxContainer
|
||||
{
|
||||
public InfoSection(string title, string text, bool markup = false)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
TitleLabel.Text = title;
|
||||
|
||||
if (markup)
|
||||
Content.SetMessage(Basic.RenderMarkup(text.Trim()));
|
||||
else
|
||||
Content.SetMessage(text);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user