diff --git a/Plugin.cs b/Plugin.cs index f203ae4..a5299ce 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -16,6 +16,8 @@ namespace TaikoModStuff public static ConfigEntry configCustomFramerate; public static ConfigEntry configToggleVSync; + public static ConfigEntry configEnableRecording; + public override void Load() { // Add configurations @@ -44,12 +46,17 @@ namespace TaikoModStuff true, "Enable VSync."); + configEnableRecording = Config.Bind("General.Toggles", + "EnableGameBarRecording", + true, + "Enables Game Recording from the Xbox Game Bar where it was previously disabled."); var instance = new Harmony(PluginInfo.PLUGIN_NAME); instance.PatchAll(typeof(FontChanger)); instance.PatchAll(typeof(CustomResolution)); instance.PatchAll(typeof(ForceFramerate)); + instance.PatchAll(typeof(RecordingEnable)); // Plugin startup logic Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!"); diff --git a/RecordingEnable.cs b/RecordingEnable.cs new file mode 100644 index 0000000..d402107 --- /dev/null +++ b/RecordingEnable.cs @@ -0,0 +1,19 @@ +using HarmonyLib; +using Il2CppMicrosoft.Xbox; + +namespace TaikoModStuff +{ + internal class RecordingEnable + { + // Skip the original method, we're doing magic here + [HarmonyPatch(typeof(GdkHelpers), "CaptureDisable")] + [HarmonyPrefix] + static bool PrefixRecording() + { + if (Plugin.configEnableRecording.Value) + return false; + + else return true; + } + } +}