diff --git a/OfflineSaveLoad.cs b/OfflineSaveLoad.cs index d2ac332..2ab94f7 100644 --- a/OfflineSaveLoad.cs +++ b/OfflineSaveLoad.cs @@ -1,7 +1,7 @@ -using HarmonyLib; - -namespace TaikoModStuff -{ +using HarmonyLib; + +namespace TaikoModStuff +{ [HarmonyPatch] public class OfflineSaveLoad { diff --git a/Plugin.cs b/Plugin.cs index ac31040..9d60728 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -1,60 +1,70 @@ -using BepInEx; -using BepInEx.IL2CPP; -using BepInEx.Configuration; -using HarmonyLib; - -namespace TaikoModStuff -{ - [BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] - public class Plugin : BasePlugin - { - public static ConfigEntry configForceFontChange; - - public static ConfigEntry configCustomWindowedWidth; - public static ConfigEntry configCustomWindowedHeight; - - public static ConfigEntry configCustomFramerate; - public static ConfigEntry configToggleVSync; - +using BepInEx; +#if !BEPIN_5 +using BepInEx.IL2CPP; +#endif +using BepInEx.Configuration; +using HarmonyLib; + +namespace TaikoModStuff +{ + [BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] +#if !BEPIN_5 + public class Plugin : BasePlugin +#else + public class Plugin : BaseUnityPlugin +#endif + { + public static ConfigEntry configForceFontChange; + + public static ConfigEntry configCustomWindowedWidth; + public static ConfigEntry configCustomWindowedHeight; + + public static ConfigEntry configCustomFramerate; + public static ConfigEntry configToggleVSync; + public static ConfigEntry configEnableRecording; - public static ConfigEntry configOfflineSaveLoad; - public static ConfigEntry configQuickRestart; - public static ConfigEntry configQuickQuitSong; - - public override void Load() - { - // Add configurations - configForceFontChange = Config.Bind("General.Toggles", - "ForceFontChange", - false, - "Force the game font to the JP font"); - - configCustomWindowedWidth = Config.Bind("General.Resolution", - "CustomWidth", - 1920, - "Custom width to use. Set to 0 to disable setting the custom resolution"); - - configCustomWindowedHeight = Config.Bind("General.Resolution", - "CustomHeight", - 1080, - "Custom height to use"); - - configCustomFramerate = Config.Bind("General.Framerate", - "CustomFramerate", - 60, - "Custom framerate."); - - configToggleVSync = Config.Bind("General.Graphics", - "EnableVSync", - true, - "Enable VSync."); - - configEnableRecording = Config.Bind("General.Toggles", - "EnableGameBarRecording", - true, - "Enables Game Recording from the Xbox Game Bar where it was previously disabled."); - + public static ConfigEntry configOfflineSaveLoad; + public static ConfigEntry configQuickRestart; + public static ConfigEntry configQuickQuitSong; + +#if !BEPIN_5 + public override void Load() +#else + private void Awake() +#endif + { + // Add configurations + configForceFontChange = Config.Bind("General.Toggles", + "ForceFontChange", + false, + "Force the game font to the JP font"); + + configCustomWindowedWidth = Config.Bind("General.Resolution", + "CustomWidth", + 1920, + "Custom width to use. Set to 0 to disable setting the custom resolution"); + + configCustomWindowedHeight = Config.Bind("General.Resolution", + "CustomHeight", + 1080, + "Custom height to use"); + + configCustomFramerate = Config.Bind("General.Framerate", + "CustomFramerate", + 60, + "Custom framerate."); + + configToggleVSync = Config.Bind("General.Graphics", + "EnableVSync", + true, + "Enable VSync."); + + configEnableRecording = Config.Bind("General.Toggles", + "EnableGameBarRecording", + true, + "Enables Game Recording from the Xbox Game Bar where it was previously disabled."); + configOfflineSaveLoad = Config.Bind("General.Toggles", "OfflineSaveLoad", false, @@ -63,17 +73,17 @@ namespace TaikoModStuff configQuickRestart = Config.Bind("General.Toggles", "QuickRestart", false, - "Hit \"Backspace\" on your keyboard to quickly restart a song."); - + "Hit \"Backspace\" on your keyboard to quickly restart a song."); + configQuickQuitSong = Config.Bind("General.Toggles", "QuickQuitSong", false, - "Hit \"Escape\" on your keyboard to quickly quit a song and return to Song Select."); - - - var instance = new Harmony(PluginInfo.PLUGIN_NAME); - instance.PatchAll(typeof(FontChanger)); - instance.PatchAll(typeof(CustomResolution)); + "Hit \"Escape\" on your keyboard to quickly quit a song and return to Song Select."); + + + var instance = new Harmony(PluginInfo.PLUGIN_NAME); + instance.PatchAll(typeof(FontChanger)); + instance.PatchAll(typeof(CustomResolution)); instance.PatchAll(typeof(ForceFramerate)); instance.PatchAll(typeof(RecordingEnable)); @@ -84,10 +94,14 @@ namespace TaikoModStuff instance.PatchAll(typeof(QuickRestart)); if (Plugin.configQuickQuitSong.Value) - instance.PatchAll(typeof(QuickQuitSong)); - - // Plugin startup logic - Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!"); - } - } -} + instance.PatchAll(typeof(QuickQuitSong)); + + // Plugin startup logic +#if !BEPIN_5 + Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!"); +#else + Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!"); +#endif + } + } +} diff --git a/RecordingEnable.cs b/RecordingEnable.cs index d402107..de804fd 100644 --- a/RecordingEnable.cs +++ b/RecordingEnable.cs @@ -1,5 +1,9 @@ using HarmonyLib; +#if !BEPIN_5 using Il2CppMicrosoft.Xbox; +#else +using Microsoft.Xbox; +#endif namespace TaikoModStuff { diff --git a/TaikoModStuff-Bepin5.csproj b/TaikoModStuff-Bepin5.csproj new file mode 100644 index 0000000..6a756b2 --- /dev/null +++ b/TaikoModStuff-Bepin5.csproj @@ -0,0 +1,35 @@ + + + + net46 + TaikoModStuff + My first plugin + 1.3.0 + true + latest + TaikoModStuff + TaikoModStuff + TaikoModStuff + TaikoModStuff + + + + $(DefineConstants)TRACE;BEPIN_5 + + + + $(DefineConstants)TRACE;BEPIN_5 + + + + + + + + + + + + + +