Skip to content

Commit 8be1d67

Browse files
committed
🎨 Using SceneInfo
1 parent 8207460 commit 8be1d67

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Main.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using StricterJudge.Properties;
1+
using MuseDashMirror;
2+
using StricterJudge.Properties;
23

34
namespace StricterJudge;
45

56
public sealed partial class Main : MelonMod
67
{
7-
private static bool IsGameMain { get; set; }
8-
98
private static event Action ReloadEvent;
109

1110
public override void OnInitializeMelon()
@@ -16,10 +15,8 @@ public override void OnInitializeMelon()
1615

1716
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
1817
{
19-
IsGameMain = string.Equals(sceneName, "GameMain");
20-
2118
// Reload if needed outside of GameMain
22-
if (IsGameMain) return;
19+
if (SceneInfo.IsGameScene) return;
2320
ReloadEvent?.Invoke();
2421
ReloadEvent = null;
2522
}
@@ -31,7 +28,7 @@ public override void OnLateInitializeMelon()
3128

3229
internal static void QueueReload(object sender, FileSystemEventArgs e)
3330
{
34-
if (!IsGameMain)
31+
if (!SceneInfo.IsGameScene)
3532
{
3633
Reload();
3734
return;

0 commit comments

Comments
 (0)