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

+ 1 new game

* improved tile binding
* bugs fixes


git-svn-id: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@92 39dd0a4e-7c14-0410-91b3-c4f2d318f732
This commit is contained in:
skomoroh 2006-11-10 22:27:54 +00:00
parent 017379ea05
commit 356f3808e8
9 changed files with 228 additions and 88 deletions

View file

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Thu Nov 9 17:36:05 2006\n" "POT-Creation-Date: Fri Nov 10 23:00:51 2006\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -945,6 +945,9 @@ msgstr ""
msgid "Exiled Kings" msgid "Exiled Kings"
msgstr "" msgstr ""
msgid "Exit"
msgstr ""
msgid "Express" msgid "Express"
msgstr "" msgstr ""

View file

@ -14,7 +14,7 @@ msgid ""
msgstr "" msgstr ""
"#-#-#-#-# pysol-1.pot (PACKAGE VERSION) #-#-#-#-#\n" "#-#-#-#-# pysol-1.pot (PACKAGE VERSION) #-#-#-#-#\n"
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: Thu Nov 9 17:36:57 2006\n" "POT-Creation-Date: Fri Nov 10 23:01:45 2006\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -24,7 +24,7 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
"#-#-#-#-# pysol-2.pot (PACKAGE VERSION) #-#-#-#-#\n" "#-#-#-#-# pysol-2.pot (PACKAGE VERSION) #-#-#-#-#\n"
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2006-11-09 17:36+0300\n" "POT-Creation-Date: 2006-11-10 23:01+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -68,8 +68,8 @@ msgstr ""
msgid "&Next number" msgid "&Next number"
msgstr "" msgstr ""
#: pysollib/actions.py:314 pysollib/app.py:892 pysollib/app.py:1155 #: pysollib/actions.py:314 pysollib/app.py:878 pysollib/app.py:1161
#: pysollib/app.py:1167 pysollib/game.py:929 pysollib/game.py:1864 #: pysollib/app.py:1173 pysollib/game.py:929 pysollib/game.py:1864
#: pysollib/main.py:379 pysollib/main.py:387 pysollib/tk/colorsdialog.py:122 #: pysollib/main.py:379 pysollib/main.py:387 pysollib/tk/colorsdialog.py:122
#: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143 #: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143
#: pysollib/tk/fontsdialog.py:205 pysollib/tk/gameinfodialog.py:155 #: pysollib/tk/fontsdialog.py:205 pysollib/tk/gameinfodialog.py:155
@ -77,7 +77,7 @@ msgstr ""
#: pysollib/tk/playeroptionsdialog.py:160 pysollib/tk/selectcardset.py:241 #: pysollib/tk/playeroptionsdialog.py:160 pysollib/tk/selectcardset.py:241
#: pysollib/tk/selectcardset.py:397 pysollib/tk/selecttile.py:159 #: pysollib/tk/selectcardset.py:397 pysollib/tk/selecttile.py:159
#: pysollib/tk/soundoptionsdialog.py:170 pysollib/tk/soundoptionsdialog.py:211 #: pysollib/tk/soundoptionsdialog.py:170 pysollib/tk/soundoptionsdialog.py:211
#: pysollib/tk/timeoutsdialog.py:92 pysollib/tk/tkhtml.py:499 #: pysollib/tk/timeoutsdialog.py:92 pysollib/tk/tkhtml.py:500
#: pysollib/tk/tkstats.py:288 pysollib/tk/tkstats.py:512 #: pysollib/tk/tkstats.py:288 pysollib/tk/tkstats.py:512
#: pysollib/tk/tkstats.py:579 pysollib/tk/tkstats.py:594 #: pysollib/tk/tkstats.py:579 pysollib/tk/tkstats.py:594
#: pysollib/tk/tkstats.py:636 pysollib/tk/tkstats.py:708 #: pysollib/tk/tkstats.py:636 pysollib/tk/tkstats.py:708
@ -86,7 +86,7 @@ msgstr ""
msgid "&OK" msgid "&OK"
msgstr "" msgstr ""
#: pysollib/actions.py:314 pysollib/app.py:893 pysollib/app.py:1167 #: pysollib/actions.py:314 pysollib/app.py:879 pysollib/app.py:1173
#: pysollib/game.py:929 pysollib/game.py:1314 pysollib/game.py:1329 #: pysollib/game.py:929 pysollib/game.py:1314 pysollib/game.py:1329
#: pysollib/game.py:1336 pysollib/game.py:1342 pysollib/tk/colorsdialog.py:122 #: pysollib/game.py:1336 pysollib/game.py:1342 pysollib/tk/colorsdialog.py:122
#: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143 #: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143
@ -244,28 +244,28 @@ msgstr ""
msgid "Unknown" msgid "Unknown"
msgstr "" msgstr ""
#: pysollib/app.py:894 pysollib/game.py:1314 pysollib/game.py:1329 #: pysollib/app.py:880 pysollib/game.py:1314 pysollib/game.py:1329
#: pysollib/game.py:1336 pysollib/game.py:1342 pysollib/tk/menubar.py:363 #: pysollib/game.py:1336 pysollib/game.py:1342 pysollib/tk/menubar.py:363
msgid "&New game" msgid "&New game"
msgstr "" msgstr ""
#: pysollib/app.py:1017 #: pysollib/app.py:1023
msgid "Loading %s %s..." msgid "Loading %s %s..."
msgstr "" msgstr ""
#: pysollib/app.py:1052 #: pysollib/app.py:1058
msgid " load error" msgid " load error"
msgstr "" msgstr ""
#: pysollib/app.py:1053 #: pysollib/app.py:1059
msgid "Error while loading " msgid "Error while loading "
msgstr "" msgstr ""
#: pysollib/app.py:1147 #: pysollib/app.py:1153
msgid "Incompatible " msgid "Incompatible "
msgstr "" msgstr ""
#: pysollib/app.py:1149 #: pysollib/app.py:1155
msgid "" msgid ""
"The currently selected %s %s\n" "The currently selected %s %s\n"
"is not compatible with the game\n" "is not compatible with the game\n"
@ -274,7 +274,7 @@ msgid ""
"Please select a %s type %s.\n" "Please select a %s type %s.\n"
msgstr "" msgstr ""
#: pysollib/app.py:1165 #: pysollib/app.py:1171
msgid "Please select a %s type %s" msgid "Please select a %s type %s"
msgstr "" msgstr ""
@ -1227,13 +1227,13 @@ msgstr ""
msgid " Help" msgid " Help"
msgstr "" msgstr ""
#: pysollib/main.py:68 pysollib/main.py:287 #: pysollib/main.py:67 pysollib/main.py:287
msgid " installation error" msgid "%s installation error"
msgstr "" msgstr ""
#: pysollib/main.py:69 #: pysollib/main.py:68
msgid "" msgid ""
"No %ss were found !!!\n" "No cardsets were found !!!\n"
"\n" "\n"
"Main data directory is:\n" "Main data directory is:\n"
"%s\n" "%s\n"
@ -1241,17 +1241,17 @@ msgid ""
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
#: pysollib/main.py:76 pysollib/main.py:295 pysollib/tk/menubar.py:382 #: pysollib/main.py:75 pysollib/main.py:295 pysollib/tk/menubar.py:382
msgid "&Quit" msgid "&Quit"
msgstr "" msgstr ""
#: pysollib/main.py:100 #: pysollib/main.py:99
msgid "" msgid ""
"%s: %s\n" "%s: %s\n"
"try %s --help for more information" "try %s --help for more information"
msgstr "" msgstr ""
#: pysollib/main.py:147 #: pysollib/main.py:146
msgid "" msgid ""
"Usage: %s [OPTIONS] [FILE]\n" "Usage: %s [OPTIONS] [FILE]\n"
" -g --game=GAMENAME start game GAMENAME\n" " -g --game=GAMENAME start game GAMENAME\n"
@ -1260,6 +1260,7 @@ msgid ""
" --fg --foreground=COLOR foreground color\n" " --fg --foreground=COLOR foreground color\n"
" --bg --background=COLOR background color\n" " --bg --background=COLOR background color\n"
" --fn --font=FONT default font\n" " --fn --font=FONT default font\n"
" --theme=THEME specify theme (for Tile binding)\n"
" --sound-mod=MOD\n" " --sound-mod=MOD\n"
" --nosound disable sound support\n" " --nosound disable sound support\n"
" --noplugins disable load plugins\n" " --noplugins disable load plugins\n"
@ -1293,7 +1294,7 @@ msgid ""
msgstr "" msgstr ""
#: pysollib/main.py:374 pysollib/main.py:382 #: pysollib/main.py:374 pysollib/main.py:382
msgid " installation problem" msgid "%s installation problem"
msgstr "" msgstr ""
#: pysollib/main.py:375 #: pysollib/main.py:375
@ -1311,7 +1312,7 @@ msgid ""
msgstr "" msgstr ""
#: pysollib/main.py:390 #: pysollib/main.py:390
msgid "Welcome to " msgid "Welcome to %s"
msgstr "" msgstr ""
#: pysollib/resource.py:192 #: pysollib/resource.py:192

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Thu Nov 9 17:36:05 2006\n" "POT-Creation-Date: Fri Nov 10 23:00:51 2006\n"
"PO-Revision-Date: 2006-11-09 17:59+0300\n" "PO-Revision-Date: 2006-11-10 13:20+0300\n"
"Last-Translator: Скоморох <skomoroh@gmail.com>\n" "Last-Translator: Скоморох <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n" "Language-Team: Russian <ru@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -954,6 +954,9 @@ msgstr "Оправдание"
msgid "Exiled Kings" msgid "Exiled Kings"
msgstr "Изгнанные короли" msgstr "Изгнанные короли"
msgid "Exit"
msgstr "Выход"
msgid "Express" msgid "Express"
msgstr "Экспресс" msgstr "Экспресс"

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PySol 0.0.1\n" "Project-Id-Version: PySol 0.0.1\n"
"POT-Creation-Date: Thu Nov 9 17:36:57 2006\n" "POT-Creation-Date: Fri Nov 10 23:01:45 2006\n"
"PO-Revision-Date: 2006-11-06 09:53+0300\n" "PO-Revision-Date: 2006-11-10 23:18+0300\n"
"Last-Translator: Скоморох <skomoroh@gmail.com>\n" "Last-Translator: Скоморох <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n" "Language-Team: Russian <ru@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -53,8 +53,8 @@ msgstr ""
msgid "&Next number" msgid "&Next number"
msgstr "&Следующий номер" msgstr "&Следующий номер"
#: pysollib/actions.py:314 pysollib/app.py:892 pysollib/app.py:1155 #: pysollib/actions.py:314 pysollib/app.py:878 pysollib/app.py:1161
#: pysollib/app.py:1167 pysollib/game.py:929 pysollib/game.py:1864 #: pysollib/app.py:1173 pysollib/game.py:929 pysollib/game.py:1864
#: pysollib/main.py:379 pysollib/main.py:387 pysollib/tk/colorsdialog.py:122 #: pysollib/main.py:379 pysollib/main.py:387 pysollib/tk/colorsdialog.py:122
#: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143 #: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143
#: pysollib/tk/fontsdialog.py:205 pysollib/tk/gameinfodialog.py:155 #: pysollib/tk/fontsdialog.py:205 pysollib/tk/gameinfodialog.py:155
@ -62,7 +62,7 @@ msgstr "&Следующий номер"
#: pysollib/tk/playeroptionsdialog.py:160 pysollib/tk/selectcardset.py:241 #: pysollib/tk/playeroptionsdialog.py:160 pysollib/tk/selectcardset.py:241
#: pysollib/tk/selectcardset.py:397 pysollib/tk/selecttile.py:159 #: pysollib/tk/selectcardset.py:397 pysollib/tk/selecttile.py:159
#: pysollib/tk/soundoptionsdialog.py:170 pysollib/tk/soundoptionsdialog.py:211 #: pysollib/tk/soundoptionsdialog.py:170 pysollib/tk/soundoptionsdialog.py:211
#: pysollib/tk/timeoutsdialog.py:92 pysollib/tk/tkhtml.py:499 #: pysollib/tk/timeoutsdialog.py:92 pysollib/tk/tkhtml.py:500
#: pysollib/tk/tkstats.py:288 pysollib/tk/tkstats.py:512 #: pysollib/tk/tkstats.py:288 pysollib/tk/tkstats.py:512
#: pysollib/tk/tkstats.py:579 pysollib/tk/tkstats.py:594 #: pysollib/tk/tkstats.py:579 pysollib/tk/tkstats.py:594
#: pysollib/tk/tkstats.py:636 pysollib/tk/tkstats.py:708 #: pysollib/tk/tkstats.py:636 pysollib/tk/tkstats.py:708
@ -71,7 +71,7 @@ msgstr "&Следующий номер"
msgid "&OK" msgid "&OK"
msgstr "&ОК" msgstr "&ОК"
#: pysollib/actions.py:314 pysollib/app.py:893 pysollib/app.py:1167 #: pysollib/actions.py:314 pysollib/app.py:879 pysollib/app.py:1173
#: pysollib/game.py:929 pysollib/game.py:1314 pysollib/game.py:1329 #: pysollib/game.py:929 pysollib/game.py:1314 pysollib/game.py:1329
#: pysollib/game.py:1336 pysollib/game.py:1342 pysollib/tk/colorsdialog.py:122 #: pysollib/game.py:1336 pysollib/game.py:1342 pysollib/tk/colorsdialog.py:122
#: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143 #: pysollib/tk/edittextdialog.py:82 pysollib/tk/fontsdialog.py:143
@ -241,28 +241,28 @@ msgstr "Настроить таймауты"
msgid "Unknown" msgid "Unknown"
msgstr "Неизвестный" msgstr "Неизвестный"
#: pysollib/app.py:894 pysollib/game.py:1314 pysollib/game.py:1329 #: pysollib/app.py:880 pysollib/game.py:1314 pysollib/game.py:1329
#: pysollib/game.py:1336 pysollib/game.py:1342 pysollib/tk/menubar.py:363 #: pysollib/game.py:1336 pysollib/game.py:1342 pysollib/tk/menubar.py:363
msgid "&New game" msgid "&New game"
msgstr "&Новая игра" msgstr "&Новая игра"
#: pysollib/app.py:1017 #: pysollib/app.py:1023
msgid "Loading %s %s..." msgid "Loading %s %s..."
msgstr "Загружается %s %s..." msgstr "Загружается %s %s..."
#: pysollib/app.py:1052 #: pysollib/app.py:1058
msgid " load error" msgid " load error"
msgstr " ошибка при загрузке" msgstr " ошибка при загрузке"
#: pysollib/app.py:1053 #: pysollib/app.py:1059
msgid "Error while loading " msgid "Error while loading "
msgstr "Ошибка при загрузке" msgstr "Ошибка при загрузке"
#: pysollib/app.py:1147 #: pysollib/app.py:1153
msgid "Incompatible " msgid "Incompatible "
msgstr "Несовместимый " msgstr "Несовместимый "
#: pysollib/app.py:1149 #: pysollib/app.py:1155
msgid "" msgid ""
"The currently selected %s %s\n" "The currently selected %s %s\n"
"is not compatible with the game\n" "is not compatible with the game\n"
@ -276,7 +276,7 @@ msgstr ""
"\n" "\n"
"Необходимо выбрать %s типа %s.\n" "Необходимо выбрать %s типа %s.\n"
#: pysollib/app.py:1165 #: pysollib/app.py:1171
msgid "Please select a %s type %s" msgid "Please select a %s type %s"
msgstr "Выберите %s типа %s" msgstr "Выберите %s типа %s"
@ -1331,25 +1331,31 @@ msgstr "Не найден файл помощи\n"
msgid " Help" msgid " Help"
msgstr " Помощь" msgstr " Помощь"
#: pysollib/main.py:68 pysollib/main.py:287 #: pysollib/main.py:67 pysollib/main.py:287
msgid " installation error" msgid "%s installation error"
msgstr " проблема с установкой" msgstr "%s проблема с установкой"
#: pysollib/main.py:69 #: pysollib/main.py:68
msgid "" msgid ""
"No %ss were found !!!\n" "No cardsets were found !!!\n"
"\n" "\n"
"Main data directory is:\n" "Main data directory is:\n"
"%s\n" "%s\n"
"\n" "\n"
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
"Не найдены наборы карт!!!\n"
"\n"
"Основной каталог:\n"
"%s\n"
"\n"
"Пожалуйста проверьте установку %s.\n"
#: pysollib/main.py:76 pysollib/main.py:295 pysollib/tk/menubar.py:382 #: pysollib/main.py:75 pysollib/main.py:295 pysollib/tk/menubar.py:382
msgid "&Quit" msgid "&Quit"
msgstr "В&ыход" msgstr "В&ыход"
#: pysollib/main.py:100 #: pysollib/main.py:99
msgid "" msgid ""
"%s: %s\n" "%s: %s\n"
"try %s --help for more information" "try %s --help for more information"
@ -1357,7 +1363,7 @@ msgstr ""
"%s: %s\n" "%s: %s\n"
"попробуйте %s --help для получения более подробной информации" "попробуйте %s --help для получения более подробной информации"
#: pysollib/main.py:147 #: pysollib/main.py:146
msgid "" msgid ""
"Usage: %s [OPTIONS] [FILE]\n" "Usage: %s [OPTIONS] [FILE]\n"
" -g --game=GAMENAME start game GAMENAME\n" " -g --game=GAMENAME start game GAMENAME\n"
@ -1366,6 +1372,7 @@ msgid ""
" --fg --foreground=COLOR foreground color\n" " --fg --foreground=COLOR foreground color\n"
" --bg --background=COLOR background color\n" " --bg --background=COLOR background color\n"
" --fn --font=FONT default font\n" " --fn --font=FONT default font\n"
" --theme=THEME specify theme (for Tile binding)\n"
" --sound-mod=MOD\n" " --sound-mod=MOD\n"
" --nosound disable sound support\n" " --nosound disable sound support\n"
" --noplugins disable load plugins\n" " --noplugins disable load plugins\n"
@ -1381,13 +1388,14 @@ msgstr ""
" --fg --foreground=COLOR цвет текста\n" " --fg --foreground=COLOR цвет текста\n"
" --bg --background=COLOR цвет фона\n" " --bg --background=COLOR цвет фона\n"
" --fn --font=FONT шрифт по умолчанию\n" " --fn --font=FONT шрифт по умолчанию\n"
" --theme=THEME установить тему (for Tile binding)\n"
" --sound-mod=MOD\n" " --sound-mod=MOD\n"
" --nosound отключить звук\n" " --nosound отключить звук\n"
" --noplugins отключить загрузку плагинов\n" " --noplugins отключить загрузку плагинов\n"
" -h --help показать это сообщение и выйти\n" " -h --help показать это сообщение и выйти\n"
"\n" "\n"
" FILE - имя файла сохранённой игры\n" " FILE - имя файла сохранённой игры\n"
" MOD - one of following: pss(default), pygame, oss, win\n" " MOD - одно из следующих значений: pss(default), pygame, oss, win\n"
#: pysollib/main.py:165 #: pysollib/main.py:165
msgid "" msgid ""
@ -1415,10 +1423,17 @@ msgid ""
"\n" "\n"
"Please check your %s installation.\n" "Please check your %s installation.\n"
msgstr "" msgstr ""
"\n"
"Не найдены игры!!!\n"
"\n"
"Основной каталог с данными:\n"
"%s\n"
"\n"
"Пожалуйста проверьте установку %s.\n"
#: pysollib/main.py:374 pysollib/main.py:382 #: pysollib/main.py:374 pysollib/main.py:382
msgid " installation problem" msgid "%s installation problem"
msgstr "" msgstr "%s проблема с установкой"
#: pysollib/main.py:375 #: pysollib/main.py:375
msgid "" msgid ""
@ -1426,6 +1441,9 @@ msgid ""
"\n" "\n"
"Sounds and background music will be disabled." "Sounds and background music will be disabled."
msgstr "" msgstr ""
"Ваш дистрибутив Python собран без поддержки нитей.\n"
"\n"
"Звук и фоновая музыка будут недоступны."
#: pysollib/main.py:383 #: pysollib/main.py:383
msgid "" msgid ""
@ -1433,13 +1451,13 @@ msgid ""
"\n" "\n"
"Sounds and background music will be disabled." "Sounds and background music will be disabled."
msgstr "" msgstr ""
"Модуль pysolsoundserver не найден\n" "Модуль pysolsoundserver не найден.\n"
"\n" "\n"
"Звук и фоновая музыка будут недоступны" "Звук и фоновая музыка будут недоступны."
#: pysollib/main.py:390 #: pysollib/main.py:390
msgid "Welcome to " msgid "Welcome to %s"
msgstr "Добро пожаловать в " msgstr "Добро пожаловать в %s"
#: pysollib/resource.py:192 #: pysollib/resource.py:192
msgid "French type (52 cards)" msgid "French type (52 cards)"

View file

@ -938,6 +938,106 @@ class Cheops(Pyramid):
return abs(card1.rank-card2.rank) in (0,1) return abs(card1.rank-card2.rank) in (0,1)
# /***********************************************************************
# // Exit
# ************************************************************************/
class Exit_RowStack(Elevens_RowStack):
def acceptsCards(self, from_stack, cards):
#if self.basicIsBlocked():
# return 0
if from_stack is self or not self.cards or len(cards) != 1:
return False
c1 = self.cards[-1]
c2 = cards[0]
#if not c1.face_up or not c2.face_up:
# return False
return self.game._checkPair(c1, c2)
def moveMove(self, ncards, to_stack, frames=-1, shadow=-1):
self._dropPairMove(ncards, to_stack, frames=-1, shadow=shadow)
class Exit(Game):
def createGame(self):
# create layout
l, s = Layout(self), self.s
# set window
h1 = l.YS+5*l.YOFFSET
self.setSize(l.XM+7*l.XS, l.YM+2*h1+l.YS)
# create stacks
y = l.YM
for i in (0, 1):
x = l.XM
for j in range(5):
stack = Exit_RowStack(x, y, self, base_rank=NO_RANK,
max_move=1, max_accept=1, dir=0)
s.rows.append(stack)
stack.CARD_YOFFSET = l.YOFFSET
x += l.XS
y += h1
x, y = self.width-l.XS, l.YM
stack = Exit_RowStack(x, y, self, base_rank=NO_RANK,
max_move=1, max_accept=1, dir=0)
s.reserves.append(stack)
stack.CARD_YOFFSET = l.YOFFSET
x, y = self.width-l.XS, self.height-l.YS
s.foundations.append(AbstractFoundationStack(x, y, self, suit=ANY_SUIT,
max_accept=0, max_move=0, max_cards=52))
l.createText(s.foundations[0], "n")
x, y = l.XM, self.height-l.YS
s.talon = InitialDealTalonStack(x, y, self)
# define stack-groups
l.defaultStackGroups()
def _checkPair(self, c1, c2):
if c1.rank + c2.rank == 9: # A-10, 2-9, 3-8, 4-7, 5-6
return True
if c1.rank == JACK and c2.rank == JACK:
return True
if c1.rank + c2.rank == 23: # Q-K
return True
return False
def _shuffleHook(self, cards):
swap_index = None
for i in range(10):
jack_indexes = []
for j in range(5):
k = i*5+j
c = cards[k]
if c.rank == JACK:
jack_indexes.append(k)
if len(jack_indexes) == 3:
swap_index = jack_indexes[1]
if len(jack_indexes) >= 2:
break
if not swap_index is None:
i = -1
if cards[-1].rank == JACK: # paranoia
i = -2
cards[swap_index], cards[i] = cards[i], cards[swap_index]
cards.reverse()
return cards
def startGame(self):
self.startDealSample()
for i in range(10):
for j in range(5):
self.s.talon.dealRow(rows=[self.s.rows[i]], frames=4)
self.s.talon.dealRow(rows=self.s.reserves, frames=4)
self.s.talon.dealRow(rows=self.s.reserves, frames=4)
## def getAutoStacks(self, event=None):
## return ((), (), self.sg.dropstacks)
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return self._checkPair(card1, card2)
# register the game # register the game
registerGame(GameInfo(38, Pyramid, "Pyramid", registerGame(GameInfo(38, Pyramid, "Pyramid",
@ -969,4 +1069,6 @@ registerGame(GameInfo(658, Apophis, "Apophis",
GI.GT_PAIRING_TYPE, 1, 2, GI.SL_MOSTLY_LUCK)) GI.GT_PAIRING_TYPE, 1, 2, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(659, Cheops, "Cheops", registerGame(GameInfo(659, Cheops, "Cheops",
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_SKILL)) GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(674, Exit, "Exit",
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_SKILL))

View file

@ -41,7 +41,7 @@ import getopt
# PySol imports # PySol imports
from mfxutil import destruct, EnvError from mfxutil import destruct, EnvError
from util import CARDSET, DataLoader from util import DataLoader
from resource import Tile from resource import Tile
from gamedb import GI from gamedb import GI
from app import Application from app import Application
@ -64,16 +64,16 @@ from pysoltk import PysolProgressBar
def fatal_no_cardsets(app): def fatal_no_cardsets(app):
app.wm_withdraw() app.wm_withdraw()
d = MfxMessageDialog(app.top, title=PACKAGE + _(" installation error"), d = MfxMessageDialog(app.top, title=_("%s installation error") % PACKAGE,
text=_('''No %ss were found !!! text=_('''No cardsets were found !!!
Main data directory is: Main data directory is:
%s %s
Please check your %s installation. Please check your %s installation.
''') % (CARDSET, app.dataloader.dir, PACKAGE), ''') % (app.dataloader.dir, PACKAGE),
bitmap="error", strings=(_("&Quit"),)) bitmap="error", strings=(_("&Quit"),))
##raise Exception, "no "+CARDSET+"s found !" ##raise Exception, "no cardsets found !"
# /*********************************************************************** # /***********************************************************************
@ -150,6 +150,7 @@ def parse_option(argv):
--fg --foreground=COLOR foreground color --fg --foreground=COLOR foreground color
--bg --background=COLOR background color --bg --background=COLOR background color
--fn --font=FONT default font --fn --font=FONT default font
--theme=THEME specify theme (for Tile binding)
--sound-mod=MOD --sound-mod=MOD
--nosound disable sound support --nosound disable sound support
--noplugins disable load plugins --noplugins disable load plugins
@ -283,7 +284,7 @@ def pysol_init(app, args):
# check games # check games
if len(app.gdb.getGamesIdSortedByName()) == 0: if len(app.gdb.getGamesIdSortedByName()) == 0:
app.wm_withdraw() app.wm_withdraw()
d = MfxMessageDialog(top, title=PACKAGE + _(" installation error"), d = MfxMessageDialog(top, title=_("%s installation error") % PACKAGE,
text=_(''' text=_('''
No games were found !!! No games were found !!!
@ -331,7 +332,7 @@ Please check your %s installation.
if not app.audio.CAN_PLAY_SOUND: if not app.audio.CAN_PLAY_SOUND:
app.opt.sound = 0 app.opt.sound = 0
if not opts["nosound"] and not opts['sound-mod'] and pysolsoundserver and not app.audio.connected: if not opts["nosound"] and not opts['sound-mod'] and pysolsoundserver and not app.audio.connected:
print >> sys.stderr, PACKAGE + ": could not connect to pysolsoundserver, sound disabled." print >> sys.stderr, "%s: could not connect to pysolsoundserver, sound disabled." % PACKAGE
warn_pysolsoundserver = 1 warn_pysolsoundserver = 1
app.audio.updateSettings() app.audio.updateSettings()
# start up the background music # start up the background music
@ -363,14 +364,14 @@ Please check your %s installation.
if thread is None: if thread is None:
warn_thread = 1 warn_thread = 1
if thread is None: if thread is None:
print >> sys.stderr, PACKAGE+": Python thread module not found, sound disabled." print >> sys.stderr, "%s: Python thread module not found, sound disabled." % PACKAGE
else: else:
print >> sys.stderr, PACKAGE+": pysolsoundserver module not found, sound disabled." print >> sys.stderr, "%s: pysolsoundserver module not found, sound disabled." % PACKAGE
sys.stdout.flush() sys.stdout.flush()
if not opts["nosound"]: if not opts["nosound"]:
if warn_thread: if warn_thread:
top.update() top.update()
d = MfxMessageDialog(top, title=PACKAGE + _(" installation problem"), d = MfxMessageDialog(top, title=_("%s installation problem") % PACKAGE,
text=_('''\ text=_('''\
Your Python installation is compiled without thread support. Your Python installation is compiled without thread support.
@ -378,7 +379,7 @@ Sounds and background music will be disabled.'''),
bitmap="warning", strings=(_("&OK"),)) bitmap="warning", strings=(_("&OK"),))
elif warn_pysolsoundserver: elif warn_pysolsoundserver:
top.update() top.update()
d = MfxMessageDialog(top, title=PACKAGE + _(" installation problem"), d = MfxMessageDialog(top, title=_("%s installation problem") % PACKAGE,
text=_('''\ text=_('''\
The pysolsoundserver module was not found. The pysolsoundserver module was not found.
@ -386,7 +387,7 @@ Sounds and background music will be disabled.'''),
bitmap="warning", strings=(_("&OK"),)) bitmap="warning", strings=(_("&OK"),))
# create the progress bar # create the progress bar
title = _("Welcome to ") + PACKAGE title = _("Welcome to %s") % PACKAGE
color = app.opt.colors['table'] color = app.opt.colors['table']
if app.tabletile_index > 0: if app.tabletile_index > 0:
color = "#008200" color = "#008200"
@ -425,4 +426,3 @@ def main(args=None):
return r return r
# let's go - enter the mainloop # let's go - enter the mainloop
app.mainloop() app.mainloop()
return 0

View file

@ -67,6 +67,7 @@ class _MfxToplevel(gtk.Window):
#self.add(self.vbox) #self.add(self.vbox)
self.table = gtk.Table(3, 6, False) self.table = gtk.Table(3, 6, False)
self.add(self.table) self.add(self.table)
self.connect('destroy', self.mainquit)
self.table.show() self.table.show()
self.realize() self.realize()
@ -112,7 +113,7 @@ class _MfxToplevel(gtk.Window):
def mainloop(self): def mainloop(self):
gtk.main() # the global function gtk.main() # the global function
def mainquit(self): def mainquit(self, *args):
gtk.main_quit() # the global function gtk.main_quit() # the global function
def screenshot(self, filename): def screenshot(self, filename):

View file

@ -27,8 +27,10 @@ TclError = Tkinter.TclError
_flatten = Tkinter._flatten _flatten = Tkinter._flatten
class Style: class Style(Tkinter.Misc):
def __init__(self, master): def __init__(self, master=None):
if master is None:
master = Tkinter._default_root
self.tk = master.tk self.tk = master.tk
def default(self, style, **kw): def default(self, style, **kw):
@ -82,15 +84,6 @@ class Style:
"""Sets the current theme to themeName, and refreshes all widgets.""" """Sets the current theme to themeName, and refreshes all widgets."""
return self.tk.call("style", "theme", "use", theme) return self.tk.call("style", "theme", "use", theme)
def _options(self, cnf):
"""Internal function."""
res = ()
for k, v in cnf.items():
if v is not None:
if k[-1] == '_': k = k[:-1]
res = res + ('-'+k, str(v))
return res
def configure(self, style, **kw): def configure(self, style, **kw):
"""Sets the default value of the specified option(s) """Sets the default value of the specified option(s)
in style.""" in style."""
@ -98,6 +91,22 @@ class Style:
return self.tk.call("style", "configure", style, *opts) return self.tk.call("style", "configure", style, *opts)
config = configure config = configure
def lookup(self, style, option, state=None, default=None):
"""Returns the value specified for -option in style
style in state state, using the standard lookup
rules for element options. state is a list of
state names; if omitted, it defaults to all bits
off (the ``normal'' state). If the default argu-
ment is present, it is used as a fallback value in
case no specification for -option is found."""
opts = []
if state:
opts = [state]
if default:
opts.append(default)
return self.tk.call("style", "lookup", style, "-"+option, *opts)
class Widget(Tkinter.Widget, Style): class Widget(Tkinter.Widget, Style):
def __init__(self, master, widgetName=None, cnf={}, kw={}, extra=()): def __init__(self, master, widgetName=None, cnf={}, kw={}, extra=()):

View file

@ -421,6 +421,7 @@ def load_theme(app, top, theme):
top.tk.call('source', f) top.tk.call('source', f)
# #
top.tk.call("package", "require", "tile") top.tk.call("package", "require", "tile")
style = Tkinter.Style(top)
# load available themes # load available themes
d = os.path.join(app.dataloader.dir, 'themes') d = os.path.join(app.dataloader.dir, 'themes')
if os.path.isdir(d): if os.path.isdir(d):
@ -434,26 +435,28 @@ def load_theme(app, top, theme):
traceback.print_exc() traceback.print_exc()
pass pass
# set theme # set theme
all_themes = top.tk.call('style', 'theme', 'names') all_themes = style.theme_names()
if theme not in all_themes: if theme not in all_themes:
print >> sys.stderr, 'WARNING: invalid theme name:', theme print >> sys.stderr, 'WARNING: invalid theme name:', theme
theme = 'default' theme = 'default'
if theme: if theme:
top.tk.call('style', 'theme', 'use', theme) style.theme_use(theme)
if theme not in ('winnative',): if theme not in ('winnative', 'xpnative'):
bg = top.tk.call('style', 'lookup', '.', '-background') color = style.lookup('.', 'background')
top.tk_setPalette(bg) if color:
bg = top.tk.call('style', 'lookup', '.', '-background', 'active') top.tk_setPalette(color)
top.option_add('*Menu.activeBackground', bg) color = style.lookup('.', 'background', 'active')
if color:
top.option_add('*Menu.activeBackground', color)
if theme == 'winnative': if theme == 'winnative':
top.tk.call('style', 'configure', 'Toolbutton', '-padding', '1 1') style.configure('Toolbutton', padding=1)
#if 'xpnative' in all_themes: #if 'xpnative' in all_themes:
# theme = 'xpnative' # theme = 'xpnative'
font = app.opt.fonts['default'] font = app.opt.fonts['default']
if font: if font:
top.tk.call('style', 'configure', '.', '-font', font) style.configure('.', font=font)
else: else:
font = top.tk.call('style', 'lookup', '.', '-font') font = style.lookup('.', 'font')
if font: if font:
top.option_add('*font', font) top.option_add('*font', font)