Add informations to cargo order form (#10513)

This commit is contained in:
corentt
2022-09-14 05:20:38 +02:00
committed by GitHub
parent 733090c95f
commit c4fde3b3eb
6 changed files with 31 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ using Content.Shared.Cargo.Prototypes;
using Content.Shared.IdentityManagement;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Shared.Utility;
using Robust.Shared.Prototypes;
using static Robust.Client.UserInterface.Controls.BaseButton;
@@ -52,6 +53,7 @@ namespace Content.Client.Cargo.BUI
var spriteSystem = sysManager.GetEntitySystem<SpriteSystem>();
_menu = new CargoConsoleMenu(IoCManager.Resolve<IPrototypeManager>(), spriteSystem);
var localPlayer = IoCManager.Resolve<IPlayerManager>()?.LocalPlayer?.ControlledEntity;
var description = new FormattedMessage();
string orderRequester;
@@ -68,10 +70,20 @@ namespace Content.Client.Cargo.BUI
{
if (args.Button.Parent is not CargoProductRow row)
return;
description.Clear();
description.PushColor(Color.White); // Rich text default color is grey
if (row.MainButton.ToolTip != null)
description.AddText(row.MainButton.ToolTip);
_orderMenu.Description.SetMessage(description);
_product = row.Product;
_orderMenu.ProductName.Text = row.ProductName.Text;
_orderMenu.PointCost.Text = row.PointCost.Text;
_orderMenu.Requester.Text = orderRequester;
_orderMenu.Reason.Text = "";
_orderMenu.Amount.Value = 1;
_orderMenu.OpenCentered();
};
_menu.OnOrderApproved += ApproveOrder;