67 lines
2.7 KiB
C#
67 lines
2.7 KiB
C#
using System;
|
|
using System.Reflection;
|
|
using Harmony;
|
|
using GamecraftModdingAPI.Events;
|
|
using GamecraftModdingAPI.Utility;
|
|
|
|
namespace GamecraftModdingAPI.Tests
|
|
{
|
|
// unused by design
|
|
public class GamecraftModdingAPIPluginTest
|
|
#if DEBUG
|
|
: IllusionPlugin.IEnhancedPlugin
|
|
#endif
|
|
{
|
|
public static HarmonyInstance harmony { get; protected set; }
|
|
|
|
public string[] Filter { get; } = new string[] { "Gamecraft" };
|
|
|
|
public string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name;
|
|
|
|
public string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
|
|
|
public string HarmonyID { get; } = "org.git.exmods.modtainers.gamecraftmoddingapi";
|
|
|
|
public void OnApplicationQuit()
|
|
{
|
|
GamecraftModdingAPI.Main.Shutdown();
|
|
}
|
|
|
|
public void OnApplicationStart()
|
|
{
|
|
GamecraftModdingAPI.Main.Init();
|
|
// in case Steam is not installed/running
|
|
// this will crash the game slightly later during startup
|
|
//SteamInitPatch.ForcePassSteamCheck = true;
|
|
// in case running in a VM
|
|
//MinimumSpecsCheckPatch.ForcePassMinimumSpecCheck = true;
|
|
|
|
// debug/test handlers
|
|
Manager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("App Inited event!"); }, () => { },
|
|
EventType.ApplicationInitialized, "appinit API debug"));
|
|
Manager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Menu Activated event!"); },
|
|
() => { Logging.Log("Menu Destroyed event!"); },
|
|
EventType.Menu, "menuact API debug"));
|
|
Manager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Menu Switched To event!"); }, () => { },
|
|
EventType.MenuSwitchedTo, "menuswitch API debug"));
|
|
Manager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Game Activated event!"); },
|
|
() => { Logging.Log("Game Destroyed event!"); },
|
|
EventType.Game, "gameact API debug"));
|
|
Manager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Game Reloaded event!"); }, () => { },
|
|
EventType.GameReloaded, "gamerel API debug"));
|
|
Manager.AddEventHandler(new SimpleEventHandlerEngine(() => { Logging.Log("Game Switched To event!"); }, () => { },
|
|
EventType.GameSwitchedTo, "gameswitch API debug"));
|
|
|
|
}
|
|
|
|
public void OnFixedUpdate() { }
|
|
|
|
public void OnLateUpdate() { }
|
|
|
|
public void OnLevelWasInitialized(int level) { }
|
|
|
|
public void OnLevelWasLoaded(int level) { }
|
|
|
|
public void OnUpdate() { }
|
|
}
|
|
}
|