Flavor text (#8070)

This commit is contained in:
Veritius
2022-05-14 08:58:45 +10:00
committed by GitHub
parent 83da49e1be
commit 3b7e202044
23 changed files with 2705 additions and 14 deletions

View File

@@ -0,0 +1,5 @@
<Control Name="CFlavorText" xmlns="https://spacestation14.io">
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<LineEdit Name="CFlavorTextInput" Access="Public" MinSize="220 0" HorizontalExpand="True" />
</BoxContainer>
</Control>

View File

@@ -0,0 +1,25 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.FlavorText
{
[GenerateTypedNameReferences]
public sealed partial class FlavorText : Control
{
public Action<string>? OnFlavorTextChanged;
public FlavorText()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
CFlavorTextInput.OnTextChanged += _ => FlavorTextChanged();
}
public void FlavorTextChanged()
{
OnFlavorTextChanged?.Invoke(CFlavorTextInput.Text);
}
}
}