@@ -212,9 +212,8 @@ def on_tracker_events(self, events: list[str]):
212
212
if events :
213
213
self .ui .update_tracker_and_locations_table (update_highlights = True )
214
214
215
- def run_gui (self ):
216
- """Import kivy UI system and start running it as self.ui_task."""
217
- from kvui import GameManager
215
+ def make_gui (self ) -> typing .Type ["kvui.GameManager" ]:
216
+ ui = super ().make_gui () # before the kivy imports so kvui gets loaded first
218
217
219
218
from kivy .metrics import dp
220
219
from kivy .uix .button import Button
@@ -246,7 +245,7 @@ class TreeViewButton(Button, TreeViewNode):
246
245
class TreeViewScrollView (ScrollView , TreeViewNode ):
247
246
pass
248
247
249
- class ManualManager (GameManager ):
248
+ class ManualManager (ui ):
250
249
logging_pairs = [
251
250
("Client" , "Archipelago" ),
252
251
("Manual" , "Manual" ),
@@ -287,9 +286,6 @@ def build(self) -> Layout:
287
286
288
287
self .build_tracker_and_locations_table ()
289
288
290
- if tracker_loaded :
291
- self .ctx .build_gui (self )
292
-
293
289
return self .container
294
290
295
291
def clear_lists (self ):
@@ -663,12 +659,7 @@ def victory_button_callback(self, button):
663
659
self .ctx .items_received .append ("__Victory__" )
664
660
self .ctx .syncing = True
665
661
666
- self .ui = ManualManager (self )
667
-
668
- if tracker_loaded :
669
- self .load_kv ()
670
-
671
- self .ui_task = asyncio .create_task (self .ui .async_run (), name = "UI" )
662
+ return ManualManager
672
663
673
664
async def game_watcher_manual (ctx : ManualContext ):
674
665
while not ctx .exit_event .is_set ():
0 commit comments