Browse Source

SetLimits command and updates

Only the command update is from now
tags/v1.2.0
NorbiPeti 3 years ago
parent
commit
12fd814c45
3 changed files with 10 additions and 8 deletions
  1. +9
    -0
      BuildingTools/BuildingTools.cs
  2. +0
    -7
      BuildingTools/CommandUtils.cs
  3. +1
    -1
      BuildingTools/NoClipCommand.cs

+ 9
- 0
BuildingTools/BuildingTools.cs View File

@@ -210,6 +210,15 @@ namespace BuildingTools
return copy;
}).ToArray();
}).Build();
CommandBuilder.Builder("setLimits", "Sets the CPU and power limits.")
.Action((int cpu, int power) =>
{
var data = FullGameFields._dataDb.GetValue<BuildRulesData>(1);
Logging.CommandLog($"Old CPU limit: {data.CPULimitMax}, power limit: {data.PowerLimitMax}");
data.PowerLimitMax = power;
data.CPULimitMax = cpu;
Logging.CommandLog($"New CPU limit: {data.CPULimitMax}, power limit: {data.PowerLimitMax}");
}).Build();

var noClip = new NoClipCommand();
GameEngineManager.AddGameEngine(noClip);


+ 0
- 7
BuildingTools/CommandUtils.cs View File

@@ -3,7 +3,6 @@ using Gamecraft.Wires;
using TechbloxModdingAPI;
using TechbloxModdingAPI.Commands;
using TechbloxModdingAPI.Utility;
using RobocraftX.CommandLine.Custom;

namespace BuildingTools
{
@@ -22,12 +21,6 @@ namespace BuildingTools
{
action(a1, _blockSelections.blocks, _blockSelections.refBlock);
}).Build();
ConsoleCommands.RegisterWithChannel<string>(name + "Chan", (a1, ch) =>
{
Console.WriteLine($"Command {name} with args {a1} and channel {ch} executing");
/*var blks = _blockSelections.SelectBlocks(ch); - TODO: Re-add support if object IDs exist again
action(a1, blks, blks[0]);*/
}, ChannelType.Object, desc);
}

public void RegisterBlockCommand(string name, string desc, Action<float, float, float, Block[], Block> action)


+ 1
- 1
BuildingTools/NoClipCommand.cs View File

@@ -57,7 +57,7 @@ namespace BuildingTools
{
EnsureFlying();
ChangeCollider(_collisionFilter);
if (!entitiesDB.Exists<LocalInputEntityStruct>(0U, CommonExclusiveGroups.GameStateGroup))
if (!entitiesDB.Exists<LocalPlayerInputEntityStruct>(0U, CommonExclusiveGroups.GameStateGroup))
{
yield break;
}


Loading…
Cancel
Save