private static void AfterGeoCutscene_Skip(UIStateGeoCutscene __instance, VideoPlaybackSourceDef ____sourcePlaybackDef) { try { if (!ShouldSkip(____sourcePlaybackDef)) { return; } Info("Skipping New Game Intro"); typeof(UIStateGeoCutscene).GetMethod("OnCancel", NonPublic | Instance)?.Invoke(__instance, null); } catch (Exception ex) { Error(ex); } }
private static bool ShouldSkip(VideoPlaybackSourceDef def) { if (def == null) { return(false); } string path = def.ResourcePath; Verbo("Checking video {0}", path); if (Config.Skip_Landings && path.Contains("LandingSequences")) { return(true); } if (Config.Skip_NewGameIntro && path.Contains("PP_Intro_Cutscene")) { return(true); } if (Config.Skip_HottestYear && path.Contains("Game_Intro_Cutscene")) { return(true); } return(false); }
private static void AfterHomeCutscene_Skip(UIStateHomeScreenCutscene __instance, VideoPlaybackSourceDef ____sourcePlaybackDef) { try { if (!ShouldSkip(____sourcePlaybackDef)) { return; } Info("Skipping Intro"); typeof(UIStateHomeScreenCutscene).GetMethod("OnCancel", NonPublic | Instance).Invoke(__instance, null); Info("Intro skipped. Unpatching home cutscene."); Unpatch(ref IntroEnterPatch); Config.Skip_HottestYear = false; // Allows video to be loaded after unpatch } catch (Exception ex) { Error(ex); } }