[F] Some compatability for 2p mode

pull/49/head
Clansty 2024-07-30 00:39:58 +08:00
parent 3fcdf38d4a
commit 247f8f132b
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
5 changed files with 43 additions and 39 deletions

View File

@ -32,6 +32,7 @@ LoadAssetBundleWithoutManifest=true
# Skip "New Event" and "Information" text boxes for new users
SkipEventInfo=true
# Random BGM, put Mai2Cue.{acb,awb} of old version of the game in `LocalAssets\Mai2Cue` and rename them
# Do not enable when SinglePlayer is off
RandomBgm=false
# Play "Master" difficulty on Demo screen
DemoMaster=true
@ -39,6 +40,7 @@ DemoMaster=true
ExecOnIdle=""
ExecOnEntry=""
# Disable timers
# Not recommand to enable when SinglePlayer is off
ExtendTimer=true
# Save immediate after playing a song
ImmediateSave=true

View File

@ -12,10 +12,13 @@ namespace AquaMai.UX
[HarmonyPatch(typeof(AdvDemoProcess), "OnStart")]
public static void AdvDemoProcessPostStart()
{
var userOption = Singleton<GamePlayManager>.Instance.GetGameScore(0).UserOption;
userOption.NoteSpeed = OptionNotespeedID.Speed7_0;
for (int i = 0; i < 2; i++)
{
var userOption = Singleton<GamePlayManager>.Instance.GetGameScore(i).UserOption;
userOption.NoteSpeed = OptionNotespeedID.Speed6_5;
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(GamePlayManager), "InitializeAdvertise")]
public static void PreInitializeAdvertise()
@ -24,4 +27,4 @@ namespace AquaMai.UX
GameManager.SelectDifficultyID[1] = 3;
}
}
}
}

View File

@ -52,5 +52,31 @@ namespace AquaMai.UX
____monitors[0].SetButtonPressed(InputManager.ButtonSetting.Button04);
Traverse.Create(__instance).Method("OnTimeUp").GetValue();
}
[HarmonyPrefix]
[HarmonyPatch(typeof(PlInformationMonitor), "IsPlayPlInfoEnd")]
public static bool IWontTapOrSlideVigorously(ref bool __result)
{
__result = true;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(GameOverMonitor), "IsPlayEnd")]
public static bool GameOverMonitorPlayEnd(ref bool __result)
{
__result = true;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(GameOverProcess), "OnUpdate")]
public static void GameOverProcessOnUpdate(ref GameOverProcess.GameOverSequence ____state)
{
if (____state == GameOverProcess.GameOverSequence.SkyChange)
{
____state = GameOverProcess.GameOverSequence.Disp;
}
}
}
}
}

View File

@ -14,10 +14,6 @@ public class LoadLocalBga
[HarmonyPatch(typeof(GameCtrl), "IsReady")]
public static void LoadLocalBgaAwake(GameObject ____movieMaskObj)
{
var components = ____movieMaskObj.GetComponentsInChildren<Component>(false);
var movie = components.FirstOrDefault(it => it.name == "Movie");
if (movie is null) return;
var music = Singleton<DataManager>.Instance.GetMusic(GameManager.SelectMusicID[0]);
if (music is null) return;
@ -28,8 +24,13 @@ public class LoadLocalBga
if (jacket is null)
{
MelonLogger.Msg("No jacket found for music " + music);
return;
}
else
var components = ____movieMaskObj.GetComponentsInChildren<Component>(false);
var movies = components.Where(it => it.name == "Movie");
foreach (var movie in movies)
{
// If I create a new RawImage component, the jacket will be not be displayed
// I think it will be difficult to make it work with RawImage
@ -39,7 +40,5 @@ public class LoadLocalBga
sprite.sprite = Sprite.Create(jacket, new Rect(0, 0, jacket.width, jacket.height), new Vector2(0.5f, 0.5f));
sprite.material = new Material(Shader.Find("Sprites/Default"));
}
// movie.gameObject.SetActive(false);
}
}

View File

@ -92,31 +92,5 @@ namespace AquaMai.UX
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(PlInformationMonitor), "IsPlayPlInfoEnd")]
public static bool IWontTapOrSlideVigorously(ref bool __result)
{
__result = true;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(GameOverMonitor), "IsPlayEnd")]
public static bool GameOverMonitorPlayEnd(ref bool __result)
{
__result = true;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(GameOverProcess), "OnUpdate")]
public static void GameOverProcessOnUpdate(ref GameOverProcess.GameOverSequence ____state)
{
if (____state == GameOverProcess.GameOverSequence.SkyChange)
{
____state = GameOverProcess.GameOverSequence.Disp;
}
}
}
}
}