BizHawkClient: Remove `run_gui` in favor of `make_gui` (#3910)

This commit is contained in:
Bryce Wilson 2024-09-11 04:22:04 -07:00 committed by GitHub
parent 874392756b
commit c9f1a21bd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 9 deletions

View File

@ -662,7 +662,7 @@ class CommonContext:
logger.exception(msg, exc_info=exc_info, extra={'compact_gui': True}) logger.exception(msg, exc_info=exc_info, extra={'compact_gui': True})
self._messagebox_connection_loss = self.gui_error(msg, exc_info[1]) self._messagebox_connection_loss = self.gui_error(msg, exc_info[1])
def make_gui(self) -> type: def make_gui(self) -> typing.Type["kvui.GameManager"]:
"""To return the Kivy App class needed for run_gui so it can be overridden before being built""" """To return the Kivy App class needed for run_gui so it can be overridden before being built"""
from kvui import GameManager from kvui import GameManager

View File

@ -59,14 +59,10 @@ class BizHawkClientContext(CommonContext):
self.bizhawk_ctx = BizHawkContext() self.bizhawk_ctx = BizHawkContext()
self.watcher_timeout = 0.5 self.watcher_timeout = 0.5
def run_gui(self): def make_gui(self):
from kvui import GameManager ui = super().make_gui()
ui.base_title = "Archipelago BizHawk Client"
class BizHawkManager(GameManager): return ui
base_title = "Archipelago BizHawk Client"
self.ui = BizHawkManager(self)
self.ui_task = asyncio.create_task(self.ui.async_run(), name="UI")
def on_package(self, cmd, args): def on_package(self, cmd, args):
if cmd == "Connected": if cmd == "Connected":