From b83c5f4b2d2aeb3ae57032f9f9114ce4151a4e83 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 20 Jul 2022 19:29:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Lock=20actions=20during=20placem?= =?UTF-8?q?ent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/UfrmMain.pas | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Client/UfrmMain.pas b/Client/UfrmMain.pas index ca2f913..c6afe76 100644 --- a/Client/UfrmMain.pas +++ b/Client/UfrmMain.pas @@ -371,6 +371,7 @@ type { Methods } procedure BuildTileList; function ConfirmAction: Boolean; + procedure EnableActions(AEnabled: Boolean); function FindRandomPreset(AName: String): TDOMElement; procedure ForceUpdateCurrentTile; procedure GetDrawOffset(AX, AY: Integer; out DrawX, DrawY: Integer); inline; @@ -2008,6 +2009,8 @@ var begin // Make sure to reset the current view first. PreviewUoaDesign(nil); + acSelect.Checked := True; + EnableActions(False); UnregisterSelectionListener(@PlaceUoaDesign); UnregisterHoverListener(@PreviewUoaDesign); @@ -2338,6 +2341,7 @@ begin FCurrentUoaDesignAnchor := nil; vstUoaDesigns.Enabled := True; btnCancelUOAPlacement.Visible := False; + EnableActions(True); selectedNode := vstUoaDesigns.GetFirstSelected(); if selectedNode = nil then @@ -3629,6 +3633,15 @@ begin oglGameWindowMouseLeave(nil); end; +procedure TfrmMain.EnableActions(AEnabled: Boolean); +begin + acSelect.Enabled := AEnabled; + acMove.Enabled := AEnabled; + acElevate.Enabled := AEnabled; + acDelete.Enabled := AEnabled; + acHue.Enabled := AEnabled; +end; + function TfrmMain.FindRandomPreset(AName: String): TDOMElement; var preset: TDOMElement;