From 21debfac4d1aa2bc06ac989b5145ee3b05c867d1 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Thu, 13 Dec 2018 09:19:54 -0500 Subject: [PATCH] Ability to abort computer to computer game --- DemoPrograms/Demo_Uno_Card_Game.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DemoPrograms/Demo_Uno_Card_Game.py b/DemoPrograms/Demo_Uno_Card_Game.py index 35fd14c5..a275789e 100644 --- a/DemoPrograms/Demo_Uno_Card_Game.py +++ b/DemoPrograms/Demo_Uno_Card_Game.py @@ -1235,6 +1235,13 @@ class Match(): pass elif turnType == 'Computer': + event, values = Match.window.Read(timeout=0) + if event == '_QUIT_': + if sg.PopupYesNo('Do you really want to quit?') == 'Yes': + self.matchAbort = True + self.matchComplete = True + break + self.elements['Console'] = '{}\'s Turn'.format(self.players[self.turn].getName()) self.drawScreen(self.hideComputerHands) if not self.simulation: