99
1010namespace KiraiMod . Core . UI
1111{
12+ [ Module ]
1213 public static class LegacyGUIManager
1314 {
1415 public static event Action OnLoad ;
@@ -22,12 +23,13 @@ public static class LegacyGUIManager
2223 private static BaseInputModule inputFix ;
2324 private static BaseInputModule inputOrig ;
2425
26+ [ Configure < bool > ( "Visuals.Legacy UI" , false , Saved : false ) ]
2527 public static bool Showing
2628 {
27- get => UserInterface . active ;
29+ get => UserInterface != null && UserInterface . active ;
2830 set
2931 {
30- if ( UserInterface . active == value )
32+ if ( Showing == value )
3133 return ;
3234
3335 UserInterface . active = value ;
@@ -41,7 +43,7 @@ static LegacyGUIManager()
4143 {
4244 Events . UIManagerLoaded += OnUIManagerLoaded ;
4345
44- Plugin . cfg . Bind ( "GUI" , "Keybind" , new Key [ ] { Key . RightShift } , "The keybind you want to use to open the GUI" ) . Register ( ( ) => Showing ^= true ) ;
46+ Plugin . Configuration . Bind ( "GUI" , "Keybind" , new Key [ ] { Key . RightShift } , "The keybind you want to use to open the GUI" ) . Register ( ( ) => Showing ^= true ) ;
4547 }
4648
4749 private static void OnUIManagerLoaded ( )
@@ -52,7 +54,7 @@ private static void OnUIManagerLoaded()
5254
5355 private static void SetupFix ( )
5456 {
55- var sys = GameObject . Find ( "_Application/UiEventSystem" ) ;
57+ GameObject sys = GameObject . Find ( "_Application/UiEventSystem" ) ;
5658 inputOrig = sys . GetComponent < EventSystem > ( ) . m_SystemInputModules [ 0 ] ;
5759 ( inputFix = sys . AddComponent < StandaloneInputModule > ( ) ) . enabled = false ;
5860 }
@@ -80,7 +82,7 @@ private static void CreateUI()
8082
8183 OnLoadLate ? . StableInvoke ( ) ;
8284
83- Plugin . log . LogInfo ( "Loaded GUI" ) ;
85+ Plugin . Logger . LogInfo ( "Loaded GUI" ) ;
8486 }
8587
8688 private static void HandleMember ( MemberAttribute member )
@@ -134,7 +136,7 @@ private static void HandleMember(MemberAttribute member)
134136
135137 if ( found ) continue ;
136138
137- Plugin . log . LogDebug ( "Creating new section: " + section ) ;
139+ Plugin . Logger . LogDebug ( "Creating new section: " + section ) ;
138140 lowest = new ( section , lowest ) ;
139141 }
140142
0 commit comments