Multiline edit everywhere (#15216)

This commit is contained in:
Morb
2023-04-14 12:57:47 -07:00
committed by GitHub
parent b3ed09a3db
commit 2eb2ded7f3
12 changed files with 73 additions and 37 deletions

View File

@@ -1,8 +1,10 @@
using Content.Shared.Administration;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;
namespace Content.Client.Administration.UI
{
@@ -16,18 +18,18 @@ namespace Content.Client.Administration.UI
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
Announcement.Placeholder = new Rope.Leaf(_localization.GetString("admin-announce-announcement-placeholder"));
AnnounceMethod.AddItem(_localization.GetString("admin-announce-type-station"));
AnnounceMethod.SetItemMetadata(0, AdminAnnounceType.Station);
AnnounceMethod.AddItem(_localization.GetString("admin-announce-type-server"));
AnnounceMethod.SetItemMetadata(1, AdminAnnounceType.Server);
AnnounceMethod.OnItemSelected += AnnounceMethodOnOnItemSelected;
Announcement.OnTextChanged += AnnouncementOnOnTextChanged;
Announcement.OnKeyBindUp += AnnouncementOnOnTextChanged;
}
private void AnnouncementOnOnTextChanged(LineEdit.LineEditEventArgs args)
private void AnnouncementOnOnTextChanged(GUIBoundKeyEventArgs args)
{
AnnounceButton.Disabled = args.Text.TrimStart() == "";
AnnounceButton.Disabled = Rope.Collapse(Announcement.TextRope).TrimStart() == "";
}
private void AnnounceMethodOnOnItemSelected(OptionButton.ItemSelectedEventArgs args)