dont select generated bricks; ctrl+select generated bricks selects parent; remove copy

This commit is contained in:
Redo
2025-07-22 17:32:45 -07:00
parent 2084d75180
commit a17e88ab0d
6 changed files with 68 additions and 23 deletions

View File

@ -191,6 +191,8 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal)
%box = ndGetBoxFromZone(%obj); %box = ndGetBoxFromZone(%obj);
%client.ndSelectionBox.zoneBrick = %obj; %client.ndSelectionBox.zoneBrick = %obj;
%client.ndSelectionBox.setZoneColors(); %client.ndSelectionBox.setZoneColors();
} else if(%obj.generated && isObject(%obj.generatedParent)) {
%box = %obj.generatedParent.getWorldBox();
} else { } else {
%box = ndGetPlateBoxFromRayCast(%pos, %normal); %box = ndGetPlateBoxFromRayCast(%pos, %normal);
} }
@ -472,10 +474,10 @@ function NDM_BoxSelect::onCancelBrick(%this, %client)
} }
//Copy Selection //Copy Selection
function NDM_BoxSelect::onCopy(%this, %client) //function NDM_BoxSelect::onCopy(%this, %client)
{ //{
%this.onPlantBrick(%client); // %this.onPlantBrick(%client);
} //}
//Cut Selection //Cut Selection
function NDM_BoxSelect::onCut(%this, %client) function NDM_BoxSelect::onCut(%this, %client)

View File

@ -170,10 +170,10 @@ function NDM_StackSelect::onCancelBrick(%this, %client)
} }
//Copy Selection //Copy Selection
function NDM_StackSelect::onCopy(%this, %client) //function NDM_StackSelect::onCopy(%this, %client)
{ //{
%this.onPlantBrick(%client); // %this.onPlantBrick(%client);
} //}
//Cut Selection //Cut Selection
function NDM_StackSelect::onCut(%this, %client) function NDM_StackSelect::onCut(%this, %client)

View File

@ -212,6 +212,10 @@ function ND_Selection::startStackSelection(%this, %brick, %direction, %limited)
if(%queueCount >= %brickLimit) if(%queueCount >= %brickLimit)
continue; continue;
// Skip generated bricks
if(%nextBrick.generated)
continue;
//Check trust //Check trust
if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin))
{ {
@ -239,6 +243,10 @@ function ND_Selection::startStackSelection(%this, %brick, %direction, %limited)
if(%queueCount >= %brickLimit) if(%queueCount >= %brickLimit)
continue; continue;
// Skip generated bricks
if(%nextBrick.generated)
continue;
//Check trust //Check trust
if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin))
{ {
@ -268,6 +276,10 @@ function ND_Selection::startStackSelection(%this, %brick, %direction, %limited)
if(%queueCount >= %brickLimit) if(%queueCount >= %brickLimit)
continue; continue;
// Skip generated bricks
if(%nextBrick.generated)
continue;
//Check trust //Check trust
if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin))
{ {
@ -364,6 +376,10 @@ function ND_Selection::startStackSelectionAdditive(%this, %brick, %direction, %l
if(%queueCount >= %brickLimit) if(%queueCount >= %brickLimit)
continue; continue;
// Skip generated bricks
if(%nextBrick.generated)
continue;
//Check trust //Check trust
if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin))
{ {
@ -409,6 +425,10 @@ function ND_Selection::startStackSelectionAdditive(%this, %brick, %direction, %l
if(%queueCount >= %brickLimit) if(%queueCount >= %brickLimit)
continue; continue;
// Skip generated bricks
if(%nextBrick.generated)
continue;
//Check trust //Check trust
if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin))
{ {
@ -456,6 +476,10 @@ function ND_Selection::startStackSelectionAdditive(%this, %brick, %direction, %l
if(%queueCount >= %brickLimit) if(%queueCount >= %brickLimit)
continue; continue;
// Skip generated bricks
if(%nextBrick.generated)
continue;
//Check trust //Check trust
if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin))
{ {
@ -570,6 +594,10 @@ function ND_Selection::tickStackSelection(%this, %direction, %limited, %heightLi
if(%queueCount >= %brickLimit) if(%queueCount >= %brickLimit)
continue; continue;
// Skip generated bricks
if(%nextBrick.generated)
continue;
//Check trust //Check trust
if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin))
{ {
@ -603,6 +631,10 @@ function ND_Selection::tickStackSelection(%this, %direction, %limited, %heightLi
if(%queueCount >= %brickLimit) if(%queueCount >= %brickLimit)
continue; continue;
// Skip generated bricks
if(%nextBrick.generated)
continue;
//Check trust //Check trust
if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin))
{ {
@ -652,6 +684,10 @@ function ND_Selection::tickStackSelection(%this, %direction, %limited, %heightLi
if(%queueCount >= %brickLimit) if(%queueCount >= %brickLimit)
continue; continue;
// Skip generated bricks
if(%nextBrick.generated)
continue;
//Check trust //Check trust
if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin)) if(!ndTrustCheckSelect(%nextBrick, %group, %bl_id, %admin))
{ {
@ -883,6 +919,10 @@ function ND_Selection::tickBoxSelectionChunk(%this, %limited, %brickLimit)
continue; continue;
} }
// Skip generated bricks
if(%obj.generated)
continue;
//Check trust //Check trust
if(!ndTrustCheckSelect(%obj, %group, %bl_id, %admin)) if(!ndTrustCheckSelect(%obj, %group, %bl_id, %admin))
{ {

View File

@ -8,9 +8,9 @@ function ndRegisterKeybinds() {
$RemapDivision[$RemapCount] = "New Duplicator"; $RemapDivision[$RemapCount] = "New Duplicator";
$RemapName[$RemapCount] = "Copy Selection (Ctrl C)"; //$RemapName[$RemapCount] = "Copy Selection (Ctrl C)";
$RemapCmd[$RemapCount] = "ndInputCopy"; //$RemapCmd[$RemapCount] = "ndInputCopy";
$RemapCount++; //$RemapCount++;
//$RemapName[$RemapCount] = "Paste Selection (Ctrl V)"; //$RemapName[$RemapCount] = "Paste Selection (Ctrl V)";
//$RemapCmd[$RemapCount] = "ndInputPaste"; //$RemapCmd[$RemapCount] = "ndInputPaste";
//$RemapCount++; //$RemapCount++;
@ -104,7 +104,7 @@ function clientCmdNdEnableKeybinds(%bool)
//Input handlers //Input handlers
function ndInputNewDuplicator (%bool) {if(!%bool)return; commandToServer('newDuplicator' );} 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 ndInputPaste (%bool) {if(!%bool)return; commandToServer('ndPaste' );}
function ndInputCut (%bool) {if(!%bool)return; commandToServer('ndCut' );} function ndInputCut (%bool) {if(!%bool)return; commandToServer('ndCut' );}
function ndInputFillWrench (%bool) {if(!%bool)return; commandToServer('fillWrench' );} function ndInputFillWrench (%bool) {if(!%bool)return; commandToServer('fillWrench' );}

View File

@ -269,10 +269,13 @@ package NewDuplicator_Server_Final
//Planting the ghost brick (default: numpad enter) //Planting the ghost brick (default: numpad enter)
function serverCmdPlantBrick(%client) function serverCmdPlantBrick(%client)
{ {
if(%client.ndModeIndex) if(%client.ndModeIndex) {
%client.ndMode.onPlantBrick(%client); %client.ndMode.onPlantBrick(%client);
else if(isObject(%client.player))
%client.player.playThread(3, plant);
} else {
parent::serverCmdPlantBrick(%client); parent::serverCmdPlantBrick(%client);
}
} }
//Removing the ghost brick (default: numpad 0) //Removing the ghost brick (default: numpad 0)
@ -291,11 +294,11 @@ package NewDuplicator_Server_Final
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
//Copy selection (ctrl c) //Copy selection (ctrl c)
function serverCmdNdCopy(%client) //function serverCmdNdCopy(%client)
{ //{
if(%client.ndModeIndex) // if(%client.ndModeIndex)
%client.ndMode.onCopy(%client); // %client.ndMode.onCopy(%client);
} //}
//Paste selection (ctrl v) //Paste selection (ctrl v)
//function serverCmdNdPaste(%client) //function serverCmdNdPaste(%client)

View File

@ -19,10 +19,10 @@ function NewDuplicatorMode::onRotateBrick(%this, %client, %direction){}
function NewDuplicatorMode::onPlantBrick(%this, %client){} function NewDuplicatorMode::onPlantBrick(%this, %client){}
function NewDuplicatorMode::onCancelBrick(%this, %client){} function NewDuplicatorMode::onCancelBrick(%this, %client){}
function NewDuplicatorMode::onCopy(%this, %client) //function NewDuplicatorMode::onCopy(%this, %client)
{ //{
ndmessageClient(%client, '', "\c6Copy can not be used in your current duplicator mode."); // ndmessageClient(%client, '', "\c6Copy can not be used in your current duplicator mode.");
} //}
//function NewDuplicatorMode::onPaste(%this, %client) //function NewDuplicatorMode::onPaste(%this, %client)
//{ //{