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

Stuck notification option.

This commit is contained in:
Joe R 2022-07-28 18:56:41 -04:00
parent 6fe410ac24
commit 02e62afb16
11 changed files with 141 additions and 5 deletions

View file

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: PySol 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2022-07-17 09:21-0400\n"
"PO-Revision-Date: 2022-07-28 18:52-0400\n"
"Last-Translator: H. Schaekel <Holger.Schaekel@web.de>\n"
"Language-Team: German\n"
"Language: de\n"
@ -1964,6 +1964,14 @@ msgid ""
"Game finished, but not without my help...\n"
msgstr ""
msgid "You are Stuck"
msgstr ""
msgid ""
"\n"
"There are no moves left...\n"
msgstr ""
#: pysollib/game/__init__.py:2046
msgid "&Restart"
msgstr "Neusta&rt"
@ -2445,6 +2453,9 @@ msgstr "Gleichen Rang hervorheben"
msgid "Highlight no matching"
msgstr "Nicht passende hervorheben"
msgid "Stuck notification"
msgstr ""
#: pysollib/kivy/menubar.py:583
msgid "Show removed tiles (in Mahjongg games)"
msgstr "Zeige entfernte Steine (in Mahjongg)"
@ -4829,6 +4840,9 @@ msgstr "Gleichen Rang hervorheben:"
msgid "Highlight &no matching"
msgstr "Keine passenden hervorheben:"
msgid "Stuc&k notification"
msgstr ""
#: pysollib/ui/tktile/menubar.py:508
msgid "&Show removed tiles (in Mahjongg games)"
msgstr ""

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: 1.02\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2022-07-17 09:19-0400\n"
"PO-Revision-Date: 2022-07-28 18:52-0400\n"
"Last-Translator: Eric Rausch <neelix570@gmail.com>\n"
"Language-Team: French\n"
"Language: fr\n"
@ -1996,6 +1996,14 @@ msgstr ""
"\n"
"Jeu terminé, mais pas sans mon aide...\n"
msgid "You are Stuck"
msgstr ""
msgid ""
"\n"
"There are no moves left...\n"
msgstr ""
#: pysollib/game/__init__.py:2046
msgid "&Restart"
msgstr "&Redémarrer"
@ -2487,6 +2495,9 @@ msgstr "Surbrillance des équivalents"
msgid "Highlight no matching"
msgstr "Surbrillance sans correspondance"
msgid "Stuck notification"
msgstr ""
#: pysollib/kivy/menubar.py:583
msgid "Show removed tiles (in Mahjongg games)"
msgstr "Montrer tuiles retirées (Mahjongg)"
@ -4874,6 +4885,9 @@ msgstr "Surbrillance des &équivalents"
msgid "Highlight &no matching"
msgstr "Surbrilla&nce incorrectes"
msgid "Stuc&k notification"
msgstr ""
#: pysollib/ui/tktile/menubar.py:508
msgid "&Show removed tiles (in Mahjongg games)"
msgstr "Montrer tuiles retirées (Mahjongg)"

View file

@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: it_pysol\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2022-07-17 09:19-0400\n"
"PO-Revision-Date: 2022-07-28 18:52-0400\n"
"Last-Translator: Giuliano Colla <giuliano.colla@gmail.com>\n"
"Language-Team: Italiano <it@li.org>\n"
"Language: it\n"
@ -2004,6 +2004,14 @@ msgstr ""
"\n"
"Gioco terminato, ma non senza il mio aiuto...\n"
msgid "You are Stuck"
msgstr ""
msgid ""
"\n"
"There are no moves left...\n"
msgstr ""
#: pysollib/game/__init__.py:2046
msgid "&Restart"
msgstr "&Ricomincia"
@ -2504,6 +2512,9 @@ msgstr "Abilita evidenzia stesso valo&re"
msgid "Highlight no matching"
msgstr "Abilita non corrispondenti"
msgid "Stuck notification"
msgstr ""
#: pysollib/kivy/menubar.py:583
#, fuzzy
msgid "Show removed tiles (in Mahjongg games)"
@ -4940,6 +4951,9 @@ msgstr "Abilita evidenzia stesso valo&re"
msgid "Highlight &no matching"
msgstr "Abilita non corrispondenti"
msgid "Stuc&k notification"
msgstr ""
#: pysollib/ui/tktile/menubar.py:508
msgid "&Show removed tiles (in Mahjongg games)"
msgstr "Mo&stra tessere tolte (in Mahjongg)"

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2022-07-17 09:19-0400\n"
"PO-Revision-Date: 2022-07-28 18:53-0400\n"
"Last-Translator: Jerzy Trzeciak <artusek@wp.pl>\n"
"Language-Team: Polish <pl@li.org>\n"
"Language: pl\n"
@ -2017,6 +2017,14 @@ msgstr ""
"\n"
"Gra zakończona, ale nie bez mojej pomocy...\n"
msgid "You are Stuck"
msgstr ""
msgid ""
"\n"
"There are no moves left...\n"
msgstr ""
#: pysollib/game/__init__.py:2046
msgid "&Restart"
msgstr "U&ruchom ponownie"
@ -2541,6 +2549,9 @@ msgstr "Podświetlaj karty o jednakowej sile"
msgid "Highlight no matching"
msgstr "Podświetlaj brak dopasowa&nia"
msgid "Stuck notification"
msgstr ""
#: pysollib/kivy/menubar.py:583
#, fuzzy
msgid "Show removed tiles (in Mahjongg games)"
@ -5000,6 +5011,9 @@ msgstr "Podświetlaj karty o jednakowej sile"
msgid "Highlight &no matching"
msgstr "Podświetlaj brak dopasowa&nia"
msgid "Stuc&k notification"
msgstr ""
#: pysollib/ui/tktile/menubar.py:508
msgid "&Show removed tiles (in Mahjongg games)"
msgstr "Pokaż u&sunięte klocki (w grach Mahjongg)"

View file

@ -1870,6 +1870,14 @@ msgid ""
"Game finished, but not without my help...\n"
msgstr ""
msgid "You are Stuck"
msgstr ""
msgid ""
"\n"
"There are no moves left...\n"
msgstr ""
#: pysollib/game/__init__.py:2046
msgid "&Restart"
msgstr ""
@ -2322,6 +2330,9 @@ msgstr ""
msgid "Highlight no matching"
msgstr ""
msgid "Stuck notification"
msgstr ""
#: pysollib/kivy/menubar.py:583
msgid "Show removed tiles (in Mahjongg games)"
msgstr ""
@ -4629,6 +4640,9 @@ msgstr ""
msgid "Highlight &no matching"
msgstr ""
msgid "Stuc&k notification"
msgstr ""
#: pysollib/ui/tktile/menubar.py:508
msgid "&Show removed tiles (in Mahjongg games)"
msgstr ""

View file

@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2022-07-17 09:18-0400\n"
"PO-Revision-Date: 2022-07-28 18:53-0400\n"
"Last-Translator: Skomoroh <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n"
"Language: ru\n"
@ -2003,6 +2003,14 @@ msgstr ""
"\n"
"Игра закончена, но не без моей помощи...\n"
msgid "You are Stuck"
msgstr ""
msgid ""
"\n"
"There are no moves left...\n"
msgstr ""
#: pysollib/game/__init__.py:2046
msgid "&Restart"
msgstr "&Начало"
@ -2517,6 +2525,9 @@ msgstr "Разрешить показывать карты &одного дос
msgid "Highlight no matching"
msgstr "Подсветка отсутствия &совпадения"
msgid "Stuck notification"
msgstr ""
#: pysollib/kivy/menubar.py:583
#, fuzzy
msgid "Show removed tiles (in Mahjongg games)"
@ -4964,6 +4975,9 @@ msgstr "Разрешить показывать карты &одного дос
msgid "Highlight &no matching"
msgstr "Подсветка отсутствия &совпадения"
msgid "Stuc&k notification"
msgstr ""
#: pysollib/ui/tktile/menubar.py:508
msgid "&Show removed tiles (in Mahjongg games)"
msgstr "Показывать удалённые (в Маджонг)"

View file

@ -517,6 +517,7 @@ class Game(object):
self.busy = 0
self.pause = False
self.finished = False
self.stuck = False
self.version = VERSION
self.version_tuple = VERSION_TUPLE
self.cards = []
@ -780,6 +781,7 @@ class Game(object):
def newGame(self, random=None, restart=0, autoplay=1, shuffle=True,
dealer=None):
self.finished = False
self.stuck = False
old_busy, self.busy = self.busy, 1
self.setCursor(cursor=CURSOR_WATCH)
self.stopWinAnimation()
@ -2855,8 +2857,29 @@ class Game(object):
return
if self.getStuck():
text = ''
self.stuck = False
else:
text = 'x'
if (not self.stuck and not self.demo and
self.app.opt.stuck_notification):
self.playSample("gamelost", priority=1000)
self.updateStatus(stuck='x')
d = MfxMessageDialog(
self.top, title=_("You are Stuck"), bitmap="info",
text=_("\nThere are no moves left...\n"),
strings=(_("&New game"), _("&Restart"), None,
_("&Cancel")))
if TOOLKIT != 'kivy':
if d.status == 0 and d.button == 0:
# new game
self.endGame()
self.newGame()
return
elif d.status == 0 and d.button == 1:
# restart game
self.restartGame()
return
self.stuck = True
# self.playSample("autopilotlost", priority=1000)
self.updateStatus(stuck=text)

View file

@ -114,6 +114,7 @@ class LightsOut_Talon(InitialDealTalonStack):
# ************************************************************************
class LightsOut(Game):
Hint_Class = None
#
# Game layout

View file

@ -582,6 +582,11 @@ class OptionsMenuDialog(LMenuDialog):
self.menubar.tkopt.highlight_not_matching,
self.menubar.mOptEnableHighlightNotMatching)
self.addCheckNode(tv, rg,
_('Stuck notification'),
self.menubar.tkopt.stuck_notification,
self.menubar.mOptEnableStuckNotification)
# submenu.add_separator()
self.addCheckNode(tv, rg,
@ -1261,6 +1266,7 @@ class PysolMenubarTk:
highlight_cards=BooleanVar(),
highlight_samerank=BooleanVar(),
highlight_not_matching=BooleanVar(),
stuck_notification=BooleanVar(),
mahjongg_show_removed=BooleanVar(),
shisen_show_hint=BooleanVar(),
accordion_deal_all=BooleanVar(),
@ -1323,6 +1329,7 @@ class PysolMenubarTk:
tkopt.highlight_cards.set(opt.highlight_cards)
tkopt.highlight_samerank.set(opt.highlight_samerank)
tkopt.highlight_not_matching.set(opt.highlight_not_matching)
tkopt.stuck_notification.set(opt.stuck_notification)
tkopt.shrink_face_down.set(opt.shrink_face_down)
tkopt.shade_filled_stacks.set(opt.shade_filled_stacks)
tkopt.mahjongg_show_removed.set(opt.mahjongg_show_removed)
@ -2071,6 +2078,12 @@ the next time you restart the %(app)s""") % {'app': TITLE})
self.tkopt.highlight_not_matching.get()
# self.game.updateMenus()
def mOptEnableStuckNotification(self, *args):
if self._cancelDrag(break_pause=False):
return
self.app.opt.stuck_notification = self.tkopt.stuck_notification.get()
# self.game.updateMenus()
def mOptAnimations(self, *args):
if self._cancelDrag(break_pause=False):
return

View file

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

View file

@ -222,6 +222,7 @@ class PysolMenubarTkCommon:
highlight_cards=tkinter.BooleanVar(),
highlight_samerank=tkinter.BooleanVar(),
highlight_not_matching=tkinter.BooleanVar(),
stuck_notification=tkinter.BooleanVar(),
mahjongg_show_removed=tkinter.BooleanVar(),
shisen_show_hint=tkinter.BooleanVar(),
accordion_deal_all=tkinter.BooleanVar(),
@ -282,6 +283,7 @@ class PysolMenubarTkCommon:
tkopt.highlight_cards.set(opt.highlight_cards)
tkopt.highlight_samerank.set(opt.highlight_samerank)
tkopt.highlight_not_matching.set(opt.highlight_not_matching)
tkopt.stuck_notification.set(opt.stuck_notification)
tkopt.shrink_face_down.set(opt.shrink_face_down)
tkopt.shade_filled_stacks.set(opt.shade_filled_stacks)
tkopt.randomize_place.set(opt.randomize_place)
@ -588,6 +590,10 @@ class PysolMenubarTkCommon:
label=n_("Highlight &no matching"),
variable=self.tkopt.highlight_not_matching,
command=self.mOptEnableHighlightNotMatching)
submenu.add_checkbutton(
label=n_("Stuc&k notification"),
variable=self.tkopt.stuck_notification,
command=self.mOptEnableStuckNotification)
submenu.add_separator()
submenu.add_checkbutton(
label=n_("&Show removed tiles (in Mahjongg games)"),
@ -1506,6 +1512,12 @@ Unsupported game for import.
self.tkopt.highlight_not_matching.get()
# self.game.updateMenus()
def mOptEnableStuckNotification(self, *args):
if self._cancelDrag(break_pause=False):
return
self.app.opt.stuck_notification = self.tkopt.stuck_notification.get()
# self.game.updateMenus()
def mOptAnimations(self, *args):
if self._cancelDrag(break_pause=False):
return