1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-22 03:04:09 -04:00

Hack to fix crashes on closing game selection screen

This commit is contained in:
Joe R 2025-04-10 20:28:32 -04:00
parent 5e832cf63b
commit 0e44930db3

View file

@ -1262,7 +1262,17 @@ class PysolMenubarTkCommon:
def _mSelectGameDialog(self, d): def _mSelectGameDialog(self, d):
if self.game.pause: if self.game.pause:
if self.wasPaused: if self.wasPaused:
self.game.doPause() # Nasty hack here. This is the only way I was able to
# make the flow work while reliably avoiding crashes and
# graphical glitches when both the preview auto-scaling
# and the pause are in effect.
try:
self.game.doPause()
except Exception:
self.game.resizeGame()
self.game.doPause()
if self.game.pause:
self.game.doPause()
if d.status == 0 and d.button == 0 and d.gameid != self.game.id: if d.status == 0 and d.button == 0 and d.gameid != self.game.id:
self.tkopt.gameid.set(d.gameid) self.tkopt.gameid.set(d.gameid)
self.tkopt.gameid_popular.set(d.gameid) self.tkopt.gameid_popular.set(d.gameid)