Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 1d07046

Browse files
committed
Update README.md, hide Console when it fails to init
1 parent de663f3 commit 1d07046

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
</a>
1313

1414
<img src="https://img.shields.io/github/downloads/sinai-dev/CppExplorer/total.svg" />
15+
16+
[Looking for a Mono version?](https://github.com/sinai-dev/MonoExplorer)
1517
</p>
1618

1719
### Known issues

src/Menu/MainMenu/MainMenu.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ public MainMenu()
2121
Pages.Add(new SearchPage());
2222
Pages.Add(new ConsolePage());
2323

24-
foreach (var page in Pages)
24+
for (int i = 0; i < Pages.Count; i++)
2525
{
26+
var page = Pages[i];
2627
page.Init();
2728
}
2829
}
2930

3031
public const int MainWindowID = 5000;
3132
public static Rect MainRect = new Rect(5,5, ModConfig.Instance.Default_Window_Size.x,ModConfig.Instance.Default_Window_Size.y);
3233

33-
private static readonly List<WindowPage> Pages = new List<WindowPage>();
34+
public static readonly List<WindowPage> Pages = new List<WindowPage>();
3435
private static int m_currentPage = 0;
3536

3637
public static void SetCurrentPage(int index)

src/Menu/MainMenu/Pages/ConsolePage.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public override void Init()
5858
}
5959
catch (Exception e)
6060
{
61-
MelonLogger.Log($"Error setting up console!\r\nMessage: {e.Message}\r\nStack: {e.StackTrace}");
61+
MelonLogger.Log($"Error setting up console!\r\nMessage: {e.Message}");
62+
MainMenu.SetCurrentPage(0);
63+
MainMenu.Pages.Remove(this);
6264
}
6365
}
6466

0 commit comments

Comments
 (0)