Multiline edit everywhere (#15216)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<Control HorizontalExpand="True" SizeFlagsStretchRatio="1" />
|
||||
<OptionButton Name="AnnounceMethod" Access="Public" HorizontalExpand="True" SizeFlagsStretchRatio="2"/>
|
||||
</BoxContainer>
|
||||
<LineEdit Name="Announcement" Access="Public" PlaceHolder="{Loc admin-announce-announcement-placeholder}"/>
|
||||
<TextEdit Name="Announcement" Access="Public" VerticalExpand="True" MinHeight="100" />
|
||||
|
||||
<GridContainer Rows="1">
|
||||
<CheckBox Name="KeepWindowOpen" Access="Public" Text="{Loc 'admin-announce-keep-open'}" />
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Client.Eui;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.Administration.UI
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace Content.Client.Administration.UI
|
||||
{
|
||||
SendMessage(new AdminAnnounceEuiMsg.DoAnnounce
|
||||
{
|
||||
Announcement = _window.Announcement.Text,
|
||||
Announcement = Rope.Collapse(_window.Announcement.TextRope),
|
||||
Announcer = _window.Announcer.Text,
|
||||
AnnounceType = (AdminAnnounceType) (_window.AnnounceMethod.SelectedMetadata ?? AdminAnnounceType.Station),
|
||||
CloseAfter = !_window.KeepWindowOpen.Pressed,
|
||||
|
||||
Reference in New Issue
Block a user