Skip to content

Commit

Permalink
added an option to skip the "press any key" and the movie before the …
Browse files Browse the repository at this point in the history
…title screen
  • Loading branch information
d3xMachina committed Jun 1, 2024
1 parent e130ee4 commit 2258f05
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
17 changes: 15 additions & 2 deletions Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Last.Entity.Field;
using Last.Map;
using Last.UI;
using Last.UI.KeyInput;
using UnityEngine;

namespace FFPR_Fix
Expand Down Expand Up @@ -47,7 +48,20 @@ static void SkipSplashscreens(ref SplashController __instance)
if (Plugin.skipSplashscreens.Value)
{
Plugin.Log.LogInfo("Skip splashscreen.");
__instance.stateMachine.Change(SplashController.State.Title);
__instance.stateMachine?.Change(SplashController.State.Title);
}
}

[HarmonyPatch(typeof(TitleWindowController), nameof(TitleWindowController.UpdateNone))]
[HarmonyPostfix]
static void SkipPressAnyKey(TitleWindowController __instance)
{
if (Plugin.skipPressAnyKey.Value)
{
if (Last.Scene.SceneTitle.PreloadIsFinished())
{
__instance.stateMachine?.Change(TitleWindowController.State.Select);
}
}
}
}
Expand Down Expand Up @@ -84,7 +98,6 @@ static void SpriteMovespeed(ref float __result, Il2CppSystem.Nullable<FieldEntit
}
}


[HarmonyPatch(typeof(FieldPlayer), nameof(FieldPlayer.GetMoveSpeed))]
[HarmonyPostfix]
static void PlayerMovespeed(ref FieldPlayer __instance, ref float __result)
Expand Down
10 changes: 9 additions & 1 deletion Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class Plugin : BasePlugin
public static ConfigEntry<bool> hideFieldMinimap;
public static ConfigEntry<bool> hideWorldMinimap;
public static ConfigEntry<bool> skipSplashscreens;
public static ConfigEntry<bool> skipPressAnyKey;
public static ConfigEntry<float> playerMovespeed;
public static ConfigEntry<float> outBattleSpeedHackFactor;
public static ConfigEntry<float> battleSpeedHackFactor;
Expand Down Expand Up @@ -46,7 +47,7 @@ private void ApplyPatches()
Harmony.CreateAndPatchAll(typeof(UIPatch));
}

if (skipSplashscreens.Value)
if (skipSplashscreens.Value || skipPressAnyKey.Value)
{
Harmony.CreateAndPatchAll(typeof(SkipIntroPatch));
}
Expand Down Expand Up @@ -89,6 +90,13 @@ private void InitConfig()
"Skip the intro splashscreens."
);

skipPressAnyKey = Config.Bind(
"Skip intro",
"SkipPressAnyKey",
false,
"Skip the intro movie and the \"Press any key\" before the title screen."
);

outBattleSpeedHackFactor = Config.Bind(
"Hack",
"OutBattleSpeedHackFactor",
Expand Down

0 comments on commit 2258f05

Please sign in to comment.