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

Added options to change/select other graphics.

This commit is contained in:
Joe R 2023-11-11 18:32:59 -05:00
parent 3483bd16a8
commit c8ea09c319
44 changed files with 263 additions and 19 deletions

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View file

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View file

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View file

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View file

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View file

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

View file

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 230 B

View file

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 451 B

View file

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 226 B

View file

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 462 B

View file

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 234 B

View file

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 475 B

View file

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View file

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 449 B

View file

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View file

Before

Width:  |  Height:  |  Size: 7 KiB

After

Width:  |  Height:  |  Size: 7 KiB

View file

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View file

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View file

Before

Width:  |  Height:  |  Size: 7 KiB

After

Width:  |  Height:  |  Size: 7 KiB

View file

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 808 B

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 889 B

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

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: 2023-11-05 12:49-0500\n"
"PO-Revision-Date: 2023-11-11 18:27-0500\n"
"Last-Translator: H. Schaekel <Holger.Schaekel@web.de>\n"
"Language-Team: German\n"
"Language: de\n"
@ -5363,10 +5363,25 @@ msgstr ""
msgid "Save games &geometry"
msgstr "Spielgeometrie speichern"
msgid "Othe&r graphics"
msgstr ""
#: pysollib/ui/tktile/menubar.py:637
msgid "&Demo logo"
msgstr "&Demo logo"
msgid "D&ialog icons"
msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text"
msgstr ""
msgid "&Redeal iconso"
msgstr ""
#: pysollib/ui/tktile/menubar.py:640
msgid "Startup splash sc&reen"
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: 2023-11-05 12:49-0500\n"
"PO-Revision-Date: 2023-11-11 18:27-0500\n"
"Last-Translator: Eric Rausch <neelix570@gmail.com>\n"
"Language-Team: French\n"
"Language: fr\n"
@ -5408,10 +5408,25 @@ msgstr "Barre d'&aide"
msgid "Save games &geometry"
msgstr "Enregistrer la &géométrie du jeu"
msgid "Othe&r graphics"
msgstr ""
#: pysollib/ui/tktile/menubar.py:637
msgid "&Demo logo"
msgstr "Logo de &démo"
msgid "D&ialog icons"
msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text"
msgstr ""
msgid "&Redeal iconso"
msgstr ""
#: pysollib/ui/tktile/menubar.py:640
msgid "Startup splash sc&reen"
msgstr "Éc&ran de démarrage"

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: 2023-11-05 12:49-0500\n"
"PO-Revision-Date: 2023-11-11 18:26-0500\n"
"Last-Translator: Giuliano Colla <giuliano.colla@gmail.com>\n"
"Language-Team: Italiano <it@li.org>\n"
"Language: it\n"
@ -5472,10 +5472,25 @@ msgstr "Mostra barra di a&iuto"
msgid "Save games &geometry"
msgstr "Salva gioco e &geometria"
msgid "Othe&r graphics"
msgstr ""
#: pysollib/ui/tktile/menubar.py:637
msgid "&Demo logo"
msgstr "&Demo logo"
msgid "D&ialog icons"
msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text"
msgstr ""
msgid "&Redeal iconso"
msgstr ""
#: pysollib/ui/tktile/menubar.py:640
msgid "Startup splash sc&reen"
msgstr "Splash sc&reen all'avvio"

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: PySolFC\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2023-11-05 12:49-0500\n"
"PO-Revision-Date: 2023-11-11 18:26-0500\n"
"Last-Translator: Jerzy Trzeciak <artusek@wp.pl>\n"
"Language-Team: Polish <pl@li.org>\n"
"Language: pl\n"
@ -5424,10 +5424,25 @@ msgstr "Pokaż pasek pomocy"
msgid "Save games &geometry"
msgstr "Zapisz układ &gier"
msgid "Othe&r graphics"
msgstr ""
#: pysollib/ui/tktile/menubar.py:637
msgid "&Demo logo"
msgstr "&Demo logo"
msgid "D&ialog icons"
msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text"
msgstr ""
msgid "&Redeal iconso"
msgstr ""
#: pysollib/ui/tktile/menubar.py:640
msgid "Startup splash sc&reen"
msgstr "Ek&ran powitalny"

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: 2023-11-05 12:50-0500\n"
"PO-Revision-Date: 2023-11-11 18:25-0500\n"
"Last-Translator: Matheus Knack <mtknack555@gmail.com>\n"
"Language-Team: \n"
"Language: pt_BR\n"
@ -5430,10 +5430,25 @@ msgstr "Mostra &barra de ajuda"
msgid "Save games &geometry"
msgstr "Salvar jogos &geometria"
msgid "Othe&r graphics"
msgstr ""
#: pysollib/ui/tktile/menubar.py:637
msgid "&Demo logo"
msgstr "&Logo da demo"
msgid "D&ialog icons"
msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text"
msgstr ""
msgid "&Redeal iconso"
msgstr ""
#: pysollib/ui/tktile/menubar.py:640
msgid "Startup splash sc&reen"
msgstr "Tela inicial de iniciali&zação"

View file

@ -5157,10 +5157,25 @@ msgstr ""
msgid "Save games &geometry"
msgstr ""
msgid "Othe&r graphics"
msgstr ""
#: pysollib/ui/tktile/menubar.py:637
msgid "&Demo logo"
msgstr ""
msgid "D&ialog icons"
msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text"
msgstr ""
msgid "&Redeal iconso"
msgstr ""
#: pysollib/ui/tktile/menubar.py:640
msgid "Startup splash sc&reen"
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: 2023-11-05 12:50-0500\n"
"PO-Revision-Date: 2023-11-11 18:25-0500\n"
"Last-Translator: Skomoroh <skomoroh@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n"
"Language: ru\n"
@ -5498,10 +5498,25 @@ msgstr "Показывать панель помощи"
msgid "Save games &geometry"
msgstr "Сохранение &геометрии игры"
msgid "Othe&r graphics"
msgstr ""
#: pysollib/ui/tktile/menubar.py:637
msgid "&Demo logo"
msgstr "Д&емо лого"
msgid "D&ialog icons"
msgstr ""
msgid "&Show demo logo"
msgstr ""
msgid "&Pause text"
msgstr ""
msgid "&Redeal iconso"
msgstr ""
#: pysollib/ui/tktile/menubar.py:640
msgid "Startup splash sc&reen"
msgstr "О&кно запуска"

View file

@ -508,6 +508,7 @@ class Application:
def loadImages1(self):
# load dialog images
dirname = os.path.join("images", "logos")
self.gimages.logos = []
for f in ("joker07_40_774",
"joker08_40_774",
"joker07_50_774",
@ -515,11 +516,7 @@ class Application:
"joker11_100_774",
"joker10_100",):
self.gimages.logos.append(self.dataloader.findImage(f, dirname))
# if WIN_SYSTEM == 'win32':
# dirname = os.path.join('images', 'dialog', 'default')
# else:
# dirname = os.path.join('images', 'dialog', 'bluecurve')
dirname = os.path.join('images', 'dialog', 'remix')
dirname = os.path.join('images', 'dialog', self.opt.dialog_icon_style)
for f in ('error', 'info', 'question', 'warning'):
fn = self.dataloader.findImage(f, dirname)
im = loadImage(fn)
@ -539,16 +536,27 @@ class Application:
def loadImages2(self):
# load canvas images
dirname = "images"
dirname = os.path.join("images", "redealicons",
self.opt.redeal_icon_style)
# for f in ("noredeal", "redeal",):
self.gimages.redeal = []
for f in ("stopsign", "redeal",):
self.gimages.redeal.append(self.dataloader.findImage(f, dirname))
dirname = os.path.join("images", "demo")
dirname = os.path.join("images", "demo", self.opt.demo_logo_style)
self.gimages.demo = []
for f in ("demo01", "demo02", "demo03", "demo04", "demo05",):
self.gimages.demo.append(self.dataloader.findImage(f, dirname))
dirname = os.path.join("images", "pause")
try:
self.gimages.demo.append(self.dataloader.findImage(f, dirname))
except OSError:
pass
dirname = os.path.join("images", "pause", self.opt.pause_text_style)
self.gimages.pause = []
for f in ("pause01", "pause02", "pause03",):
self.gimages.pause.append(self.dataloader.findImage(f, dirname))
try:
self.gimages.pause.append(self.dataloader.findImage(f,
dirname))
except OSError:
pass
# dirname = os.path.join("images", "stats")
# for f in ("barchart",):
# self.gimages.stats.append(self.dataloader.findImage(f, dirname))

View file

@ -95,6 +95,10 @@ shade = boolean
shrink_face_down = boolean
shade_filled_stacks = boolean
demo_logo = boolean
demo_logo_style = string
pause_text_style = string
redeal_icon_style = string
dialog_icon_style = string
tile_theme = string
default_tile_theme = string
toolbar = integer(0, 4)
@ -258,6 +262,10 @@ class Options:
('shrink_face_down', 'bool'),
('shade_filled_stacks', 'bool'),
('demo_logo', 'bool'),
('demo_logo_style', 'str'),
('pause_text_style', 'str'),
('redeal_icon_style', 'str'),
('dialog_icon_style', 'str'),
('tile_theme', 'str'),
('default_tile_theme', 'str'),
('toolbar', 'int'),
@ -357,6 +365,10 @@ class Options:
self.shrink_face_down = True
self.shade_filled_stacks = True
self.demo_logo = True
self.demo_logo_style = 'classic'
self.pause_text_style = 'classic'
self.redeal_icon_style = 'modern'
self.dialog_icon_style = 'remix'
self.tile_theme = 'default'
self.default_tile_theme = 'default'
self.toolbar = 1 # 0 == hide, 1,2,3,4 == top, bottom, lef, right

View file

@ -86,6 +86,63 @@ def createStatusbarMenu(menubar, menu):
command=lambda m=menubar, w=comp: m.mOptStatusbarConfig(w))
def createOtherGraphicsMenu(menubar, menu):
tearoff = menu.cget('tearoff')
data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'demo')
submenu = MfxMenu(menu, label=n_('&Demo logo'), tearoff=tearoff)
submenu.add_checkbutton(
label=n_("&Show demo logo"), variable=menubar.tkopt.demo_logo,
command=menubar.mOptDemoLogo)
submenu.add_separator()
styledirs = os.listdir(data_dir)
styledirs.sort()
for f in styledirs:
d = os.path.join(data_dir, f)
if os.path.isdir(d) and os.path.exists(os.path.join(d)):
name = f.replace('_', ' ').capitalize()
submenu.add_radiobutton(
label=name,
variable=menubar.tkopt.demo_logo_style,
value=f, command=menubar.mOptDemoLogoStyle)
data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'dialog')
submenu = MfxMenu(menu, label=n_('D&ialog icons'), tearoff=tearoff)
styledirs = os.listdir(data_dir)
styledirs.sort()
for f in styledirs:
d = os.path.join(data_dir, f)
if os.path.isdir(d) and os.path.exists(os.path.join(d)):
name = f.replace('_', ' ').capitalize()
submenu.add_radiobutton(
label=name,
variable=menubar.tkopt.dialog_icon_style,
value=f, command=menubar.mOptDialogIconStyle)
data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'pause')
submenu = MfxMenu(menu, label=n_('&Pause text'), tearoff=tearoff)
styledirs = os.listdir(data_dir)
styledirs.sort()
for f in styledirs:
d = os.path.join(data_dir, f)
if os.path.isdir(d) and os.path.exists(os.path.join(d)):
name = f.replace('_', ' ').capitalize()
submenu.add_radiobutton(
label=name,
variable=menubar.tkopt.pause_text_style,
value=f, command=menubar.mOptPauseTextStyle)
data_dir = os.path.join(menubar.app.dataloader.dir, 'images',
'redealicons')
submenu = MfxMenu(menu, label=n_('&Redeal icons'), tearoff=tearoff)
styledirs = os.listdir(data_dir)
styledirs.sort()
for f in styledirs:
d = os.path.join(data_dir, f)
if os.path.isdir(d) and os.path.exists(os.path.join(d)):
name = f.replace('_', ' ').capitalize()
submenu.add_radiobutton(
label=name,
variable=menubar.tkopt.redeal_icon_style,
value=f, command=menubar.mOptRedealIconStyle)
def createResamplingMenu(menubar, menu):
tearoff = menu.cget('tearoff')
submenu = MfxMenu(menu, label=n_('R&esampling'), tearoff=tearoff)
@ -260,6 +317,10 @@ class PysolMenubarTkCommon:
helpbar=tkinter.BooleanVar(),
splashscreen=tkinter.BooleanVar(),
demo_logo=tkinter.BooleanVar(),
demo_logo_style=tkinter.StringVar(),
pause_text_style=tkinter.StringVar(),
redeal_icon_style=tkinter.StringVar(),
dialog_icon_style=tkinter.StringVar(),
mouse_type=tkinter.StringVar(),
mouse_undo=tkinter.BooleanVar(),
negative_bottom=tkinter.BooleanVar(),
@ -324,6 +385,10 @@ class PysolMenubarTkCommon:
# tkopt.num_cards.set(opt.num_cards)
# tkopt.helpbar.set(opt.helpbar)
tkopt.demo_logo.set(opt.demo_logo)
tkopt.demo_logo_style.set(opt.demo_logo_style)
tkopt.pause_text_style.set(opt.pause_text_style)
tkopt.redeal_icon_style.set(opt.redeal_icon_style)
tkopt.dialog_icon_style.set(opt.dialog_icon_style)
tkopt.splashscreen.set(opt.splashscreen)
tkopt.mouse_type.set(opt.mouse_type)
tkopt.mouse_undo.set(opt.mouse_undo)
@ -770,14 +835,15 @@ class PysolMenubarTkCommon:
createToolbarMenu(self, submenu)
submenu = MfxMenu(menu, label=n_("Stat&usbar"))
createStatusbarMenu(self, submenu)
submenu = MfxMenu(menu, label=n_("Othe&r graphics"))
createOtherGraphicsMenu(self, submenu)
if not USE_PIL:
menu.add_separator()
menu.add_checkbutton(
label=n_("Save games &geometry"),
variable=self.tkopt.save_games_geometry,
command=self.mOptSaveGamesGeometry)
menu.add_checkbutton(
label=n_("&Demo logo"), variable=self.tkopt.demo_logo,
command=self.mOptDemoLogo)
# menu.add_checkbutton(
# label=n_("Startup splash sc&reen"),
# variable=self.tkopt.splashscreen,
@ -1842,6 +1908,18 @@ Unsupported game for import.
def mOptStatusbarConfig(self, w):
self.statusbarConfig(w, self.tkopt.statusbar_vars[w].get())
def mOptDemoLogoStyle(self, *event):
self.setDemoLogoStyle(self.tkopt.demo_logo_style.get())
def mOptDialogIconStyle(self, *event):
self.setDialogIconStyle(self.tkopt.dialog_icon_style.get())
def mOptPauseTextStyle(self, *event):
self.setPauseTextStyle(self.tkopt.pause_text_style.get())
def mOptRedealIconStyle(self, *event):
self.setRedealIconStyle(self.tkopt.redeal_icon_style.get())
def mOptNumCards(self, *event):
if self._cancelDrag(break_pause=False):
return
@ -1929,6 +2007,47 @@ Unsupported game for import.
self.game.updateStatus(player=self.app.opt.player)
self.top.update_idletasks()
def setDemoLogoStyle(self, style):
if self._cancelDrag(break_pause=False):
return
self.app.opt.demo_logo_style = style
self.tkopt.demo_logo_style.set(style) # update radiobutton
self.app.loadImages2()
self.app.loadImages4()
self.app.updateCardset()
self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1)
def setDialogIconStyle(self, style):
if self._cancelDrag(break_pause=False):
return
self.app.opt.dialog_icon_style = style
self.tkopt.dialog_icon_style.set(style) # update radiobutton
self.app.loadImages1()
self.app.loadImages4()
def setPauseTextStyle(self, style):
if self._cancelDrag(break_pause=False):
return
self.app.opt.pause_text_style = style
self.tkopt.pause_text_style.set(style) # update radiobutton
self.app.loadImages2()
self.app.loadImages4()
self.app.updateCardset()
self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1)
def setRedealIconStyle(self, style):
if self._cancelDrag(break_pause=False):
return
self.app.opt.redeal_icon_style = style
self.tkopt.redeal_icon_style.set(style) # update radiobutton
self.app.loadImages2()
self.app.loadImages4()
self.app.updateCardset()
self.game.endGame(bookmark=1)
self.game.quitGame(bookmark=1)
def wizardDialog(self, edit=False):
from pysollib.wizardutil import write_game, reset_wizard
WizardDialog = self._calcWizardDialog()