From fafe244e21a46b228e015bc1c68b5a0a2eede5b4 Mon Sep 17 00:00:00 2001 From: Fluto Date: Sat, 20 Aug 2022 14:36:10 +1000 Subject: [PATCH] Added automatically start game patch --- .../Patches/AutomaticallyStartGamePatch.cs | 31 +++++++++++++++++++ TakoTako/Plugin.cs | 9 ++++++ 2 files changed, 40 insertions(+) create mode 100644 TakoTako/Patches/AutomaticallyStartGamePatch.cs diff --git a/TakoTako/Patches/AutomaticallyStartGamePatch.cs b/TakoTako/Patches/AutomaticallyStartGamePatch.cs new file mode 100644 index 0000000..13f631e --- /dev/null +++ b/TakoTako/Patches/AutomaticallyStartGamePatch.cs @@ -0,0 +1,31 @@ +using System.Diagnostics.CodeAnalysis; +using HarmonyLib; +using Il2CppMicrosoft.Xbox; + +namespace TakoTako.Patches; + +[HarmonyPatch] +[SuppressMessage("ReSharper", "InconsistentNaming")] +public class AutomaticallyStartGamePatch +{ + /// + /// Simply load the next scene, I don't think this scene does anything specific? + /// + [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.Instance.MySoundManager.CommonSePlay("don", false); + __instance.switchNextEULAState(); + return false; + } + + return true; + } +} diff --git a/TakoTako/Plugin.cs b/TakoTako/Plugin.cs index 6871570..ef53460 100644 --- a/TakoTako/Plugin.cs +++ b/TakoTako/Plugin.cs @@ -22,6 +22,7 @@ namespace TakoTako #endif { public ConfigEntry ConfigSkipSplashScreen; + public ConfigEntry ConfigAutomaticallyStartGame; public ConfigEntry ConfigDisableScreenChangeOnFocus; public ConfigEntry ConfigFixSignInScreen; public ConfigEntry 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, @@ -135,6 +141,9 @@ namespace TakoTako if (ConfigSkipSplashScreen.Value) _harmony.PatchAll(typeof(SkipSplashScreenPatch)); + + if (ConfigAutomaticallyStartGame.Value) + _harmony.PatchAll(typeof(AutomaticallyStartGamePatch)); if (ConfigFixSignInScreen.Value) _harmony.PatchAll(typeof(SignInPatch));