Improve paper stamping experience (#17135)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Content.Client.Eui;
|
||||
using Content.Client.Eui;
|
||||
using Content.Shared.Eui;
|
||||
using Content.Shared.Fax;
|
||||
using JetBrains.Annotations;
|
||||
@@ -15,7 +15,8 @@ public sealed class AdminFaxEui : BaseEui
|
||||
_window = new AdminFaxWindow();
|
||||
_window.OnClose += () => SendMessage(new AdminFaxEuiMsg.Close());
|
||||
_window.OnFollowFax += uid => SendMessage(new AdminFaxEuiMsg.Follow(uid));
|
||||
_window.OnMessageSend += args => SendMessage(new AdminFaxEuiMsg.Send(args.uid, args.title, args.from, args.message, args.stamp));
|
||||
_window.OnMessageSend += args => SendMessage(new AdminFaxEuiMsg.Send(args.uid, args.title,
|
||||
args.stampedBy, args.message, args.stampSprite, args.stampColor));
|
||||
}
|
||||
|
||||
public override void Opened()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<DefaultWindow xmlns="https://spacestation14.io"
|
||||
<DefaultWindow xmlns="https://spacestation14.io"
|
||||
Title="{Loc admin-fax-title}"
|
||||
MinWidth="400">
|
||||
<BoxContainer Orientation="Vertical" VerticalExpand="True">
|
||||
@@ -21,6 +21,8 @@
|
||||
<Control MinWidth="5" />
|
||||
<OptionButton Name="StampSelector" HorizontalExpand="True" />
|
||||
</BoxContainer>
|
||||
<Label Text="{Loc admin-fax-stamp-color}" />
|
||||
<ColorSelectorSliders Margin="12 0 0 0" Name="StampColorSelector" Color="#BB3232"/>
|
||||
<Control MinHeight="10" />
|
||||
<Button Name="SendButton" Text="{Loc admin-fax-send}"></Button>
|
||||
</BoxContainer>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Shared.Fax;
|
||||
using Content.Shared.Fax;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
@@ -13,7 +13,7 @@ public sealed partial class AdminFaxWindow : DefaultWindow
|
||||
{
|
||||
private const string StampsRsiPath = "/Textures/Objects/Misc/bureaucracy.rsi";
|
||||
|
||||
public Action<(EntityUid uid, string title, string from, string message, string stamp)>? OnMessageSend;
|
||||
public Action<(EntityUid uid, string title, string stampedBy, string message, string stampSprite, Color stampColor)>? OnMessageSend;
|
||||
public Action<EntityUid>? OnFollowFax;
|
||||
|
||||
public AdminFaxWindow()
|
||||
@@ -28,6 +28,9 @@ public sealed partial class AdminFaxWindow : DefaultWindow
|
||||
FollowButton.OnPressed += FollowFax;
|
||||
SendButton.OnPressed += SendMessage;
|
||||
|
||||
// Don't use this, but ColorSelectorSliders requires it:
|
||||
StampColorSelector.OnColorChanged += (Color) => {};
|
||||
|
||||
var loc = IoCManager.Resolve<ILocalizationManager>();
|
||||
MessageEdit.Placeholder = new Rope.Leaf(loc.GetString("admin-fax-message-placeholder")); // TextEdit work only with Nodes
|
||||
}
|
||||
@@ -90,6 +93,7 @@ public sealed partial class AdminFaxWindow : DefaultWindow
|
||||
return;
|
||||
|
||||
var from = FromEdit.Text;
|
||||
OnMessageSend?.Invoke((faxUid.Value, title, from, message, stamp));
|
||||
var stampColor = StampColorSelector.Color;
|
||||
OnMessageSend?.Invoke((faxUid.Value, title, from, message, stamp, stampColor));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user