From a17e88ab0d00746a9be58a5b8440108af05a3740 Mon Sep 17 00:00:00 2001 From: Redo Date: Tue, 22 Jul 2025 17:32:45 -0700 Subject: [PATCH] dont select generated bricks; ctrl+select generated bricks selects parent; remove copy --- classes/server/duplimode/boxselect.cs | 10 ++++--- classes/server/duplimode/stackselect.cs | 8 ++--- classes/server/selection.cs | 40 +++++++++++++++++++++++++ scripts/client/controls.cs | 8 ++--- scripts/server/commands.cs | 17 ++++++----- scripts/server/modes.cs | 8 ++--- 6 files changed, 68 insertions(+), 23 deletions(-) diff --git a/classes/server/duplimode/boxselect.cs b/classes/server/duplimode/boxselect.cs index fcb199b..ff5a779 100644 --- a/classes/server/duplimode/boxselect.cs +++ b/classes/server/duplimode/boxselect.cs @@ -191,6 +191,8 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal) %box = ndGetBoxFromZone(%obj); %client.ndSelectionBox.zoneBrick = %obj; %client.ndSelectionBox.setZoneColors(); + } else if(%obj.generated && isObject(%obj.generatedParent)) { + %box = %obj.generatedParent.getWorldBox(); } else { %box = ndGetPlateBoxFromRayCast(%pos, %normal); } @@ -472,10 +474,10 @@ function NDM_BoxSelect::onCancelBrick(%this, %client) } //Copy Selection -function NDM_BoxSelect::onCopy(%this, %client) -{ - %this.onPlantBrick(%client); -} +//function NDM_BoxSelect::onCopy(%this, %client) +//{ +// %this.onPlantBrick(%client); +//} //Cut Selection function NDM_BoxSelect::onCut(%this, %client) diff --git a/classes/server/duplimode/stackselect.cs b/classes/server/duplimode/stackselect.cs index 175d3f0..7db33e7 100644 --- a/classes/server/duplimode/stackselect.cs +++ b/classes/server/duplimode/stackselect.cs @@ -170,10 +170,10 @@ function NDM_StackSelect::onCancelBrick(%this, %client) } //Copy Selection -function NDM_StackSelect::onCopy(%this, %client) -{ - %this.onPlantBrick(%client); -} +//function NDM_StackSelect::onCopy(%this, %client) +//{ +// %this.onPlantBrick(%client); +//} //Cut Selection function NDM_StackSelect::onCut(%this, %client) diff --git a/classes/server/selection.cs b/classes/server/selection.cs index d2fa20d..73b8d29 100644 --- a/classes/server/selection.cs +++ b/classes/server/selection.cs @@ -212,6 +212,10 @@ function ND_Selection::startStackSelection(%this, %brick, %direction, %limited) if(%queueCount >= %brickLimit) continue; + // Skip generated bricks + if(%nextBrick.generated) + continue; + //Check trust if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) { @@ -239,6 +243,10 @@ function ND_Selection::startStackSelection(%this, %brick, %direction, %limited) if(%queueCount >= %brickLimit) continue; + // Skip generated bricks + if(%nextBrick.generated) + continue; + //Check trust if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) { @@ -268,6 +276,10 @@ function ND_Selection::startStackSelection(%this, %brick, %direction, %limited) if(%queueCount >= %brickLimit) continue; + // Skip generated bricks + if(%nextBrick.generated) + continue; + //Check trust if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) { @@ -364,6 +376,10 @@ function ND_Selection::startStackSelectionAdditive(%this, %brick, %direction, %l if(%queueCount >= %brickLimit) continue; + // Skip generated bricks + if(%nextBrick.generated) + continue; + //Check trust if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) { @@ -409,6 +425,10 @@ function ND_Selection::startStackSelectionAdditive(%this, %brick, %direction, %l if(%queueCount >= %brickLimit) continue; + // Skip generated bricks + if(%nextBrick.generated) + continue; + //Check trust if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) { @@ -456,6 +476,10 @@ function ND_Selection::startStackSelectionAdditive(%this, %brick, %direction, %l if(%queueCount >= %brickLimit) continue; + // Skip generated bricks + if(%nextBrick.generated) + continue; + //Check trust if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) { @@ -570,6 +594,10 @@ function ND_Selection::tickStackSelection(%this, %direction, %limited, %heightLi if(%queueCount >= %brickLimit) continue; + // Skip generated bricks + if(%nextBrick.generated) + continue; + //Check trust if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) { @@ -603,6 +631,10 @@ function ND_Selection::tickStackSelection(%this, %direction, %limited, %heightLi if(%queueCount >= %brickLimit) continue; + // Skip generated bricks + if(%nextBrick.generated) + continue; + //Check trust if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) { @@ -652,6 +684,10 @@ function ND_Selection::tickStackSelection(%this, %direction, %limited, %heightLi if(%queueCount >= %brickLimit) continue; + // Skip generated bricks + if(%nextBrick.generated) + continue; + //Check trust if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) { @@ -883,6 +919,10 @@ function ND_Selection::tickBoxSelectionChunk(%this, %limited, %brickLimit) continue; } + // Skip generated bricks + if(%obj.generated) + continue; + //Check trust if(!ndTrustCheckSelect(%obj, %group, %bl_id, %admin)) { diff --git a/scripts/client/controls.cs b/scripts/client/controls.cs index d0e51de..2f59a0e 100644 --- a/scripts/client/controls.cs +++ b/scripts/client/controls.cs @@ -8,9 +8,9 @@ function ndRegisterKeybinds() { $RemapDivision[$RemapCount] = "New Duplicator"; - $RemapName[$RemapCount] = "Copy Selection (Ctrl C)"; - $RemapCmd[$RemapCount] = "ndInputCopy"; - $RemapCount++; + //$RemapName[$RemapCount] = "Copy Selection (Ctrl C)"; + //$RemapCmd[$RemapCount] = "ndInputCopy"; + //$RemapCount++; //$RemapName[$RemapCount] = "Paste Selection (Ctrl V)"; //$RemapCmd[$RemapCount] = "ndInputPaste"; //$RemapCount++; @@ -104,7 +104,7 @@ function clientCmdNdEnableKeybinds(%bool) //Input handlers function ndInputNewDuplicator (%bool) {if(!%bool)return; commandToServer('newDuplicator' );} -function ndInputCopy (%bool) {if(!%bool)return; commandToServer('ndCopy' );} +//function ndInputCopy (%bool) {if(!%bool)return; commandToServer('ndCopy' );} //function ndInputPaste (%bool) {if(!%bool)return; commandToServer('ndPaste' );} function ndInputCut (%bool) {if(!%bool)return; commandToServer('ndCut' );} function ndInputFillWrench (%bool) {if(!%bool)return; commandToServer('fillWrench' );} diff --git a/scripts/server/commands.cs b/scripts/server/commands.cs index 0f98a2d..6df4814 100644 --- a/scripts/server/commands.cs +++ b/scripts/server/commands.cs @@ -269,10 +269,13 @@ package NewDuplicator_Server_Final //Planting the ghost brick (default: numpad enter) function serverCmdPlantBrick(%client) { - if(%client.ndModeIndex) + if(%client.ndModeIndex) { %client.ndMode.onPlantBrick(%client); - else + if(isObject(%client.player)) + %client.player.playThread(3, plant); + } else { parent::serverCmdPlantBrick(%client); + } } //Removing the ghost brick (default: numpad 0) @@ -291,11 +294,11 @@ package NewDuplicator_Server_Final /////////////////////////////////////////////////////////////////////////// //Copy selection (ctrl c) -function serverCmdNdCopy(%client) -{ - if(%client.ndModeIndex) - %client.ndMode.onCopy(%client); -} +//function serverCmdNdCopy(%client) +//{ +// if(%client.ndModeIndex) +// %client.ndMode.onCopy(%client); +//} //Paste selection (ctrl v) //function serverCmdNdPaste(%client) diff --git a/scripts/server/modes.cs b/scripts/server/modes.cs index d8f658b..e29f10e 100644 --- a/scripts/server/modes.cs +++ b/scripts/server/modes.cs @@ -19,10 +19,10 @@ function NewDuplicatorMode::onRotateBrick(%this, %client, %direction){} function NewDuplicatorMode::onPlantBrick(%this, %client){} function NewDuplicatorMode::onCancelBrick(%this, %client){} -function NewDuplicatorMode::onCopy(%this, %client) -{ - ndmessageClient(%client, '', "\c6Copy can not be used in your current duplicator mode."); -} +//function NewDuplicatorMode::onCopy(%this, %client) +//{ +// ndmessageClient(%client, '', "\c6Copy can not be used in your current duplicator mode."); +//} //function NewDuplicatorMode::onPaste(%this, %client) //{