Improve paper stamping experience (#17135)

This commit is contained in:
eoineoineoin
2023-08-13 19:28:10 +01:00
committed by GitHub
parent ae2dcc8aba
commit 4ccc8a04be
28 changed files with 629 additions and 202 deletions

View File

@@ -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));
}
}