Skip to content

Commit f6e1b8c

Browse files
committed
🎨 Using SceneInfo
1 parent 6d229f6 commit f6e1b8c

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

Main.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using MelonLoader;
2+
using MuseDashMirror;
23
using SelectiveEffects.Managers;
34
using SelectiveEffects.Properties;
45

56
namespace SelectiveEffects;
67

78
public sealed partial class Main : MelonMod
89
{
9-
internal static bool IsGameMain { get; private set; }
1010
private static event Action ReloadEvent;
1111

1212
public override void OnInitializeMelon()
@@ -16,10 +16,8 @@ public override void OnInitializeMelon()
1616

1717
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
1818
{
19-
IsGameMain = string.Equals(sceneName, "GameMain");
20-
2119
// Reload if needed outside of GameMain
22-
if (IsGameMain) return;
20+
if (SceneInfo.IsGameScene) return;
2321
ReloadEvent?.Invoke();
2422
ReloadEvent = null;
2523
}
@@ -38,7 +36,7 @@ public override void OnLateInitializeMelon()
3836

3937
internal static void QueueReload(object sender, FileSystemEventArgs e)
4038
{
41-
if (!IsGameMain)
39+
if (!SceneInfo.IsGameScene)
4240
{
4341
Reload();
4442
return;

Patches/MainEffectsPatch.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using HarmonyLib;
22
using Il2CppAssets.Scripts.PeroTools.Managers;
3+
using MuseDashMirror;
34
using SelectiveEffects.Managers;
45
using UnityEngine;
56

@@ -12,7 +13,7 @@ internal static class MainEffectsPatch
1213
[HarmonyPostfix]
1314
internal static void InitPostfix(Effect __instance)
1415
{
15-
if (!Main.IsGameMain) return;
16+
if (!SceneInfo.IsGameScene) return;
1617

1718
if (SettingsManager.DisableAllEffects) return;
1819

0 commit comments

Comments
 (0)