diff --git a/html-src/howtoplay.html b/html-src/howtoplay.html index 3837760a..7afa4d42 100644 --- a/html-src/howtoplay.html +++ b/html-src/howtoplay.html @@ -99,7 +99,8 @@ to the main data/tiles or your home ~/.PySolFC/tiles directory.
  • Scoring only begins after you make your first move. Also, if you undo all your moves back to the start the game won't score either. -
  • You will lose a game if you consume a hint or start demo mode. +
  • You will lose a game if you consume a hint (unless free hints are enabled) + or start demo mode.
  • You can restart any time to get another chance to win this game.
  • If you don't want to score a lost game you can temporarily change the player options. diff --git a/po/de_pysol.po b/po/de_pysol.po index 9ffc0ba9..9361a9f5 100644 --- a/po/de_pysol.po +++ b/po/de_pysol.po @@ -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-03-12 09:02-0500\n" +"PO-Revision-Date: 2022-05-26 22:09-0400\n" "Last-Translator: H. Schaekel \n" "Language-Team: German\n" "Language: de\n" @@ -2426,6 +2426,9 @@ msgstr "Tips zulassen" msgid "Enable shuffle" msgstr "Neu mischen zulassen" +msgid "Free hints" +msgstr "" + #: pysollib/kivy/menubar.py:561 msgid "Enable highlight piles" msgstr "Spielfeldstapel hervorheben" @@ -4798,6 +4801,9 @@ msgstr "" msgid "Enable shu&ffle" msgstr "Sound aktivieren" +msgid "Free hin&ts" +msgstr "" + #: pysollib/ui/tktile/menubar.py:491 #, fuzzy msgid "Enable highlight p&iles" diff --git a/po/fr_pysol.po b/po/fr_pysol.po index d8c20b13..8e910a4d 100644 --- a/po/fr_pysol.po +++ b/po/fr_pysol.po @@ -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-03-12 09:02-0500\n" +"PO-Revision-Date: 2022-05-26 22:10-0400\n" "Last-Translator: Eric Rausch \n" "Language-Team: French\n" "Language: fr\n" @@ -2468,6 +2468,9 @@ msgstr "Activer indices" msgid "Enable shuffle" msgstr "Activer mélanger" +msgid "Free hints" +msgstr "" + #: pysollib/kivy/menubar.py:561 msgid "Enable highlight piles" msgstr "Surbrillance des piles" @@ -4846,6 +4849,9 @@ msgstr "Activer &indice" msgid "Enable shu&ffle" msgstr "Activer &mélanger" +msgid "Free hin&ts" +msgstr "" + #: pysollib/ui/tktile/menubar.py:491 msgid "Enable highlight p&iles" msgstr "Surbrillance des piles" diff --git a/po/it_pysol.po b/po/it_pysol.po index 7f222582..db452fae 100644 --- a/po/it_pysol.po +++ b/po/it_pysol.po @@ -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-03-12 09:02-0500\n" +"PO-Revision-Date: 2022-05-26 22:10-0400\n" "Last-Translator: Giuliano Colla \n" "Language-Team: Italiano \n" "Language: it\n" @@ -2481,6 +2481,9 @@ msgstr "Abilita suggerimenti" msgid "Enable shuffle" msgstr "Abilita mescola" +msgid "Free hints" +msgstr "" + #: pysollib/kivy/menubar.py:561 #, fuzzy msgid "Enable highlight piles" @@ -4912,6 +4915,9 @@ msgstr "Abilita su&ggerimenti" msgid "Enable shu&ffle" msgstr "Abilita m&escola" +msgid "Free hin&ts" +msgstr "" + #: pysollib/ui/tktile/menubar.py:491 msgid "Enable highlight p&iles" msgstr "Abilita evidenzia p&ile" diff --git a/po/pl_pysol.po b/po/pl_pysol.po index d724bbff..42230c82 100644 --- a/po/pl_pysol.po +++ b/po/pl_pysol.po @@ -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-03-12 09:02-0500\n" +"PO-Revision-Date: 2022-05-26 22:10-0400\n" "Last-Translator: Jerzy Trzeciak \n" "Language-Team: Polish \n" "Language: pl\n" @@ -2518,6 +2518,9 @@ msgstr "Włacz podpowiedzi" msgid "Enable shuffle" msgstr "Włącz tasowanie" +msgid "Free hints" +msgstr "" + #: pysollib/kivy/menubar.py:561 #, fuzzy msgid "Enable highlight piles" @@ -4972,6 +4975,9 @@ msgstr "Włacz podpowiedzi" msgid "Enable shu&ffle" msgstr "Włącz tasowanie" +msgid "Free hin&ts" +msgstr "" + #: pysollib/ui/tktile/menubar.py:491 msgid "Enable highlight p&iles" msgstr "Włącz podśw&ietlanie stosów" diff --git a/po/pysol.pot b/po/pysol.pot index 4d34d33e..36fcbb4e 100644 --- a/po/pysol.pot +++ b/po/pysol.pot @@ -2303,6 +2303,9 @@ msgstr "" msgid "Enable shuffle" msgstr "" +msgid "Free hints" +msgstr "" + #: pysollib/kivy/menubar.py:561 msgid "Enable highlight piles" msgstr "" @@ -4601,6 +4604,9 @@ msgstr "" msgid "Enable shu&ffle" msgstr "" +msgid "Free hin&ts" +msgstr "" + #: pysollib/ui/tktile/menubar.py:491 msgid "Enable highlight p&iles" msgstr "" diff --git a/po/ru_pysol.po b/po/ru_pysol.po index f3d09ff1..40c35ab7 100644 --- a/po/ru_pysol.po +++ b/po/ru_pysol.po @@ -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-03-12 09:01-0500\n" +"PO-Revision-Date: 2022-05-26 22:10-0400\n" "Last-Translator: Skomoroh \n" "Language-Team: Russian \n" "Language: ru\n" @@ -2494,6 +2494,9 @@ msgstr "Разрешить &подсказки" msgid "Enable shuffle" msgstr "Разрешить перемешивание &фишек" +msgid "Free hints" +msgstr "" + #: pysollib/kivy/menubar.py:561 #, fuzzy msgid "Enable highlight piles" @@ -4936,6 +4939,9 @@ msgstr "Разрешить &подсказки" msgid "Enable shu&ffle" msgstr "Разрешить перемешивание &фишек" +msgid "Free hin&ts" +msgstr "" + #: pysollib/ui/tktile/menubar.py:491 msgid "Enable highlight p&iles" msgstr "Разрешить показывать к&учи" diff --git a/pysollib/game/__init__.py b/pysollib/game/__init__.py index 55201343..abe1cedb 100644 --- a/pysollib/game/__init__.py +++ b/pysollib/game/__init__.py @@ -1987,10 +1987,11 @@ class Game(object): def getWinStatus(self): won = self.isGameWon() != 0 - if not won or self.stats.hints > 0 or self.stats.demo_moves > 0: + if (not won or (self.stats.hints > 0 and not self.app.opt.free_hint) + or self.stats.demo_moves > 0): # sorry, you lose return won, 0, self.U_LOST - if _stats__is_perfect(self.stats): + if _stats__is_perfect(self.stats) and self.stats.hints < 1: return won, 2, self.U_PERFECT return won, 1, self.U_WON diff --git a/pysollib/kivy/menubar.py b/pysollib/kivy/menubar.py index e96b511e..4671c3d9 100644 --- a/pysollib/kivy/menubar.py +++ b/pysollib/kivy/menubar.py @@ -557,6 +557,11 @@ class OptionsMenuDialog(LMenuDialog): self.menubar.tkopt.shuffle, self.menubar.mOptEnableShuffle) + self.addCheckNode(tv, rg, + _('Free hints'), + self.menubar.tkopt.free_hint, + self.menubar.mOptFreeHints) + self.addCheckNode(tv, rg, _('Enable highlight piles'), self.menubar.tkopt.highlight_piles, @@ -1250,6 +1255,7 @@ class PysolMenubarTk: undo=BooleanVar(), bookmarks=BooleanVar(), hint=BooleanVar(), + free_hint=BooleanVar(), shuffle=BooleanVar(), highlight_piles=BooleanVar(), highlight_cards=BooleanVar(), @@ -1310,6 +1316,7 @@ class PysolMenubarTk: tkopt.quickplay.set(opt.quickplay) tkopt.undo.set(opt.undo) tkopt.hint.set(opt.hint) + tkopt.free_hint.set(opt.free_hint) tkopt.shuffle.set(opt.shuffle) tkopt.bookmarks.set(opt.bookmarks) tkopt.highlight_piles.set(opt.highlight_piles) @@ -2029,6 +2036,12 @@ the next time you restart the %(app)s""") % {'app': TITLE}) self.app.opt.hint = self.tkopt.hint.get() self.game.updateMenus() + def mOptFreeHints(self, *args): + if self._cancelDrag(break_pause=False): + return + self.app.opt.free_hint = self.tkopt.free_hint.get() + self.game.updateMenus() + def mOptEnableShuffle(self, *args): if self._cancelDrag(break_pause=False): return diff --git a/pysollib/options.py b/pysollib/options.py index 0af25449..584e86e7 100644 --- a/pysollib/options.py +++ b/pysollib/options.py @@ -72,6 +72,7 @@ shuffle = boolean undo = boolean bookmarks = boolean hint = boolean +free_hint = boolean highlight_piles = boolean highlight_cards = boolean highlight_samerank = boolean @@ -219,6 +220,7 @@ class Options: ('undo', 'bool'), ('bookmarks', 'bool'), ('hint', 'bool'), + ('free_hint', 'bool'), ('highlight_piles', 'bool'), ('highlight_cards', 'bool'), ('highlight_samerank', 'bool'), @@ -307,6 +309,7 @@ class Options: self.undo = True self.bookmarks = True self.hint = True + self.free_hint = False self.highlight_piles = True self.highlight_cards = True self.highlight_samerank = True diff --git a/pysollib/ui/tktile/menubar.py b/pysollib/ui/tktile/menubar.py index 4d3b50e4..edfa149f 100644 --- a/pysollib/ui/tktile/menubar.py +++ b/pysollib/ui/tktile/menubar.py @@ -164,6 +164,7 @@ class PysolMenubarTkCommon: undo=tkinter.BooleanVar(), bookmarks=tkinter.BooleanVar(), hint=tkinter.BooleanVar(), + free_hint=tkinter.BooleanVar(), shuffle=tkinter.BooleanVar(), highlight_piles=tkinter.BooleanVar(), highlight_cards=tkinter.BooleanVar(), @@ -218,6 +219,7 @@ class PysolMenubarTkCommon: tkopt.quickplay.set(opt.quickplay) tkopt.undo.set(opt.undo) tkopt.hint.set(opt.hint) + tkopt.free_hint.set(opt.free_hint) tkopt.shuffle.set(opt.shuffle) tkopt.bookmarks.set(opt.bookmarks) tkopt.highlight_piles.set(opt.highlight_piles) @@ -508,6 +510,9 @@ class PysolMenubarTkCommon: submenu.add_checkbutton( label=n_("Enable shu&ffle"), variable=self.tkopt.shuffle, command=self.mOptEnableShuffle) + submenu.add_checkbutton( + label=n_("Free hin&ts"), variable=self.tkopt.free_hint, + command=self.mOptFreeHints) submenu.add_checkbutton( label=n_("Enable highlight p&iles"), variable=self.tkopt.highlight_piles, @@ -1411,6 +1416,12 @@ Unsupported game for import. self.app.opt.hint = self.tkopt.hint.get() self.game.updateMenus() + def mOptFreeHints(self, *args): + if self._cancelDrag(break_pause=False): + return + self.app.opt.free_hint = self.tkopt.free_hint.get() + self.game.updateMenus() + def mOptEnableShuffle(self, *args): if self._cancelDrag(break_pause=False): return