feat: Allow toggling recording from XBG
This commit is contained in:
parent
c5c7a4dc36
commit
56ca1fba14
@ -16,6 +16,8 @@ namespace TaikoModStuff
|
||||
public static ConfigEntry<int> configCustomFramerate;
|
||||
public static ConfigEntry<bool> configToggleVSync;
|
||||
|
||||
public static ConfigEntry<bool> 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!");
|
||||
|
19
RecordingEnable.cs
Normal file
19
RecordingEnable.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user