🚸 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 }
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;