using Content.Shared._Horizon.FlavorText; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; using Robust.Client.UserInterface.XAML; using Robust.Shared.Utility; namespace Content.Client.FlavorText { [GenerateTypedNameReferences] public sealed partial class FlavorText : Control { public Action? OnFlavorTextChanged; // Horizon start public Action? OnErpStatChanged; public Action? OnOOCFlavorTextChanged; // Horizon end public FlavorText() { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); var loc = IoCManager.Resolve(); CFlavorTextInput.Placeholder = new Rope.Leaf(loc.GetString("flavor-text-placeholder")); CFlavorTextInput.OnTextChanged += _ => FlavorTextChanged(); // Horizon start ERPStatusButton.OnItemSelected += args => OnErpStatChanged?.Invoke(args.Id); OOCFlavorTextInput.Placeholder = new Rope.Leaf(loc.GetString("ooc-flavor-text-placeholder")); OOCFlavorTextInput.OnTextChanged += args => OnOOCFlavorTextChanged?.Invoke(Rope.Collapse(OOCFlavorTextInput.TextRope).Trim()); // Horizon end } public void FlavorTextChanged() { OnFlavorTextChanged?.Invoke(Rope.Collapse(CFlavorTextInput.TextRope).Trim()); } } }