From 0a9bee8d6023d355540630bf13dac6f402b3fc17 Mon Sep 17 00:00:00 2001 From: Redo Date: Tue, 29 Nov 2022 14:32:30 -0600 Subject: [PATCH] add rom volume select --- classes/server/duplimode/boxselect.cs | 21 ++++++++++++++++++--- classes/server/selection.cs | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/classes/server/duplimode/boxselect.cs b/classes/server/duplimode/boxselect.cs index 599815a..bdcf7d0 100644 --- a/classes/server/duplimode/boxselect.cs +++ b/classes/server/duplimode/boxselect.cs @@ -177,10 +177,15 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal) %client.ndSelectionBox = ND_SelectionBox(%shapeName); - if(%client.ndMultiSelect) - %box = ndGetPlateBoxFromRayCast(%pos, %normal); - else + if(%client.ndMultiSelect) { + if(%obj.getDatablock().isLogicRom) { + %box = ndGetBoxFromRom(%obj); + } else { + %box = ndGetPlateBoxFromRayCast(%pos, %normal); + } + } else { %box = %obj.getWorldBox(); + } %client.ndInitialMultiSelect = %client.ndMultiSelect; %p1 = getWords(%box, 0, 2); @@ -191,6 +196,16 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal) %client.ndUpdateBottomPrint(); } +function ndGetBoxFromRom(%b) { + %db = %b.getDatablock(); + %box = %b.getWorldBox(); + %bl = getWords(%box, 0, 2); + %bh = getWords(%box, 3, 5); + %bl = vectorAdd(%bl, "0 0 " SPC (%db.brickSizeZ * 0.2)); + %bh = vectorAdd(%bh, "0 0 " SPC (%db.logicRomZ * 0.2)); + return %bl SPC %bh; +} + //Generic inputs diff --git a/classes/server/selection.cs b/classes/server/selection.cs index 1b8d7d7..9f7ca6d 100644 --- a/classes/server/selection.cs +++ b/classes/server/selection.cs @@ -1505,7 +1505,7 @@ function ND_Selection::tickSuperCutChunk(%this) %bricksPlanted += $ND::FillBrickCount; } - + //Set next chunk index or break %currChunk++;