add new zone box visuals,

This commit is contained in:
Redo
2025-07-19 21:36:50 -07:00
parent a5ce98b31d
commit 6446a621c6
13 changed files with 165 additions and 41 deletions

View File

@ -16,24 +16,29 @@ function gameConnection::ndCreateSelectionBox(%client) {
%client.ndSelectionBox = ND_SelectionBox(%shapeName);
}
function gameConnection::ndPushBoxHistory(%client) {
//talk("push");
if(!isObject(%client.ndSelectionBox)) return;
%box = %client.ndSelectionBox.point1 SPC %client.ndSelectionBox.point2;
function gameConnection::ndPushBoxHistory(%client, %optBox) {
if(%optBox $= "") {
if(!isObject(%client.ndSelectionBox)) return;
%box = %client.ndSelectionBox.point1 SPC %client.ndSelectionBox.point2;
%zone = %client.ndSelectionBox.zoneBrick;
} else {
%box = %optBox;
%zone = "";
}
%entry = %box TAB %zone;
if(%client.ndBoxHistoryCount>0 &&
%box $= %client.ndBoxHistory[%client.ndBoxHistoryCount-1])
%entry $= %client.ndBoxHistory[%client.ndBoxHistoryCount-1])
return;
%client.ndBoxHistory[%client.ndBoxHistoryCount+0] = %box;
%client.ndBoxHistory[%client.ndBoxHistoryCount+0] = %entry;
%client.ndBoxHistoryCount++;
%client.ndBoxHistoryPos = 1; // recall prior to this one
}
function gameConnection::ndBoxChanged(%client) {
//talk("changed");
%client.ndBoxHistoryPos = 0; // recall starting with this initial selection
%client.ndSaveBoxOnRecall = true;
}
function gameConnection::ndBoxCleared(%client) {
//talk("cleared");
if(%client.ndSaveBoxOnRecall) {
%client.ndPushBoxHistory();
%client.ndSaveBoxOnRecall = false;
@ -41,18 +46,26 @@ function gameConnection::ndBoxCleared(%client) {
%client.ndBoxHistoryPos = 0;
}
function gameConnection::ndRecallBoxHistory(%client, %offset) {
//talk("recall " @ %offset);
if(%offset<1 || %offset>%client.ndBoxHistoryCount) return;
%idx = %client.ndBoxHistoryCount - %offset;
%box = %client.ndBoxHistory[%idx];
%entry = %client.ndBoxHistory[%idx];
%box = getField(%entry, 0);
%zone = getField(%entry, 1);
%p1 = getWords(%box,0,2);
%p2 = getWords(%box,3,5);
if(!isObject(%client.ndSelectionBox))
%client.ndCreateSelectionBox();
%client.ndSelectionBox.zoneBrick = %zone;
if(isObject(%zone))
%client.ndSelectionBox.setZoneColors();
else
%client.ndSelectionBox.setNormalColors();
%client.ndSelectionBox.setSize(%p1,%p2);
%client.ndUpdateBottomPrint();
ndBoxPlaySound(%client.ndSelectionBox, BrickMoveSound);
}