SetLimits command and updates

Only the command update is from now
This commit is contained in:
Norbi Peti 2021-07-23 04:08:30 +02:00
parent a15634f003
commit 12fd814c45
3 changed files with 10 additions and 8 deletions

View file

@ -210,6 +210,15 @@ namespace BuildingTools
return copy; return copy;
}).ToArray(); }).ToArray();
}).Build(); }).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(); var noClip = new NoClipCommand();
GameEngineManager.AddGameEngine(noClip); GameEngineManager.AddGameEngine(noClip);

View file

@ -3,7 +3,6 @@ using Gamecraft.Wires;
using TechbloxModdingAPI; using TechbloxModdingAPI;
using TechbloxModdingAPI.Commands; using TechbloxModdingAPI.Commands;
using TechbloxModdingAPI.Utility; using TechbloxModdingAPI.Utility;
using RobocraftX.CommandLine.Custom;
namespace BuildingTools namespace BuildingTools
{ {
@ -22,12 +21,6 @@ namespace BuildingTools
{ {
action(a1, _blockSelections.blocks, _blockSelections.refBlock); action(a1, _blockSelections.blocks, _blockSelections.refBlock);
}).Build(); }).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) public void RegisterBlockCommand(string name, string desc, Action<float, float, float, Block[], Block> action)

View file

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