PDA Pen Holder (#2519)
* -Adds pens to pdas -Adds eject pen verb * Reviews: -Changed Container into ContainerSlot -Starting prototypes are now nullable -Removed double GetComp call * EjectPen Button
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Content.Client.GameObjects.Components.PDA
|
||||
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
|
||||
|
||||
private PDAMenu _menu;
|
||||
private PDAMenuPopup failPopup;
|
||||
private PDAMenuPopup _failPopup;
|
||||
|
||||
public PDABoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
|
||||
{
|
||||
@@ -47,6 +47,11 @@ namespace Content.Client.GameObjects.Components.PDA
|
||||
SendMessage(new PDAEjectIDMessage());
|
||||
};
|
||||
|
||||
_menu.EjectPenButton.OnPressed += args =>
|
||||
{
|
||||
SendMessage(new PDAEjectPenMessage());
|
||||
};
|
||||
|
||||
_menu.MasterTabContainer.OnTabChanged += i =>
|
||||
{
|
||||
var tab = _menu.MasterTabContainer.GetChild(i);
|
||||
@@ -60,12 +65,12 @@ namespace Content.Client.GameObjects.Components.PDA
|
||||
{
|
||||
if (_menu.CurrentLoggedInAccount.DataBalance < listing.Price)
|
||||
{
|
||||
failPopup = new PDAMenuPopup(Loc.GetString("Insufficient funds!"));
|
||||
_userInterfaceManager.ModalRoot.AddChild(failPopup);
|
||||
failPopup.Open(UIBox2.FromDimensions(_menu.Position.X + 150, _menu.Position.Y + 60, 156, 24));
|
||||
_failPopup = new PDAMenuPopup(Loc.GetString("Insufficient funds!"));
|
||||
_userInterfaceManager.ModalRoot.AddChild(_failPopup);
|
||||
_failPopup.Open(UIBox2.FromDimensions(_menu.Position.X + 150, _menu.Position.Y + 60, 156, 24));
|
||||
_menu.OnClose += () =>
|
||||
{
|
||||
failPopup.Dispose();
|
||||
_failPopup.Dispose();
|
||||
};
|
||||
}
|
||||
|
||||
@@ -106,6 +111,7 @@ namespace Content.Client.GameObjects.Components.PDA
|
||||
}
|
||||
|
||||
_menu.EjectIDButton.Visible = msg.PDAOwnerInfo.IdOwner != null;
|
||||
_menu.EjectPenButton.Visible = msg.HasPen;
|
||||
if (msg.Account != null)
|
||||
{
|
||||
_menu.CurrentLoggedInAccount = msg.Account;
|
||||
@@ -220,6 +226,7 @@ namespace Content.Client.GameObjects.Components.PDA
|
||||
|
||||
public Button FlashLightToggleButton { get; }
|
||||
public Button EjectIDButton { get; }
|
||||
public Button EjectPenButton { get; }
|
||||
|
||||
public TabContainer MasterTabContainer;
|
||||
|
||||
@@ -288,13 +295,20 @@ namespace Content.Client.GameObjects.Components.PDA
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter
|
||||
};
|
||||
EjectPenButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Eject Pen"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter
|
||||
};
|
||||
|
||||
var innerHBoxContainer = new HBoxContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
IDInfoLabel,
|
||||
EjectIDButton
|
||||
EjectIDButton,
|
||||
EjectPenButton
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user