1
0
mirror of synced 2024-11-23 22:10:57 +01:00

feat: Allow toggling recording from XBG

This commit is contained in:
Repflez 2022-02-22 04:53:43 -07:00
parent c5c7a4dc36
commit 56ca1fba14
2 changed files with 26 additions and 0 deletions

View File

@ -16,6 +16,8 @@ namespace TaikoModStuff
public static ConfigEntry<int> configCustomFramerate; public static ConfigEntry<int> configCustomFramerate;
public static ConfigEntry<bool> configToggleVSync; public static ConfigEntry<bool> configToggleVSync;
public static ConfigEntry<bool> configEnableRecording;
public override void Load() public override void Load()
{ {
// Add configurations // Add configurations
@ -44,12 +46,17 @@ namespace TaikoModStuff
true, true,
"Enable VSync."); "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); var instance = new Harmony(PluginInfo.PLUGIN_NAME);
instance.PatchAll(typeof(FontChanger)); instance.PatchAll(typeof(FontChanger));
instance.PatchAll(typeof(CustomResolution)); instance.PatchAll(typeof(CustomResolution));
instance.PatchAll(typeof(ForceFramerate)); instance.PatchAll(typeof(ForceFramerate));
instance.PatchAll(typeof(RecordingEnable));
// Plugin startup logic // Plugin startup logic
Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!"); Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");

19
RecordingEnable.cs Normal file
View File

@ -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;
}
}
}