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

Added automatically start game patch

This commit is contained in:
Fluto 2022-08-20 14:36:10 +10:00
parent 066998aa39
commit fafe244e21
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,31 @@
using System.Diagnostics.CodeAnalysis;
using HarmonyLib;
using Il2CppMicrosoft.Xbox;
namespace TakoTako.Patches;
[HarmonyPatch]
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class AutomaticallyStartGamePatch
{
/// <summary>
/// Simply load the next scene, I don't think this scene does anything specific?
/// </summary>
[HarmonyPatch(typeof(GameTitleManager), nameof(GameTitleManager.updateTitleMain))]
[HarmonyPrefix]
private static bool updateTitleMain_Prefix(GameTitleManager __instance)
{
if (GdkHelpers.Helpers.IsInvited() && GameTitleManager.m_loadState == GameTitleManager.LoadState.LoadCompleted)
{
// ignored
}
else
{
TaikoSingletonMonoBehaviour<CommonObjects>.Instance.MySoundManager.CommonSePlay("don", false);
__instance.switchNextEULAState();
return false;
}
return true;
}
}

View File

@ -22,6 +22,7 @@ namespace TakoTako
#endif
{
public ConfigEntry<bool> ConfigSkipSplashScreen;
public ConfigEntry<bool> ConfigAutomaticallyStartGame;
public ConfigEntry<bool> ConfigDisableScreenChangeOnFocus;
public ConfigEntry<bool> ConfigFixSignInScreen;
public ConfigEntry<bool> ConfigEnableCustomSongs;
@ -107,6 +108,11 @@ namespace TakoTako
true,
"When true this will skip the intro");
ConfigAutomaticallyStartGame = Config.Bind("General",
"AutomaticallyStartGame",
true,
"When true this will continue on the main menu");
ConfigSkipDLCCheck = Config.Bind("General",
"SkipDLCCheck",
true,
@ -136,6 +142,9 @@ namespace TakoTako
if (ConfigSkipSplashScreen.Value)
_harmony.PatchAll(typeof(SkipSplashScreenPatch));
if (ConfigAutomaticallyStartGame.Value)
_harmony.PatchAll(typeof(AutomaticallyStartGamePatch));
if (ConfigFixSignInScreen.Value)
_harmony.PatchAll(typeof(SignInPatch));