Add support for enabling the screenshot taker, even in sim
This commit is contained in:
parent
52ccbe4dad
commit
76faa69c74
4 changed files with 25 additions and 1 deletions
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
|
||||
using RobocraftX.GUI.MyGamesScreen;
|
||||
using RobocraftX.GUI;
|
||||
using Svelto.ECS;
|
||||
using TechbloxModdingAPI.Engines;
|
||||
using TechbloxModdingAPI.Utility;
|
||||
|
|
|
@ -473,6 +473,15 @@ namespace TechbloxModdingAPI.App
|
|||
return blocks;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable the screenshot taker for updating the game's screenshot. Breaks the pause menu in a new save.
|
||||
/// </summary>
|
||||
public void EnableScreenshotTaker()
|
||||
{
|
||||
if (!VerifyMode()) return;
|
||||
gameEngine.EnableScreenshotTaker();
|
||||
}
|
||||
|
||||
~Game()
|
||||
{
|
||||
foreach (string id in debugIds)
|
||||
|
|
|
@ -10,6 +10,7 @@ using Svelto.ECS;
|
|||
using Svelto.Tasks;
|
||||
using Svelto.Tasks.Lean;
|
||||
using RobocraftX.Blocks;
|
||||
using RobocraftX.ScreenshotTaker;
|
||||
using TechbloxModdingAPI.Blocks;
|
||||
using TechbloxModdingAPI.Engines;
|
||||
using TechbloxModdingAPI.Utility;
|
||||
|
@ -129,5 +130,14 @@ namespace TechbloxModdingAPI.App
|
|||
return blockEGIDs.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public void EnableScreenshotTaker()
|
||||
{
|
||||
ref var local = ref entitiesDB.QueryEntity<ScreenshotModeEntityStruct>(ScreenshotTakerEgids.ScreenshotTaker);
|
||||
if (local.enabled)
|
||||
return;
|
||||
local.enabled = true;
|
||||
entitiesDB.PublishEntityChange<ScreenshotModeEntityStruct>(ScreenshotTakerEgids.ScreenshotTaker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -282,6 +282,12 @@ namespace TechbloxModdingAPI.Tests
|
|||
.Select(kv => $"{kv.Key}: {((MaterialPropertiesData) kv.Value).Name}")
|
||||
.Aggregate((a, b) => a + "\n" + b));
|
||||
};*/
|
||||
|
||||
CommandBuilder.Builder("takeScreenshot", "Enables the screenshot taker")
|
||||
.Action(() =>
|
||||
{
|
||||
Game.CurrentGame().EnableScreenshotTaker();
|
||||
}).Build();
|
||||
#if TEST
|
||||
TestRoot.RunTests();
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue