From 747b1fd60b42cdd68e614dd83a48aaba6288361f Mon Sep 17 00:00:00 2001 From: Joe R Date: Sat, 24 Jul 2021 21:03:51 -0400 Subject: [PATCH] Got Accordion's Revenge to work correctly under Kivy. --- pysollib/games/pushpin.py | 4 +--- pysollib/kivy/menubar.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pysollib/games/pushpin.py b/pysollib/games/pushpin.py index aaee0778..034d49de 100644 --- a/pysollib/games/pushpin.py +++ b/pysollib/games/pushpin.py @@ -380,9 +380,7 @@ class AccordionsRevenge(Accordion2): def updateText(self): if self.preview > 1: return - if self.finalrank == -1 and self.finalsuit == -1: - self.texts.base_rank.config('') - else: + if self.finalrank != -1 and self.finalsuit != -1: self.texts.base_rank.config(text=RANKS[self.finalrank] + ' - ' + SUITS_PL[self.finalsuit]) diff --git a/pysollib/kivy/menubar.py b/pysollib/kivy/menubar.py index 62005cf2..d5c4918b 100644 --- a/pysollib/kivy/menubar.py +++ b/pysollib/kivy/menubar.py @@ -589,6 +589,11 @@ class OptionsMenuDialog(LMenuDialog): self.menubar.tkopt.shisen_show_hint, self.menubar.mOptShisenShowHint) + self.addCheckNode(tv, rg, + _('Deal all cards (in Accordion type games)'), + self.menubar.tkopt.accordion_deal_all, + self.menubar.mOptAccordionDealAll) + # submenu.add_separator() # ------------------------------------------- @@ -1238,6 +1243,7 @@ class PysolMenubarTk: highlight_not_matching=BooleanVar(), mahjongg_show_removed=BooleanVar(), shisen_show_hint=BooleanVar(), + accordion_deal_all=BooleanVar(), sound=BooleanVar(), sound_sample_volume=IntVar(), sound_music_volume=IntVar(), @@ -1299,6 +1305,7 @@ class PysolMenubarTk: tkopt.shade_filled_stacks.set(opt.shade_filled_stacks) tkopt.mahjongg_show_removed.set(opt.mahjongg_show_removed) tkopt.shisen_show_hint.set(opt.shisen_show_hint) + tkopt.accordion_deal_all.set(opt.accordion_deal_all) tkopt.sound.set(opt.sound) tkopt.sound_sample_volume.set(opt.sound_sample_volume) tkopt.sound_music_volume.set(opt.sound_music_volume) @@ -2096,6 +2103,12 @@ the next time you restart the %(app)s""") % {'app': TITLE}) self.app.opt.shisen_show_hint = self.tkopt.shisen_show_hint.get() # self.game.updateMenus() + def mOptAccordionDealAll(self, *args): + if self._cancelDrag(break_pause=False): + return + self.app.opt.accordion_deal_all = self.tkopt.accordion_deal_all.get() + # self.game.updateMenus() + def mOptCardset(self, *event): if self._cancelDrag(break_pause=False): return