1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Added face-down flip assist option.

This commit is contained in:
Joe R 2023-05-18 18:54:37 -04:00
parent 47c51f454c
commit 3a37c1157d
16 changed files with 120 additions and 16 deletions

View file

@ -17,6 +17,7 @@ Right mouse button (or double-click the left button):
Middle mouse button (or Ctrl-click the right button): Middle mouse button (or Ctrl-click the right button):
<ul type="disc"> <ul type="disc">
<li> View partially overlapped cards <li> View partially overlapped cards
<li> If enabled, this can also be used to peek at face-down cards
</ul> </ul>
<p> <p>
Ctrl-click the left mouse button: Ctrl-click the left mouse button:

View file

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-05-12 21:40-0400\n" "PO-Revision-Date: 2023-05-18 18:49-0400\n"
"Last-Translator: H. Schaekel <Holger.Schaekel@web.de>\n" "Last-Translator: H. Schaekel <Holger.Schaekel@web.de>\n"
"Language-Team: German\n" "Language-Team: German\n"
"Language: de\n" "Language: de\n"
@ -2552,6 +2552,9 @@ msgstr "Karten hervorheben"
msgid "Enable highlight same rank" msgid "Enable highlight same rank"
msgstr "Gleichen Rang hervorheben" msgstr "Gleichen Rang hervorheben"
msgid "Enable face-down peek"
msgstr ""
#: pysollib/kivy/menubar.py:576 #: pysollib/kivy/menubar.py:576
msgid "Highlight no matching" msgid "Highlight no matching"
msgstr "Nicht passende hervorheben" msgstr "Nicht passende hervorheben"
@ -3712,6 +3715,9 @@ msgstr "Hervorhebung Karten: "
msgid "Highlight same rank: " msgid "Highlight same rank: "
msgstr "Gleichen Rang hervorheben: " msgstr "Gleichen Rang hervorheben: "
msgid "Face-down peeks: "
msgstr ""
#: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620 #: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620
#: pysollib/tk/tkstats.py:615 #: pysollib/tk/tkstats.py:615
msgid "" msgid ""
@ -5058,6 +5064,9 @@ msgstr "Hervorhebung Karten:"
msgid "Enable highlight same &rank" msgid "Enable highlight same &rank"
msgstr "Gleichen Rang hervorheben:" msgstr "Gleichen Rang hervorheben:"
msgid "Enable face-down &peek"
msgstr ""
#: pysollib/ui/tktile/menubar.py:503 #: pysollib/ui/tktile/menubar.py:503
#, fuzzy #, fuzzy
msgid "Highlight &no matching" msgid "Highlight &no matching"

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: 1.02\n" "Project-Id-Version: 1.02\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-05-12 21:40-0400\n" "PO-Revision-Date: 2023-05-18 18:49-0400\n"
"Last-Translator: Eric Rausch <neelix570@gmail.com>\n" "Last-Translator: Eric Rausch <neelix570@gmail.com>\n"
"Language-Team: French\n" "Language-Team: French\n"
"Language: fr\n" "Language: fr\n"
@ -2592,6 +2592,9 @@ msgstr "Surbrillance des cartes"
msgid "Enable highlight same rank" msgid "Enable highlight same rank"
msgstr "Surbrillance des équivalents" msgstr "Surbrillance des équivalents"
msgid "Enable face-down peek"
msgstr ""
#: pysollib/kivy/menubar.py:576 #: pysollib/kivy/menubar.py:576
msgid "Highlight no matching" msgid "Highlight no matching"
msgstr "Surbrillance sans correspondance" msgstr "Surbrillance sans correspondance"
@ -3762,6 +3765,9 @@ msgstr "Surbrillance cartes: "
msgid "Highlight same rank: " msgid "Highlight same rank: "
msgstr "Surbrillance valeurs identiques: " msgstr "Surbrillance valeurs identiques: "
msgid "Face-down peeks: "
msgstr ""
#: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620 #: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620
#: pysollib/tk/tkstats.py:615 #: pysollib/tk/tkstats.py:615
msgid "" msgid ""
@ -5102,6 +5108,9 @@ msgstr "Surbrillance des &cartes"
msgid "Enable highlight same &rank" msgid "Enable highlight same &rank"
msgstr "Surbrillance des &équivalents" msgstr "Surbrillance des &équivalents"
msgid "Enable face-down &peek"
msgstr ""
#: pysollib/ui/tktile/menubar.py:503 #: pysollib/ui/tktile/menubar.py:503
msgid "Highlight &no matching" msgid "Highlight &no matching"
msgstr "Surbrilla&nce incorrectes" msgstr "Surbrilla&nce incorrectes"

View file

@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: it_pysol\n" "Project-Id-Version: it_pysol\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-05-12 21:40-0400\n" "PO-Revision-Date: 2023-05-18 18:51-0400\n"
"Last-Translator: Giuliano Colla <giuliano.colla@gmail.com>\n" "Last-Translator: Giuliano Colla <giuliano.colla@gmail.com>\n"
"Language-Team: Italiano <it@li.org>\n" "Language-Team: Italiano <it@li.org>\n"
"Language: it\n" "Language: it\n"
@ -2608,6 +2608,9 @@ msgstr "Abilita evidenzia &carte"
msgid "Enable highlight same rank" msgid "Enable highlight same rank"
msgstr "Abilita evidenzia stesso valo&re" msgstr "Abilita evidenzia stesso valo&re"
msgid "Enable face-down peek"
msgstr ""
#: pysollib/kivy/menubar.py:576 #: pysollib/kivy/menubar.py:576
#, fuzzy #, fuzzy
msgid "Highlight no matching" msgid "Highlight no matching"
@ -3823,6 +3826,9 @@ msgstr "Evidenzia carte: "
msgid "Highlight same rank: " msgid "Highlight same rank: "
msgstr "Evidenzia stesso valore: " msgstr "Evidenzia stesso valore: "
msgid "Face-down peeks: "
msgstr ""
#: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620 #: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620
#: pysollib/tk/tkstats.py:615 #: pysollib/tk/tkstats.py:615
msgid "" msgid ""
@ -5168,6 +5174,9 @@ msgstr "Abilita evidenzia &carte"
msgid "Enable highlight same &rank" msgid "Enable highlight same &rank"
msgstr "Abilita evidenzia stesso valo&re" msgstr "Abilita evidenzia stesso valo&re"
msgid "Enable face-down &peek"
msgstr ""
#: pysollib/ui/tktile/menubar.py:503 #: pysollib/ui/tktile/menubar.py:503
msgid "Highlight &no matching" msgid "Highlight &no matching"
msgstr "Abilita non corrispondenti" msgstr "Abilita non corrispondenti"

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-05-12 21:41-0400\n" "PO-Revision-Date: 2023-05-18 18:51-0400\n"
"Last-Translator: Jerzy Trzeciak <artusek@wp.pl>\n" "Last-Translator: Jerzy Trzeciak <artusek@wp.pl>\n"
"Language-Team: Polish <pl@li.org>\n" "Language-Team: Polish <pl@li.org>\n"
"Language: pl\n" "Language: pl\n"
@ -2642,6 +2642,9 @@ msgstr "Włącz podświetlanie kart"
msgid "Enable highlight same rank" msgid "Enable highlight same rank"
msgstr "Podświetlaj karty o jednakowej sile" msgstr "Podświetlaj karty o jednakowej sile"
msgid "Enable face-down peek"
msgstr ""
#: pysollib/kivy/menubar.py:576 #: pysollib/kivy/menubar.py:576
#, fuzzy #, fuzzy
msgid "Highlight no matching" msgid "Highlight no matching"
@ -3857,6 +3860,9 @@ msgstr "Podświetlenie kart: "
msgid "Highlight same rank: " msgid "Highlight same rank: "
msgstr "Podświetlenie jednakowych wartości: " msgstr "Podświetlenie jednakowych wartości: "
msgid "Face-down peeks: "
msgstr ""
#: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620 #: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620
#: pysollib/tk/tkstats.py:615 #: pysollib/tk/tkstats.py:615
msgid "" msgid ""
@ -5216,6 +5222,9 @@ msgstr "Włącz podświetlanie kart"
msgid "Enable highlight same &rank" msgid "Enable highlight same &rank"
msgstr "Podświetlaj karty o jednakowej sile" msgstr "Podświetlaj karty o jednakowej sile"
msgid "Enable face-down &peek"
msgstr ""
#: pysollib/ui/tktile/menubar.py:503 #: pysollib/ui/tktile/menubar.py:503
msgid "Highlight &no matching" msgid "Highlight &no matching"
msgstr "Podświetlaj brak dopasowa&nia" msgstr "Podświetlaj brak dopasowa&nia"

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-05-12 21:41-0400\n" "PO-Revision-Date: 2023-05-18 18:51-0400\n"
"Last-Translator: Matheus Knack <mtknack555@gmail.com>\n" "Last-Translator: Matheus Knack <mtknack555@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: pt_BR\n" "Language: pt_BR\n"
@ -2613,6 +2613,9 @@ msgstr "Ativar realçamento de cartas"
msgid "Enable highlight same rank" msgid "Enable highlight same rank"
msgstr "Aitvar realçamento de mesmo valor" msgstr "Aitvar realçamento de mesmo valor"
msgid "Enable face-down peek"
msgstr ""
#: pysollib/kivy/menubar.py:576 #: pysollib/kivy/menubar.py:576
msgid "Highlight no matching" msgid "Highlight no matching"
msgstr "Realçar sem correspondencia" msgstr "Realçar sem correspondencia"
@ -3785,6 +3788,9 @@ msgstr "Cartas de destaque: "
msgid "Highlight same rank: " msgid "Highlight same rank: "
msgstr "Destaque a mesma classificação: " msgstr "Destaque a mesma classificação: "
msgid "Face-down peeks: "
msgstr ""
#: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620 #: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620
#: pysollib/tk/tkstats.py:615 #: pysollib/tk/tkstats.py:615
msgid "" msgid ""
@ -5124,6 +5130,9 @@ msgstr "Ativar realce &cartas"
msgid "Enable highlight same &rank" msgid "Enable highlight same &rank"
msgstr "Ativar o mesmo realce &classificar" msgstr "Ativar o mesmo realce &classificar"
msgid "Enable face-down &peek"
msgstr ""
#: pysollib/ui/tktile/menubar.py:503 #: pysollib/ui/tktile/menubar.py:503
msgid "Highlight &no matching" msgid "Highlight &no matching"
msgstr "Realçe não encontrado" msgstr "Realçe não encontrado"

View file

@ -2421,6 +2421,9 @@ msgstr ""
msgid "Enable highlight same rank" msgid "Enable highlight same rank"
msgstr "" msgstr ""
msgid "Enable face-down peek"
msgstr ""
#: pysollib/kivy/menubar.py:576 #: pysollib/kivy/menubar.py:576
msgid "Highlight no matching" msgid "Highlight no matching"
msgstr "" msgstr ""
@ -3576,6 +3579,9 @@ msgstr ""
msgid "Highlight same rank: " msgid "Highlight same rank: "
msgstr "" msgstr ""
msgid "Face-down peeks: "
msgstr ""
#: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620 #: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620
#: pysollib/tk/tkstats.py:615 #: pysollib/tk/tkstats.py:615
msgid "" msgid ""
@ -4851,6 +4857,9 @@ msgstr ""
msgid "Enable highlight same &rank" msgid "Enable highlight same &rank"
msgstr "" msgstr ""
msgid "Enable face-down &peek"
msgstr ""
#: pysollib/ui/tktile/menubar.py:503 #: pysollib/ui/tktile/menubar.py:503
msgid "Highlight &no matching" msgid "Highlight &no matching"
msgstr "" msgstr ""

View file

@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n" "POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-05-12 21:41-0400\n" "PO-Revision-Date: 2023-05-18 18:53-0400\n"
"Last-Translator: Skomoroh <skomoroh@gmail.com>\n" "Last-Translator: Skomoroh <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n" "Language-Team: Russian <ru@li.org>\n"
"Language: ru\n" "Language: ru\n"
@ -2621,6 +2621,9 @@ msgstr "Разрешить показывать &карты"
msgid "Enable highlight same rank" msgid "Enable highlight same rank"
msgstr "Разрешить показывать карты &одного достоинства" msgstr "Разрешить показывать карты &одного достоинства"
msgid "Enable face-down peek"
msgstr ""
#: pysollib/kivy/menubar.py:576 #: pysollib/kivy/menubar.py:576
#, fuzzy #, fuzzy
msgid "Highlight no matching" msgid "Highlight no matching"
@ -3834,6 +3837,9 @@ msgstr "Подсветка карт: "
msgid "Highlight same rank: " msgid "Highlight same rank: "
msgstr "Подсветка карт одного достоинства: " msgstr "Подсветка карт одного достоинства: "
msgid "Face-down peeks: "
msgstr ""
#: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620 #: pysollib/pysolgtk/tkstats.py:533 pysollib/tile/tkstats.py:620
#: pysollib/tk/tkstats.py:615 #: pysollib/tk/tkstats.py:615
msgid "" msgid ""
@ -5192,6 +5198,9 @@ msgstr "Разрешить показывать &карты"
msgid "Enable highlight same &rank" msgid "Enable highlight same &rank"
msgstr "Разрешить показывать карты &одного достоинства" msgstr "Разрешить показывать карты &одного достоинства"
msgid "Enable face-down &peek"
msgstr ""
#: pysollib/ui/tktile/menubar.py:503 #: pysollib/ui/tktile/menubar.py:503
msgid "Highlight &no matching" msgid "Highlight &no matching"
msgstr "Подсветка отсутствия &совпадения" msgstr "Подсветка отсутствия &совпадения"

View file

@ -187,7 +187,9 @@ def _stats__is_perfect(stats):
# stats.quickplay_moves == 0 and # stats.quickplay_moves == 0 and
stats.highlight_piles == 0 and stats.highlight_piles == 0 and
stats.highlight_cards == 0 and stats.highlight_cards == 0 and
stats.shuffle_moves == 0) stats.shuffle_moves == 0 and
stats.hints == 0 and
stats.peeks == 0)
def _highlightCards__calc_item(canvas, delta, cw, ch, s, c1, c2, color): def _highlightCards__calc_item(canvas, delta, cw, ch, s, c1, c2, color):
@ -400,6 +402,7 @@ class GameHints(NewStruct):
@attr.s @attr.s
class GameStatsStruct(NewStruct): class GameStatsStruct(NewStruct):
hints = attr.ib(default=0) # number of hints consumed hints = attr.ib(default=0) # number of hints consumed
peeks = attr.ib(default=0) # number of peeks consumed
# number of highlight piles consumed # number of highlight piles consumed
highlight_piles = attr.ib(default=0) highlight_piles = attr.ib(default=0)
# number of highlight matching cards consumed # number of highlight matching cards consumed

View file

@ -577,6 +577,11 @@ class OptionsMenuDialog(LMenuDialog):
self.menubar.tkopt.highlight_samerank, self.menubar.tkopt.highlight_samerank,
self.menubar.mOptEnableHighlightSameRank) self.menubar.mOptEnableHighlightSameRank)
self.addCheckNode(tv, rg,
_('Enable face-down peek'),
self.menubar.tkopt.peek_facedown,
self.menubar.mOptEnablePeekFacedown)
self.addCheckNode(tv, rg, self.addCheckNode(tv, rg,
_('Highlight no matching'), _('Highlight no matching'),
self.menubar.tkopt.highlight_not_matching, self.menubar.tkopt.highlight_not_matching,

View file

@ -77,6 +77,7 @@ highlight_piles = boolean
highlight_cards = boolean highlight_cards = boolean
highlight_samerank = boolean highlight_samerank = boolean
highlight_not_matching = boolean highlight_not_matching = boolean
peek_facedown = boolean
stuck_notification = boolean stuck_notification = boolean
mahjongg_show_removed = boolean mahjongg_show_removed = boolean
mahjongg_create_solvable = integer(0, 2) mahjongg_create_solvable = integer(0, 2)
@ -226,6 +227,7 @@ class Options:
('highlight_cards', 'bool'), ('highlight_cards', 'bool'),
('highlight_samerank', 'bool'), ('highlight_samerank', 'bool'),
('highlight_not_matching', 'bool'), ('highlight_not_matching', 'bool'),
('peek_facedown', 'bool'),
('stuck_notification', 'bool'), ('stuck_notification', 'bool'),
('mahjongg_show_removed', 'bool'), ('mahjongg_show_removed', 'bool'),
('mahjongg_create_solvable', 'int'), ('mahjongg_create_solvable', 'int'),
@ -317,6 +319,7 @@ class Options:
self.highlight_cards = True self.highlight_cards = True
self.highlight_samerank = True self.highlight_samerank = True
self.highlight_not_matching = True self.highlight_not_matching = True
self.peek_facedown = False
self.stuck_notification = False self.stuck_notification = False
self.mahjongg_show_removed = False self.mahjongg_show_removed = False
self.mahjongg_create_solvable = 2 # 0 - none, 1 - easy, 2 - hard self.mahjongg_create_solvable = 2 # 0 - none, 1 - easy, 2 - hard

View file

@ -527,7 +527,8 @@ class Status_StatsDialog(MfxMessageDialog): # MfxDialog
w1 = (_('Highlight piles: ') + str(stats.highlight_piles) + '\n' + w1 = (_('Highlight piles: ') + str(stats.highlight_piles) + '\n' +
_('Highlight cards: ') + str(stats.highlight_cards) + '\n' + _('Highlight cards: ') + str(stats.highlight_cards) + '\n' +
_('Highlight same rank: ') + _('Highlight same rank: ') +
str(stats.highlight_samerank) + '\n') str(stats.highlight_samerank) + '\n' +
_('Face-down peeks: ') + str(stats.peeks) + '\n')
if game.s.talon: if game.s.talon:
if game.gameinfo.redeals != 0: if game.gameinfo.redeals != 0:
w2 += _('\nRedeals: ') + str(game.s.talon.round - 1) w2 += _('\nRedeals: ') + str(game.s.talon.round - 1)

View file

@ -1016,17 +1016,31 @@ class Stack:
return 0 return 0
i = self._findCard(event) i = self._findCard(event)
positions = len(self.cards) - i - 1 positions = len(self.cards) - i - 1
if i < 0 or positions <= 0 or not self.cards[i].face_up: peeked = False
if i < 0:
return 0
if not self.cards[i].face_up:
if not self.game.app.opt.peek_facedown:
return 0
else:
self.game.stats.peeks += 1
self.cards[i].showFace()
peeked = True
elif positions <= 0:
return 0 return 0
# print self.cards[i] # print self.cards[i]
self.cards[i].item.tkraise() self.cards[i].item.tkraise()
self.canvas.update_idletasks() self.canvas.update_idletasks()
self.game.sleep(self.game.app.opt.timeouts['raise_card']) self.game.sleep(self.game.app.opt.timeouts['raise_card'])
if TOOLKIT == 'tk': if peeked:
self.cards[i].item.lower(self.cards[i+1].item) self.cards[i].showBack()
elif TOOLKIT == 'gtk': if positions > 0:
for c in self.cards[i+1:]: if TOOLKIT == 'tk':
c.tkraise() self.cards[i].item.lower(self.cards[i+1].item)
elif TOOLKIT == 'gtk':
for c in self.cards[i+1:]:
c.tkraise()
self.canvas.update_idletasks() self.canvas.update_idletasks()
return 1 return 1

View file

@ -615,7 +615,8 @@ class Status_StatsDialog(MfxMessageDialog):
w1 = (_("Highlight piles: ") + str(stats.highlight_piles) + "\n" + w1 = (_("Highlight piles: ") + str(stats.highlight_piles) + "\n" +
_("Highlight cards: ") + str(stats.highlight_cards) + "\n" + _("Highlight cards: ") + str(stats.highlight_cards) + "\n" +
_("Highlight same rank: ") + _("Highlight same rank: ") +
str(stats.highlight_samerank) + "\n") str(stats.highlight_samerank) + "\n" +
_('Face-down peeks: ') + str(stats.peeks) + '\n')
if game.s.talon: if game.s.talon:
if game.gameinfo.redeals != 0: if game.gameinfo.redeals != 0:
w2 = w2 + _("\nRedeals: ") + str(game.s.talon.round - 1) w2 = w2 + _("\nRedeals: ") + str(game.s.talon.round - 1)

View file

@ -614,7 +614,8 @@ class Status_StatsDialog(MfxMessageDialog):
w1 = (_("Highlight piles: ") + str(stats.highlight_piles) + "\n" + w1 = (_("Highlight piles: ") + str(stats.highlight_piles) + "\n" +
_("Highlight cards: ") + str(stats.highlight_cards) + "\n" + _("Highlight cards: ") + str(stats.highlight_cards) + "\n" +
_("Highlight same rank: ") + str(stats.highlight_samerank) + _("Highlight same rank: ") + str(stats.highlight_samerank) +
"\n") "\n" +
_('Face-down peeks: ') + str(stats.peeks) + '\n')
if game.s.talon: if game.s.talon:
if game.gameinfo.redeals != 0: if game.gameinfo.redeals != 0:
w2 = w2 + _("\nRedeals: ") + str(game.s.talon.round - 1) w2 = w2 + _("\nRedeals: ") + str(game.s.talon.round - 1)

View file

@ -225,6 +225,7 @@ class PysolMenubarTkCommon:
highlight_cards=tkinter.BooleanVar(), highlight_cards=tkinter.BooleanVar(),
highlight_samerank=tkinter.BooleanVar(), highlight_samerank=tkinter.BooleanVar(),
highlight_not_matching=tkinter.BooleanVar(), highlight_not_matching=tkinter.BooleanVar(),
peek_facedown=tkinter.BooleanVar(),
stuck_notification=tkinter.BooleanVar(), stuck_notification=tkinter.BooleanVar(),
mahjongg_show_removed=tkinter.BooleanVar(), mahjongg_show_removed=tkinter.BooleanVar(),
shisen_show_hint=tkinter.BooleanVar(), shisen_show_hint=tkinter.BooleanVar(),
@ -288,6 +289,7 @@ class PysolMenubarTkCommon:
tkopt.highlight_cards.set(opt.highlight_cards) tkopt.highlight_cards.set(opt.highlight_cards)
tkopt.highlight_samerank.set(opt.highlight_samerank) tkopt.highlight_samerank.set(opt.highlight_samerank)
tkopt.highlight_not_matching.set(opt.highlight_not_matching) tkopt.highlight_not_matching.set(opt.highlight_not_matching)
tkopt.peek_facedown.set(opt.peek_facedown)
tkopt.stuck_notification.set(opt.stuck_notification) tkopt.stuck_notification.set(opt.stuck_notification)
tkopt.shrink_face_down.set(opt.shrink_face_down) tkopt.shrink_face_down.set(opt.shrink_face_down)
tkopt.shade_filled_stacks.set(opt.shade_filled_stacks) tkopt.shade_filled_stacks.set(opt.shade_filled_stacks)
@ -597,6 +599,10 @@ class PysolMenubarTkCommon:
label=n_("Enable highlight same &rank"), label=n_("Enable highlight same &rank"),
variable=self.tkopt.highlight_samerank, variable=self.tkopt.highlight_samerank,
command=self.mOptEnableHighlightSameRank) command=self.mOptEnableHighlightSameRank)
submenu.add_checkbutton(
label=n_("Enable face-down &peek"),
variable=self.tkopt.peek_facedown,
command=self.mOptEnablePeekFacedown)
submenu.add_checkbutton( submenu.add_checkbutton(
label=n_("Highlight &no matching"), label=n_("Highlight &no matching"),
variable=self.tkopt.highlight_not_matching, variable=self.tkopt.highlight_not_matching,
@ -1532,6 +1538,12 @@ Unsupported game for import.
self.app.opt.highlight_samerank = self.tkopt.highlight_samerank.get() self.app.opt.highlight_samerank = self.tkopt.highlight_samerank.get()
# self.game.updateMenus() # self.game.updateMenus()
def mOptEnablePeekFacedown(self, *args):
if self._cancelDrag(break_pause=False):
return
self.app.opt.peek_facedown = self.tkopt.peek_facedown.get()
# self.game.updateMenus()
def mOptEnableHighlightNotMatching(self, *args): def mOptEnableHighlightNotMatching(self, *args):
if self._cancelDrag(break_pause=False): if self._cancelDrag(break_pause=False):
return return