|
|
@@ -26,7 +26,7 @@ namespace GamecraftModdingAPI.Tests |
|
|
|
{ |
|
|
|
private static HarmonyInstance harmony { get; set; } |
|
|
|
|
|
|
|
public string[] Filter { get; } = new string[] { "Gamecraft" }; |
|
|
|
public string[] Filter { get; } = new string[] { "Gamecraft", "GamecraftPreview" }; |
|
|
|
|
|
|
|
public string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name; |
|
|
|
|
|
|
@@ -49,8 +49,9 @@ namespace GamecraftModdingAPI.Tests |
|
|
|
//MinimumSpecsCheckPatch.ForcePassMinimumSpecCheck = true; |
|
|
|
// disable some Gamecraft analytics |
|
|
|
//AnalyticsDisablerPatch.DisableAnalytics = true; |
|
|
|
// disable background music |
|
|
|
AudioTools.SetVolume(0.0f, "Music"); |
|
|
|
// disable background music |
|
|
|
Logging.MetaDebugLog("Audio Mixers: "+string.Join(",", AudioTools.GetMixers())); |
|
|
|
//AudioTools.SetVolume(0.0f, "Music"); // The game now sets this from settings again after this is called |
|
|
|
|
|
|
|
/*if (!FMODUnity.RuntimeManager.HasBankLoaded("Modded")) |
|
|
|
{ |
|
|
@@ -75,27 +76,38 @@ namespace GamecraftModdingAPI.Tests |
|
|
|
EventType.GameSwitchedTo, "gameswitch API debug")); |
|
|
|
|
|
|
|
// debug/test commands |
|
|
|
CommandManager.AddCommand(new SimpleCustomCommandEngine(() => { UnityEngine.Application.Quit(); }, |
|
|
|
if (Dependency.Hell("ExtraCommands")) |
|
|
|
{ |
|
|
|
CommandManager.AddCommand(new SimpleCustomCommandEngine(() => { UnityEngine.Application.Quit(); }, |
|
|
|
"Exit", "Close Gamecraft without any prompts")); |
|
|
|
CommandManager.AddCommand(new SimpleCustomCommandEngine<float>((float d) => { UnityEngine.Camera.main.fieldOfView = d; }, |
|
|
|
"SetFOV", "Set the player camera's field of view")); |
|
|
|
CommandManager.AddCommand(new SimpleCustomCommandEngine<float, float, float>( |
|
|
|
(x,y,z) => { |
|
|
|
bool success = GamecraftModdingAPI.Blocks.Movement.MoveConnectedBlocks( |
|
|
|
GamecraftModdingAPI.Blocks.BlockIdentifiers.LatestBlockID, |
|
|
|
new Unity.Mathematics.float3(x, y, z)); |
|
|
|
if (!success) |
|
|
|
{ |
|
|
|
GamecraftModdingAPI.Utility.Logging.CommandLogError("Blocks can only be moved in Build mode!"); |
|
|
|
} |
|
|
|
}, "MoveLastBlock", "Move the most-recently-placed block, and any connected blocks by the given offset")); |
|
|
|
CommandManager.AddCommand(new SimpleCustomCommandEngine<float, float, float>( |
|
|
|
(x,y,z) => { Blocks.Placement.PlaceBlock(Blocks.BlockIDs.AluminiumCube, new Unity.Mathematics.float3(x, y, z)); }, |
|
|
|
"PlaceAluminium", "Place a block of aluminium at the given coordinates")); |
|
|
|
Analytics.DeltaDNAHelper.PlayerLifetimeParameters plp = new Analytics.DeltaDNAHelper.PlayerLifetimeParameters(); |
|
|
|
CommandManager.AddCommand(new SimpleCustomCommandEngine<string>( |
|
|
|
(s) => { Analytics.DeltaDNAHelper.SendActionCompletedEvent(in plp, s.Replace(", ", " ")); }, |
|
|
|
"SendAnalyticsAction", "Send an analytics action")); |
|
|
|
CommandManager.AddCommand(new SimpleCustomCommandEngine<float>((float d) => { UnityEngine.Camera.main.fieldOfView = d; }, |
|
|
|
"SetFOV", "Set the player camera's field of view")); |
|
|
|
CommandManager.AddCommand(new SimpleCustomCommandEngine<float, float, float>( |
|
|
|
(x, y, z) => { |
|
|
|
bool success = GamecraftModdingAPI.Blocks.Movement.MoveConnectedBlocks( |
|
|
|
GamecraftModdingAPI.Blocks.BlockIdentifiers.LatestBlockID, |
|
|
|
new Unity.Mathematics.float3(x, y, z)); |
|
|
|
if (!success) |
|
|
|
{ |
|
|
|
GamecraftModdingAPI.Utility.Logging.CommandLogError("Blocks can only be moved in Build mode!"); |
|
|
|
} |
|
|
|
}, "MoveLastBlock", "Move the most-recently-placed block, and any connected blocks by the given offset")); |
|
|
|
CommandManager.AddCommand(new SimpleCustomCommandEngine<float, float, float>( |
|
|
|
(x, y, z) => { Blocks.Placement.PlaceBlock(Blocks.BlockIDs.AluminiumCube, new Unity.Mathematics.float3(x, y, z)); }, |
|
|
|
"PlaceAluminium", "Place a block of aluminium at the given coordinates")); |
|
|
|
Analytics.DeltaDNAHelper.PlayerLifetimeParameters plp = new Analytics.DeltaDNAHelper.PlayerLifetimeParameters(); |
|
|
|
CommandManager.AddCommand(new SimpleCustomCommandEngine<string>( |
|
|
|
(s) => { Analytics.DeltaDNAHelper.SendActionCompletedEvent(in plp, s.Replace(", ", " ")); }, |
|
|
|
"SendAnalyticsAction", "Send an analytics action")); |
|
|
|
} |
|
|
|
if (Dependency.Hell("GamecraftScripting", new Version("0.0.1.0"))) |
|
|
|
{ |
|
|
|
Logging.LogWarning("You're in GamecraftScripting dependency hell"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Logging.Log("Compatible GamecraftScripting detected"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void OnFixedUpdate() { } |
|
|
|