Add box selection history

This commit is contained in:
Redo
2025-07-19 01:33:47 -07:00
parent bd51faa3e7
commit f88dbceb61
8 changed files with 91 additions and 51 deletions

View File

@ -199,7 +199,9 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal)
}
%client.ndSelectionBox.setSizeAligned(%p1, %p2, %client.getControlObject());
%client.ndPushBoxHistory();
%client.ndUpdateBottomPrint();
}
function ndRound(%v, %step) {
@ -305,6 +307,8 @@ function NDM_BoxSelect::onShiftBrick(%this, %client, %x, %y, %z)
{
%client.ndSelectionBox.shift(%newX SPC %newY SPC %z);
}
%client.ndBoxChanged();
}
//Super Shift Brick
@ -320,6 +324,8 @@ function NDM_BoxSelect::onSuperShiftBrick(%this, %client, %x, %y, %z)
}
%this.onShiftBrick(%client, %x * 8, %y * 8, %z * 20);
%client.ndBoxChanged();
}
//Rotate Brick
@ -344,7 +350,8 @@ function NDM_BoxSelect::onRotateBrick(%this, %client, %direction)
%client.ndSelectionBox.rotate(%direction);
%client.ndUpdateBottomPrint();
}
%client.ndBoxChanged();
}
//Plant Brick
@ -386,6 +393,9 @@ function NDM_BoxSelect::onPlantBrick(%this, %client)
//Start selection
%box = %client.ndSelectionBox.getWorldBox();
%client.ndPushBoxHistory();
%client.ndBoxChanged();
%client.ndSetMode(NDM_BoxSelectProgress);
%client.ndSelection.startBoxSelection(%box, %client.ndLimited);
}
@ -410,6 +420,8 @@ function NDM_BoxSelect::onCancelBrick(%this, %client)
return;
}
%client.ndBoxCleared();
if(isObject(%client.ndSelection))
%client.ndSelection.deleteData();
@ -436,8 +448,11 @@ function NDM_BoxSelect::onCut(%this, %client)
return;
}
%client.ndPushBoxHistory();
%client.ndSetMode(NDM_CutProgress);
%client.ndSelection.startCutting();
}
//Supercut selection
@ -460,6 +475,8 @@ function NDM_BoxSelect::onSuperCut(%this, %client)
%client.ndSetMode(NDM_SuperCutProgress);
%client.ndSelection.startSuperCut(%box);
%client.ndBoxChanged();
}