Skip to content

Commit 7e6e829

Browse files
committed
Moved the sell button to the right side of the screen, also made it a ConfirmButton
1 parent acc57f1 commit 7e6e829

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Content.Client/_NF/Shipyard/UI/ShipyardConsoleMenu.xaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@
4646
<!-- Vessels get added here by code -->
4747
</BoxContainer>
4848
</ScrollContainer>
49-
<GridContainer Columns="3" HorizontalExpand="True" Margin="0 8 0 2">
50-
<Button Name="TargetIdButton" Access="Public"/>
51-
<Button Name="SellShipButton"
52-
Text="Sell"
53-
Disabled="True" />
49+
<BoxContainer Orientation="Vertical" Margin="0 8 0 2">
50+
<BoxContainer HorizontalExpand="True">
51+
<Button Name="TargetIdButton" Access="Public"/>
52+
<Control HorizontalExpand="True"/>
53+
<controls:ConfirmButton Name="SellShipButton"
54+
Text="Sell" />
55+
</BoxContainer>
5456
<BoxContainer Orientation="Vertical" Name="NoDeedHelperContainer" Visible="True">
5557
<Label Text="{Loc 'shipyard-console-no-idcard-helper-line1'}"/>
5658
<Label Text="{Loc 'shipyard-console-no-idcard-helper-line2'}"/>
@@ -59,6 +61,6 @@
5961
<Label Text="{Loc 'shipyard-console-deed-label'}"/>
6062
<Label Name="DeedTitle" Text=""/>
6163
</BoxContainer>
62-
</GridContainer>
64+
</BoxContainer>
6365
</BoxContainer>
6466
</controls:FancyWindow>

Content.Client/_NF/Shipyard/UI/ShipyardConsoleMenu.xaml.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public ShipyardConsoleMenu()
4141
Categories.OnItemSelected += OnCategoryItemSelected;
4242
Classes.OnItemSelected += OnClassItemSelected;
4343
Engines.OnItemSelected += OnEngineItemSelected;
44-
SellShipButton.OnPressed += (args) => { OnSellShip?.Invoke(args); };
44+
SellShipButton.OnConfirming += OnStartConfirmingPurchaseOrSell;
45+
SellShipButton.OnPressed += (args) => { _currentlyConfirmingButton = null; OnSellShip?.Invoke(args); };
4546
}
4647

4748

@@ -147,7 +148,7 @@ private void AddVesselsToControls(IEnumerable<VesselPrototype?> vessels, string
147148
Guidebook = { Disabled = prototype.GuidebookPage is null, TooltipDelay = 0.2f, ToolTip = prototype.Description },
148149
Price = { Text = priceText },
149150
};
150-
vesselEntry.Purchase.OnConfirming += OnStartConfirmingPurchase;
151+
vesselEntry.Purchase.OnConfirming += OnStartConfirmingPurchaseOrSell;
151152
vesselEntry.Purchase.OnPressed += (args) => { _currentlyConfirmingButton = null; OnOrderApproved?.Invoke(args); };
152153
Vessels.AddChild(vesselEntry);
153154
}
@@ -156,7 +157,7 @@ private void AddVesselsToControls(IEnumerable<VesselPrototype?> vessels, string
156157
/// <summary>
157158
/// Confirming handler: ensures that only one button is confirming at a time.
158159
/// </summary>
159-
private void OnStartConfirmingPurchase(ButtonEventArgs args)
160+
private void OnStartConfirmingPurchaseOrSell(ButtonEventArgs args)
160161
{
161162
if (args.Button is not ConfirmButton confirmButton)
162163
return;

0 commit comments

Comments
 (0)