-
Notifications
You must be signed in to change notification settings - Fork 1
/
Core.cs
40 lines (32 loc) · 915 Bytes
/
Core.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
namespace MUI;
public static class Core{
private static bool running = true;
public static bool Running { get => running; set => running = value; }
private static string title = "";
public static string Title { get => title; set => title = value; }
private static string info = "";
public static string Info { get => info; set => info = value; }
private static State root = null;
public static State Root { get => root; set => root = value; }
private static State state = null;
public static State State { get => state; set{Input.Selection=0; state=value;} }
public static void Entry(){
try{
State = Root;
Running = true;
TUI.Reset();
while(Running)
{
State.Draw();
State.Update();
Input.Handle();
if(Running) State.Update();
}
}
catch(Exception e)
{
TUI.Message($"Entry failed. {e}",3,true);
TUI.AskString("[Enter to Continue]");
}
}
}