🚸 Lock actions during placement

This commit is contained in:
Andreas Schneider 2022-07-20 19:29:55 +02:00
parent 54e7209c8d
commit b83c5f4b2d
1 changed files with 13 additions and 0 deletions

View File

@ -371,6 +371,7 @@ type
{ Methods } { Methods }
procedure BuildTileList; procedure BuildTileList;
function ConfirmAction: Boolean; function ConfirmAction: Boolean;
procedure EnableActions(AEnabled: Boolean);
function FindRandomPreset(AName: String): TDOMElement; function FindRandomPreset(AName: String): TDOMElement;
procedure ForceUpdateCurrentTile; procedure ForceUpdateCurrentTile;
procedure GetDrawOffset(AX, AY: Integer; out DrawX, DrawY: Integer); inline; procedure GetDrawOffset(AX, AY: Integer; out DrawX, DrawY: Integer); inline;
@ -2008,6 +2009,8 @@ var
begin begin
// Make sure to reset the current view first. // Make sure to reset the current view first.
PreviewUoaDesign(nil); PreviewUoaDesign(nil);
acSelect.Checked := True;
EnableActions(False);
UnregisterSelectionListener(@PlaceUoaDesign); UnregisterSelectionListener(@PlaceUoaDesign);
UnregisterHoverListener(@PreviewUoaDesign); UnregisterHoverListener(@PreviewUoaDesign);
@ -2338,6 +2341,7 @@ begin
FCurrentUoaDesignAnchor := nil; FCurrentUoaDesignAnchor := nil;
vstUoaDesigns.Enabled := True; vstUoaDesigns.Enabled := True;
btnCancelUOAPlacement.Visible := False; btnCancelUOAPlacement.Visible := False;
EnableActions(True);
selectedNode := vstUoaDesigns.GetFirstSelected(); selectedNode := vstUoaDesigns.GetFirstSelected();
if selectedNode = nil then if selectedNode = nil then
@ -3629,6 +3633,15 @@ begin
oglGameWindowMouseLeave(nil); oglGameWindowMouseLeave(nil);
end; 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; function TfrmMain.FindRandomPreset(AName: String): TDOMElement;
var var
preset: TDOMElement; preset: TDOMElement;