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

@ -2,52 +2,47 @@
// -------------------------------------------------------------------
//Register rebind-able controls
function ndRegisterKeybinds()
{
function ndRegisterKeybinds() {
if($ND::KeybindsRegistered)
return;
$RemapDivision[$RemapCount] = "New Duplicator";
$RemapName[$RemapCount] = "Copy Selection (Ctrl C)";
$RemapCmd[$RemapCount] = "ndInputCopy";
$RemapCount++;
$RemapName[$RemapCount] = "Paste Selection (Ctrl V)";
$RemapCmd[$RemapCount] = "ndInputPaste";
$RemapCount++;
//$RemapName[$RemapCount] = "Paste Selection (Ctrl V)";
//$RemapCmd[$RemapCount] = "ndInputPaste";
//$RemapCount++;
$RemapName[$RemapCount] = "Cut Selection (Ctrl X)";
$RemapCmd[$RemapCount] = "ndInputCut";
$RemapCount++;
$RemapName[$RemapCount] = "Multiselect (Ctrl, Hold to use)";
$RemapCmd[$RemapCount] = "ndInputMultiSelect";
$RemapCount++;
$RemapName[$RemapCount] = "Send /NewDuplicator";
$RemapCmd[$RemapCount] = "ndInputNewDuplicator";
$RemapCount++;
$RemapName[$RemapCount] = "Send /FillWrench";
$RemapCmd[$RemapCount] = "ndInputFillWrench";
$RemapCount++;
$RemapName[$RemapCount] = "Send /ForcePlant";
$RemapCmd[$RemapCount] = "ndInputForcePlant";
$RemapCount++;
$RemapName[$RemapCount] = "Send /ToggleForcePlant";
$RemapCmd[$RemapCount] = "ndInputToggleForcePlant";
$RemapCount++;
$RemapName[$RemapCount] = "Send /MirrorX";
$RemapCmd[$RemapCount] = "ndInputMirrorX";
$RemapCount++;
$RemapName[$RemapCount] = "Send /MirrorY";
$RemapCmd[$RemapCount] = "ndInputMirrorY";
$RemapCount++;
$RemapName[$RemapCount] = "Send /MirrorZ";
$RemapCmd[$RemapCount] = "ndInputMirrorZ";
$RemapCount++;
@ -55,11 +50,17 @@ function ndRegisterKeybinds()
$RemapName[$RemapCount] = "Send /SuperCut (Shift-Ctrl X)";
$RemapCmd[$RemapCount] = "ndInputSuperCut";
$RemapCount++;
$RemapName[$RemapCount] = "Send /FillBricks (Shift-Ctrl V)";
$RemapCmd[$RemapCount] = "ndInputFillBricks";
$RemapCount++;
$RemapName[$RemapCount] = "Send /NextBox (Ctrl-Up)";
$RemapCmd[$RemapCount] = "ndInputNextBox";
$RemapCount++;
$RemapName[$RemapCount] = "Send /PrevBox (Ctrl-Down)";
$RemapCmd[$RemapCount] = "ndInputPrevBox";
$RemapCount++;
$ND::KeybindsRegistered = true;
}
@ -72,10 +73,8 @@ function clientCmdNdEnableKeybinds(%bool)
if(MoveMap.getBinding("ndInputCopy") $= "")
%map.bind("keyboard", isWindows() ? "ctrl c" : "cmd c", "ndInputCopy");
if(MoveMap.getBinding("ndInputPaste") $= "")
%map.bind("keyboard", isWindows() ? "ctrl v" : "cmd v", "ndInputPaste");
//if(MoveMap.getBinding("ndInputPaste") $= "")
// %map.bind("keyboard", isWindows() ? "ctrl v" : "cmd v", "ndInputPaste");
if(MoveMap.getBinding("ndInputCut") $= "")
%map.bind("keyboard", isWindows() ? "ctrl x" : "cmd x", "ndInputCut");
@ -84,10 +83,14 @@ function clientCmdNdEnableKeybinds(%bool)
if(MoveMap.getBinding("ndInputSuperCut") $= "")
%map.bind("keyboard", isWindows() ? "shift-ctrl x" : "shift-cmd x", "ndInputSuperCut");
if(MoveMap.getBinding("ndInputFillBricks") $= "")
%map.bind("keyboard", isWindows() ? "shift-ctrl v" : "shift-cmd v", "ndInputFillBricks");
if(MoveMap.getBinding("ndInputNextBox") $= "")
%map.bind("keyboard", isWindows() ? "ctrl up" : "cmd up", "ndInputNextBox");
if(MoveMap.getBinding("ndInputPrevBox") $= "")
%map.bind("keyboard", isWindows() ? "ctrl down" : "cmd down", "ndInputPrevBox");
%map.push();
$ND::KeybindsEnabled = true;
}
@ -102,7 +105,7 @@ function clientCmdNdEnableKeybinds(%bool)
//Input handlers
function ndInputNewDuplicator (%bool) {if(!%bool)return; commandToServer('newDuplicator' );}
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 ndInputFillWrench (%bool) {if(!%bool)return; commandToServer('fillWrench' );}
function ndInputForcePlant (%bool) {if(!%bool)return; commandToServer('forcePlant' );}
@ -112,5 +115,7 @@ function ndInputMirrorY (%bool) {if(!%bool)return; commandToServer('mirr
function ndInputMirrorZ (%bool) {if(!%bool)return; commandToServer('mirrorZ' );}
function ndInputSuperCut (%bool) {if(!%bool)return; commandToServer('superCut' );}
function ndInputFillBricks (%bool) {if(!%bool)return; commandToServer('fillBricks' );}
function ndInputNextBox (%bool) {if(!%bool)return; commandToServer('nextBox' );}
function ndInputPrevBox (%bool) {if(!%bool)return; commandToServer('prevBox' );}
function ndInputMultiSelect(%bool) {commandToServer('ndMultiSelect', %bool);}

View File

@ -45,6 +45,7 @@ function serverCmdDupHelp(%client)
messageClient(%client, '', "<tab:220>\c3/ForcePlant\t\c6 Plant a selection in mid air; bricks can float.");
messageClient(%client, '', "<tab:220>\c3/ToggleForcePlant\t\c6 Enable force plant for normal planting, so you dont have to type it all the time.");
messageClient(%client, '', "<tab:220>\c3/PlantAs\c6 [\c3target\c6]\t\c6 Plant bricks in a different brick group. Target can be a name or blid.");
messageClient(%client, '', "<tab:220>\c3/Ownership\t\c6 Plant bricks with the original ownership from when they were copied or saved.");
messageClient(%client, '', "<font:Arial:8> ");
messageClient(%client, '', "<tab:220>\c3/FillWrench\t\c6 Open the fill wrench gui to change settings on all selected bricks.");
@ -57,16 +58,20 @@ function serverCmdDupHelp(%client)
messageClient(%client, '', "<font:Arial:8> ");
messageClient(%client, '', "<tab:220>\c3/SuperCut\t\c6 Delete everything in your selection box, cutting bricks in half on its sides!");
messageClient(%client, '', "<tab:220>\c3/FillBricks\t\c6 First supercut, then completely fill your selection box with few bricks.");
messageClient(%client, '', "<tab:220>\c3/FillBricks\t\c6 First supercut, then completely fill your selection box with bricks.");
messageClient(%client, '', "<font:Arial:8> ");
messageClient(%client, '', "<tab:220>\c3/PrevBox\t\c6 Recall the previous selection box when in Box Select mode. Similar to pressing up in a chat client. Can be used multiple times.");
messageClient(%client, '', "<tab:220>\c3/NextBox\t\c6 Undo one /prevBox, going forward in the selection box history.");
messageClient(%client, '', "<font:Arial:8> ");
messageClient(%client, '', "<tab:220>\c3/SaveDup\c6 [\c3name\c6]\t\c6 Save your current selection to a file.");
messageClient(%client, '', "<tab:220>\c3/LoadDup\c6 [\c3name\c6]\t\c6 Load a selection from a file. Your current selection will be deleted.");
messageClient(%client, '', "<tab:220>\c3/AllDups\c6 [\c3filter\c6]\t\c6 Show all known saved duplications that match the filter. Leave blank to show all.");
messageClient(%client, '', "<font:Arial:8> ");
//messageClient(%client, '', "<font:Arial:8> ");
messageClient(%client, '', "<tab:220>\c3/DupVersion\t\c6 Show the duplicator and blockland versions running on the server.");
messageClient(%client, '', "<tab:220>\c3/DupClients\t\c6 Show the duplicator versions of other clients on the server.");
//messageClient(%client, '', "<tab:220>\c3/DupVersion\t\c6 Show the duplicator and blockland versions running on the server.");
//messageClient(%client, '', "<tab:220>\c3/DupClients\t\c6 Show the duplicator versions of other clients on the server.");
messageClient(%client, '', "\c7--------------------------------------------------------------------------------");
messageClient(%client, '', "\c6All of the commands can be shortened by just typing a \c3/\c6 and the capital letters!");
@ -78,6 +83,7 @@ function serverCmdDupHelp(%client)
//function serverCmdDV(%client){serverCmdDupVersion(%client);}
//function serverCmdDC(%client){serverCmdDupClients(%client);}
function serverCmdDH(%client){serverCmdDupHelp(%client);}
function serverCmdNdHelp(%client) { serverCmdDupHelp(%client); }
@ -291,11 +297,11 @@ function serverCmdNdCopy(%client)
}
//Paste selection (ctrl v)
function serverCmdNdPaste(%client)
{
if(%client.ndModeIndex)
%client.ndMode.onPaste(%client);
}
//function serverCmdNdPaste(%client)
//{
// if(%client.ndModeIndex)
// %client.ndMode.onPaste(%client);
//}
//Cut selection (ctrl x)
function serverCmdNdCut(%client)
@ -1203,3 +1209,12 @@ function serverCmdPlantAs(%client, %t0, %t1, %t2, %t3, %t4)
//Alternative short command
function serverCmdPA(%client, %t0, %t1, %t2, %t3, %t4) {serverCmdPlantAs(%client, %t0, %t1, %t2, %t3, %t4);}
///////////////////////////////////////////////////////////////////////////
// Box history
function serverCmdPrevBox(%client) { %client.ndPrevBox(); }
function serverCmdNextBox(%client) { %client.ndNextBox(); }
function serverCmdPB(%client) { serverCmdPrevBox(%client); }
function serverCmdNB(%client) { serverCmdNextBox(%client); }

View File

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