Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Content.Client/_NF/Shipyard/UI/ShipyardConsoleMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@
<!-- Vessels get added here by code -->
</BoxContainer>
</ScrollContainer>
<GridContainer Columns="3" HorizontalExpand="True" Margin="0 8 0 2">
<Button Name="TargetIdButton" Access="Public"/>
<Button Name="SellShipButton"
Text="Sell"
Disabled="True" />
<BoxContainer Orientation="Vertical" Margin="0 8 0 2">
<BoxContainer HorizontalExpand="True">
<Button Name="TargetIdButton" Access="Public"/>
<Control HorizontalExpand="True"/>
<controls:ConfirmButton Name="SellShipButton"
Text="Sell" />
</BoxContainer>
<BoxContainer Orientation="Vertical" Name="NoDeedHelperContainer" Visible="True">
<Label Text="{Loc 'shipyard-console-no-idcard-helper-line1'}"/>
<Label Text="{Loc 'shipyard-console-no-idcard-helper-line2'}"/>
Expand All @@ -59,6 +61,6 @@
<Label Text="{Loc 'shipyard-console-deed-label'}"/>
<Label Name="DeedTitle" Text=""/>
</BoxContainer>
</GridContainer>
</BoxContainer>
</BoxContainer>
</controls:FancyWindow>
7 changes: 4 additions & 3 deletions Content.Client/_NF/Shipyard/UI/ShipyardConsoleMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public ShipyardConsoleMenu()
Categories.OnItemSelected += OnCategoryItemSelected;
Classes.OnItemSelected += OnClassItemSelected;
Engines.OnItemSelected += OnEngineItemSelected;
SellShipButton.OnPressed += (args) => { OnSellShip?.Invoke(args); };
SellShipButton.OnConfirming += OnStartConfirmingPurchaseOrSell;
SellShipButton.OnPressed += (args) => { _currentlyConfirmingButton = null; OnSellShip?.Invoke(args); };
}


Expand Down Expand Up @@ -147,7 +148,7 @@ private void AddVesselsToControls(IEnumerable<VesselPrototype?> vessels, string
Guidebook = { Disabled = prototype.GuidebookPage is null, TooltipDelay = 0.2f, ToolTip = prototype.Description },
Price = { Text = priceText },
};
vesselEntry.Purchase.OnConfirming += OnStartConfirmingPurchase;
vesselEntry.Purchase.OnConfirming += OnStartConfirmingPurchaseOrSell;
vesselEntry.Purchase.OnPressed += (args) => { _currentlyConfirmingButton = null; OnOrderApproved?.Invoke(args); };
Vessels.AddChild(vesselEntry);
}
Expand All @@ -156,7 +157,7 @@ private void AddVesselsToControls(IEnumerable<VesselPrototype?> vessels, string
/// <summary>
/// Confirming handler: ensures that only one button is confirming at a time.
/// </summary>
private void OnStartConfirmingPurchase(ButtonEventArgs args)
private void OnStartConfirmingPurchaseOrSell(ButtonEventArgs args)
{
if (args.Button is not ConfirmButton confirmButton)
return;
Expand Down
Loading