add box features

This commit is contained in:
Redo
2025-02-26 17:36:12 -07:00
parent cd5b46cc3b
commit dd049be341
21 changed files with 1510 additions and 339 deletions

View File

@ -1,3 +1,5 @@
//bls 4
// This file should not exist. Fix later...
// -------------------------------------------------------------------
@ -26,6 +28,7 @@ function NDM_PlantCopy::onChangeMode(%this, %client, %nextMode)
{
%client.ndSelection.deleteData();
}
%client.ndOwnership = false;
}
//Kill this mode
@ -33,6 +36,7 @@ function NDM_PlantCopy::onKillMode(%this, %client)
{
//Destroy the selection
%client.ndSelection.delete();
%client.ndOwnership = false;
}
@ -112,12 +116,21 @@ function NDM_PlantCopy::onPlantBrick(%this, %client)
{
if($Pref::Server::ND::FloatAdminOnly && !%client.isAdmin)
{
messageClient(%client, '', "\c6Force Plant has been disabled because it is admin only. Ask an admin for help.");
ndmessageClient(%client, '', "\c6Force Plant has been disabled because it is admin only. Ask an admin for help.");
%client.ndForcePlant = false;
}
}
%this.conditionalPlant(%client, %client.ndForcePlant);
if(%client.ndOwnership) {
if(!%client.isAdmin) {
%client.ndOwnership = false;
ndmessageClient(%client, '', "\c6Ownership plant has been disabled because it is admin only.");
}
}
%this.conditionalPlant(%client, %client.ndForcePlant, %client.ndOwnership);
%client.ndOwnership = false;
}
//Cancel Brick
@ -160,7 +173,9 @@ function NDM_PlantCopy::getBottomPrint(%this, %client)
%l0 = "Pivot: \c3" @ (%client.ndPivot ? "Whole Selection" : "Start Brick") @ "\c6 [Prev Seat]";
if(isObject(%client.ndSelection.targetGroup))
if(%client.ndOwnership)
%l1 = "Planting as: Original Owner";
else if(isObject(%client.ndSelection.targetGroup))
%l1 = "Planting as: \c3" @ %client.ndSelection.targetGroup.name;
else
%l1 = "Size: \c3" @ %x @ "\c6 x \c3" @ %y @ "\c6 x \c3" @ %z @ "\c6 Plates";
@ -222,7 +237,7 @@ function NDM_PlantCopy::moveBricksTo(%his, %client, %pos, %normal)
}
//Check time limit and attempt to plant bricks
function NDM_PlantCopy::conditionalPlant(%this, %client, %force)
function NDM_PlantCopy::conditionalPlant(%this, %client, %force, %ownership)
{
//Check timeout
if(!%client.isAdmin && %client.ndLastPlantTime + ($Pref::Server::ND::PlantTimeoutMS / 1000) > $Sim::Time)
@ -252,7 +267,7 @@ function NDM_PlantCopy::conditionalPlant(%this, %client, %force)
getTrustLevel(%client, %client.ndSelection.targetGroup) < 1 &&
(!%client.isAdmin || !$Pref::Server::ND::AdminTrustBypass2))
{
messageClient(%client, '', "\c6You need build trust with \c3"
ndmessageClient(%client, '', "\c6You need build trust with \c3"
@ %client.ndSelection.targetGroup.name @ "\c6 to plant bricks in their group.");
return;
@ -264,5 +279,5 @@ function NDM_PlantCopy::conditionalPlant(%this, %client, %force)
%ang = %client.ndSelection.ghostAngleID;
%client.ndSetMode(NDM_PlantCopyProgress);
%client.ndSelection.startPlant(%pos, %ang, %force);
%client.ndSelection.startPlant(%pos, %ang, %force, %ownership);
}