mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
fixed situations where app doesnt shut down without crash
- when bot is closed while engine is running - when start is pressed when the game is minimized, then app is closed
This commit is contained in:
parent
db5299004b
commit
80c2a5e900
@ -29,6 +29,7 @@ class WindowClient:
|
||||
WindowClient.clients.append(self)
|
||||
|
||||
def destory(self):
|
||||
if self in WindowClient.clients:
|
||||
WindowClient.clients.remove(self)
|
||||
if len(WindowClient.clients) == 0:
|
||||
window_server.stop()
|
||||
|
@ -24,6 +24,7 @@ def _apply_theme(gui: 'GUI'):
|
||||
gui._console["fg"] = "#ffffff" if dark else "#000000"
|
||||
|
||||
|
||||
# noinspection PyProtectedMember
|
||||
def _create(gui: 'GUI'):
|
||||
engines = gui.engines
|
||||
|
||||
@ -105,7 +106,11 @@ def _create(gui: 'GUI'):
|
||||
|
||||
hotkey.set_hotkey(Key.F9, gui.funcs.start_engine)
|
||||
|
||||
# noinspection PyProtectedMember
|
||||
def set_destroy():
|
||||
if gui._bot_running:
|
||||
logging.info("Turn off the bot engine first")
|
||||
else:
|
||||
gui._destroyed = True
|
||||
|
||||
gui._root.protocol("WM_DELETE_WINDOW", set_destroy)
|
||||
|
Loading…
Reference in New Issue
Block a user