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

Compare commits

...

7 commits

Author SHA1 Message Date
Joe R
f844c0eae2 Fix slow dealing issue 2024-11-26 22:59:18 -05:00
Joe R
a5e0c96450 Fix formatting in a few game rules files 2024-11-26 22:04:31 -05:00
Joe R
d36c19b158 Refresh forms to reduce unresponsiveness 2024-11-26 21:32:43 -05:00
Joe R
61eb1f0361 Fix error saving comments to the comments.txt file 2024-11-24 16:04:21 -05:00
Joe R
86d92c2636 Fix inconsistent capitalization on some menu bar items 2024-11-24 15:22:46 -05:00
Joe R
5392190c35 Unset busy when the demo ends 2024-11-21 20:52:23 -05:00
lufebe16
cb2252b74e Android/Kivy:
- metadata update
2024-11-20 09:32:25 +01:00
21 changed files with 62 additions and 55 deletions

View file

@ -9,7 +9,7 @@ else
fi fi
# current android version mumber. # current android version mumber.
version="3.1.0" version="3.1.1"
sversion=$(echo $version | sed -E "s:(.*)\..*:\1:") sversion=$(echo $version | sed -E "s:(.*)\..*:\1:")
tuple=$(echo $version | sed -E "s:(.*)\.(.*)\.(.*):(\1, \2, \3):") tuple=$(echo $version | sed -E "s:(.*)\.(.*)\.(.*):(\1, \2, \3):")

View file

@ -11,8 +11,8 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 102130100, "versionCode": 102130101,
"versionName": "3.1.0", "versionName": "3.1.1",
"outputFile": "pysolfc-release.apk" "outputFile": "pysolfc-release.apk"
} }
], ],

View file

@ -0,0 +1,3 @@
- zoom with two fingers and pan in the card free areas of a game.
- tools menu entry to reset the zoom.

View file

@ -1,16 +1,26 @@
<h1>Balarama</h1> <h1>Balarama</h1>
<p>
Dashavatara Ganjifa type. One deck. No redeal. Dashavatara Ganjifa type. One deck. No redeal.
<h3>Object</h3> <h3>Object</h3>
<p>
Move all cards to the foundations. Move all cards to the foundations.
<h3>Quick description</h3> <h3>Quick description</h3>
<p>
The cards build down by rank in alternate colors on the tableau, no more The cards build down by rank in alternate colors on the tableau, no more
than twelve to a row. Any card or sequence may be played on an empty row. than twelve to a row. Any card or sequence may be played on an empty row.
<h3>Rules</h3> <h3>Rules</h3>
<p>
All cards are dealt to the sixteen rows when the games begins. Cards All cards are dealt to the sixteen rows when the games begins. Cards
on the tableau build down in rank in alternating colors. See the general on the tableau build down in rank in alternating colors. See the general
<a href="../ganjifa.html">Ganjifa</a> <a href="../ganjifa.html">Ganjifa</a>
card rules for information on that. The foundations build up by suit. card rules for information on that. The foundations build up by suit.
<p>
Any card or sequence may be played on an empty row. The four reserve Any card or sequence may be played on an empty row. The four reserve
stacks hold one card each. stacks hold one card each.
<h3>Strategy</h3> <h3>Strategy</h3>
<p>
An empty row is more useful than the reserve stacks. Try for an empty row. An empty row is more useful than the reserve stacks. Try for an empty row.

View file

@ -9,7 +9,7 @@ Move all cards to the foundation.
<h3>Rules</h3> <h3>Rules</h3>
<p>As you draw cards from the talon, one at a time, declare a card rank <p>As you draw cards from the talon, one at a time, declare a card rank
in sequence (ace to king, then start over from ace). If the drawn card in sequence (ace to king, then start over from ace). If the drawn card
matches the declard rank, that is a "Hit", and the card may be moved to matches the declared rank, that is a "Hit", and the card may be moved to
the foundation. Otherwise, it is a "Miss". You can continue to redeal the foundation. Otherwise, it is a "Miss". You can continue to redeal
as many times as you need, until you go through the entire deck twice in as many times as you need, until you go through the entire deck twice in
a row without getting a single "Hit". a row without getting a single "Hit".

View file

@ -10,7 +10,7 @@ Play is similar to
The rows build down by suit and rank. The rows build down by suit and rank.
<h3>Rules</h3> <h3>Rules</h3>
The cards on the tableau build down in rank of the same suit. The The cards on the tableau build down in rank of the same suit. The
foundations build up in rank by suit starting with the Ace. The cards foundations build up in rank by suit starting with the Ace. The cards
are dealt from the talon one at a time. Any card or movable pile may are dealt from the talon one at a time. Any card or movable pile may
be played on an empty row. Cards may be played from the foundations. be played on an empty row. Cards may be played from the foundations.

View file

@ -6,7 +6,6 @@ Gypsy type. 2 decks. No redeal.
<p> <p>
Move all cards to the foundations. Move all cards to the foundations.
<h3>Quick Description</h3> <h3>Quick Description</h3>
<p> <p>
Like <a href="gypsy.html">Gypsy</a>, but only a single card Like <a href="gypsy.html">Gypsy</a>, but only a single card

View file

@ -1,18 +1,23 @@
<h1>Mughal Circles</h1> <h1>Mughal Circles</h1>
<p>
Mughal Ganjifa type. One deck. No redeal. Mughal Ganjifa type. One deck. No redeal.
<h3>Object</h3> <h3>Object</h3>
<p>
Move all cards to the foundations. Move all cards to the foundations.
<h3>Quick description</h3> <h3>Quick description</h3>
<p>
The cards build down by rank and by suit on the tableau. Any card may be The cards build down by rank and by suit on the tableau. Any card may be
played on an empty row. Only one card may be moved at a time. played on an empty row. Only one card may be moved at a time.
<h3>Rules</h3> <h3>Rules</h3>
<p>
All cards are dealt to the twenty four rows when the games begins. Cards All cards are dealt to the twenty four rows when the games begins. Cards
on the tableau build down by suit in descending rank order. The foundations on the tableau build down by suit in descending rank order. The foundations
build up by suit. Any card may be played on an empty row. The reserve stacks build up by suit. Any card may be played on an empty row. The reserve stacks
hold one card each. Only one card at a time may be moved. hold one card each. Only one card at a time may be moved.
<h3>Strategy</h3> <h3>Strategy</h3>
<p>
Try to keep a reserve stack open. Play higher ranked cards on empty rows. Try to keep a reserve stack open. Play higher ranked cards on empty rows.

View file

@ -4971,10 +4971,10 @@ msgstr "Karte suchen"
msgid "Full picture" msgid "Full picture"
msgstr "" msgstr ""
msgid "Icon Style" msgid "Icon style"
msgstr "" msgstr ""
msgid "Icon Size" msgid "Icon size"
msgstr "" msgstr ""
msgid "Small icons" msgid "Small icons"
@ -5543,7 +5543,7 @@ msgstr "&Regeln dieses Spiels"
msgid "What's &new?" msgid "What's &new?"
msgstr "" msgstr ""
msgid "R&eport a Bug" msgid "R&eport a bug"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:660 #: pysollib/ui/tktile/menubar.py:660

View file

@ -5022,10 +5022,10 @@ msgstr "Trouver carte"
msgid "Full picture" msgid "Full picture"
msgstr "" msgstr ""
msgid "Icon Style" msgid "Icon style"
msgstr "" msgstr ""
msgid "Icon Size" msgid "Icon size"
msgstr "" msgstr ""
msgid "Small icons" msgid "Small icons"
@ -5591,7 +5591,7 @@ msgstr "&Règles de ce jeu"
msgid "What's &new?" msgid "What's &new?"
msgstr "" msgstr ""
msgid "R&eport a Bug" msgid "R&eport a bug"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:660 #: pysollib/ui/tktile/menubar.py:660

View file

@ -5088,10 +5088,10 @@ msgstr "Trova carta"
msgid "Full picture" msgid "Full picture"
msgstr "" msgstr ""
msgid "Icon Style" msgid "Icon style"
msgstr "" msgstr ""
msgid "Icon Size" msgid "Icon size"
msgstr "" msgstr ""
msgid "Small icons" msgid "Small icons"
@ -5656,7 +5656,7 @@ msgstr "&Regole di questo gioco"
msgid "What's &new?" msgid "What's &new?"
msgstr "" msgstr ""
msgid "R&eport a Bug" msgid "R&eport a bug"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:660 #: pysollib/ui/tktile/menubar.py:660

View file

@ -5042,10 +5042,10 @@ msgstr "Znajdź kartę"
msgid "Full picture" msgid "Full picture"
msgstr "" msgstr ""
msgid "Icon Style" msgid "Icon style"
msgstr "Wygląd ikon" msgstr "Wygląd ikon"
msgid "Icon Size" msgid "Icon size"
msgstr "Rozmiar ikon" msgstr "Rozmiar ikon"
msgid "Small icons" msgid "Small icons"
@ -5605,7 +5605,7 @@ msgstr "Zasady tej g&ry"
msgid "What's &new?" msgid "What's &new?"
msgstr "Co &nowego?" msgstr "Co &nowego?"
msgid "R&eport a Bug" msgid "R&eport a bug"
msgstr "Zgłoś błąd" msgstr "Zgłoś błąd"
#: pysollib/ui/tktile/menubar.py:660 #: pysollib/ui/tktile/menubar.py:660

View file

@ -5044,10 +5044,10 @@ msgstr "Encontrar carta"
msgid "Full picture" msgid "Full picture"
msgstr "" msgstr ""
msgid "Icon Style" msgid "Icon style"
msgstr "" msgstr ""
msgid "Icon Size" msgid "Icon size"
msgstr "" msgstr ""
msgid "Small icons" msgid "Small icons"
@ -5613,8 +5613,8 @@ msgstr "&Regras desse jogo"
msgid "What's &new?" msgid "What's &new?"
msgstr "&Novidades" msgstr "&Novidades"
msgid "R&eport a Bug" msgid "R&eport a bug"
msgstr "R&eportar um Bug" msgstr "R&eportar um bug"
#: pysollib/ui/tktile/menubar.py:660 #: pysollib/ui/tktile/menubar.py:660
msgid "&License terms" msgid "&License terms"

View file

@ -4774,10 +4774,10 @@ msgstr ""
msgid "Full picture" msgid "Full picture"
msgstr "" msgstr ""
msgid "Icon Style" msgid "Icon style"
msgstr "" msgstr ""
msgid "Icon Size" msgid "Icon size"
msgstr "" msgstr ""
msgid "Small icons" msgid "Small icons"
@ -5337,7 +5337,7 @@ msgstr ""
msgid "What's &new?" msgid "What's &new?"
msgstr "" msgstr ""
msgid "R&eport a Bug" msgid "R&eport a bug"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:660 #: pysollib/ui/tktile/menubar.py:660

View file

@ -5111,10 +5111,10 @@ msgstr "Найти карту"
msgid "Full picture" msgid "Full picture"
msgstr "" msgstr ""
msgid "Icon Style" msgid "Icon style"
msgstr "" msgstr ""
msgid "Icon Size" msgid "Icon size"
msgstr "" msgstr ""
msgid "Small icons" msgid "Small icons"
@ -5681,7 +5681,7 @@ msgstr "&Правила текущей игры"
msgid "What's &new?" msgid "What's &new?"
msgstr "" msgstr ""
msgid "R&eport a Bug" msgid "R&eport a bug"
msgstr "" msgstr ""
#: pysollib/ui/tktile/menubar.py:660 #: pysollib/ui/tktile/menubar.py:660

View file

@ -21,7 +21,6 @@
# #
# ---------------------------------------------------------------------------## # ---------------------------------------------------------------------------##
import locale
import os import os
from pysollib.gamedb import GI from pysollib.gamedb import GI
@ -566,20 +565,17 @@ class PysolMenubar(PysolMenubarTk):
fn = os.path.normpath(fn) fn = os.path.normpath(fn)
if not text.endswith(os.linesep): if not text.endswith(os.linesep):
text += os.linesep text += os.linesep
enc = locale.getpreferredencoding()
try: try:
with open(fn, 'at') as fh: with open(fn, 'at') as fh:
fh.write(text.encode(enc, 'replace')) fh.write(d.text)
except Exception as err: except Exception as err:
d = MfxExceptionDialog( MfxExceptionDialog(
self.top, err, self.top, err, text=_("Error while writing to file"))
text=_("Error while writing to file"))
else: else:
d = MfxMessageDialog( MfxMessageDialog(
self.top, title=_("%s Info") % TITLE, bitmap="info", self.top, title=_("%s Info") % TITLE, bitmap="info",
text=_("Comments were appended to\n\n%(filename)s") text=_("Comments were appended to\n\n%(filename)s")
% {'filename': fn}) % {'filename': fn})
self._setCommentMenu(bool(game.gsaveinfo.comment))
# #
# Game menu - statistics # Game menu - statistics

View file

@ -781,7 +781,7 @@ class Game(object):
def getGameNumber(self, format): def getGameNumber(self, format):
s = self.random.getSeedAsStr() s = self.random.getSeedAsStr()
if format: if format:
return "# " + s return "#" + s
return s return s
# this is called from within createGame() # this is called from within createGame()
@ -2274,6 +2274,8 @@ class Game(object):
self.finishMove() self.finishMove()
if self.checkForWin(): if self.checkForWin():
return 1 return 1
self.top.update_idletasks()
self.top.busyUpdate()
return 0 return 0
def _autoDeal(self, sound=True): def _autoDeal(self, sound=True):
@ -2631,6 +2633,7 @@ class Game(object):
self.canvas.setTopImage(None) self.canvas.setTopImage(None)
self.demo_logo = None self.demo_logo = None
self.demo = None self.demo = None
self.busy = False
self.updateMenus() self.updateMenus()
# demo event - play one demo move and check for win/loss # demo event - play one demo move and check for win/loss

View file

@ -2059,9 +2059,6 @@ class PysolMenubarTk:
# LB: not used # LB: not used
return return
def _setCommentMenu(self, v):
return
def _setPauseMenu(self, v): def _setPauseMenu(self, v):
self.tkopt.pause.value = v self.tkopt.pause.value = v

View file

@ -762,10 +762,6 @@ class PysolMenubarTk:
def updateAll(self, *event): def updateAll(self, *event):
self.app.canvas.updateAll() self.app.canvas.updateAll()
def _setCommentMenu(self, v):
# FIXME
pass
def _setPauseMenu(self, v): def _setPauseMenu(self, v):
# FIXME # FIXME
pass pass

View file

@ -1689,6 +1689,9 @@ class DealRow_StackMethods:
if flip: if flip:
self.game.flipMove(self) self.game.flipMove(self)
self.game.moveMove(1, self, r, frames=frames) self.game.moveMove(1, self, r, frames=frames)
if frames > 0:
self.game.top.update_idletasks()
self.game.top.busyUpdate()
self.game.leaveState(old_state) self.game.leaveState(old_state)
if TOOLKIT == 'kivy': if TOOLKIT == 'kivy':
self.game.top.waitAnimation() self.game.top.waitAnimation()

View file

@ -23,7 +23,7 @@ from pysollib.ui.tktile.tkutil import after_idle, bind
def createToolbarMenu(menubar, menu): def createToolbarMenu(menubar, menu):
tearoff = menu.cget('tearoff') tearoff = menu.cget('tearoff')
data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'toolbar') data_dir = os.path.join(menubar.app.dataloader.dir, 'images', 'toolbar')
submenu = MfxMenu(menu, label=n_('Icon Style'), tearoff=tearoff) submenu = MfxMenu(menu, label=n_('Icon style'), tearoff=tearoff)
styledirs = os.listdir(data_dir) styledirs = os.listdir(data_dir)
styledirs.sort() styledirs.sort()
for f in styledirs: for f in styledirs:
@ -34,7 +34,7 @@ def createToolbarMenu(menubar, menu):
label=name, label=name,
variable=menubar.tkopt.toolbar_style, variable=menubar.tkopt.toolbar_style,
value=f, command=menubar.mOptToolbarStyle) value=f, command=menubar.mOptToolbarStyle)
submenu = MfxMenu(menu, label=n_('Icon Size'), tearoff=tearoff) submenu = MfxMenu(menu, label=n_('Icon size'), tearoff=tearoff)
submenu.add_radiobutton(label=n_("Small icons"), submenu.add_radiobutton(label=n_("Small icons"),
variable=menubar.tkopt.toolbar_size, value=0, variable=menubar.tkopt.toolbar_size, value=0,
command=menubar.mOptToolbarSize) command=menubar.mOptToolbarSize)
@ -291,7 +291,6 @@ class PysolMenubarTkCommon:
self.tkopt = Struct( self.tkopt = Struct(
gameid=tkinter.IntVar(), gameid=tkinter.IntVar(),
gameid_popular=tkinter.IntVar(), gameid_popular=tkinter.IntVar(),
comment=tkinter.BooleanVar(),
autofaceup=tkinter.BooleanVar(), autofaceup=tkinter.BooleanVar(),
autodrop=tkinter.BooleanVar(), autodrop=tkinter.BooleanVar(),
autodeal=tkinter.BooleanVar(), autodeal=tkinter.BooleanVar(),
@ -438,7 +437,6 @@ class PysolMenubarTkCommon:
tkopt = self.tkopt tkopt = self.tkopt
tkopt.gameid.set(game.id) tkopt.gameid.set(game.id)
tkopt.gameid_popular.set(game.id) tkopt.gameid_popular.set(game.id)
tkopt.comment.set(bool(game.gsaveinfo.comment))
tkopt.pause.set(self.game.pause) tkopt.pause.set(self.game.pause)
if game.canFindCard(): if game.canFindCard():
self._connect_game_find_card_dialog(game) self._connect_game_find_card_dialog(game)
@ -621,8 +619,8 @@ class PysolMenubarTkCommon:
label=n_("Log..."), label=n_("Log..."),
command=lambda: self.mPlayerStats(mode=103)) command=lambda: self.mPlayerStats(mode=103))
menu.add_separator() menu.add_separator()
menu.add_checkbutton( menu.add_command(
label=n_("&Comments..."), variable=self.tkopt.comment, label=n_("&Comments..."),
command=self.mEditGameComment) command=self.mEditGameComment)
menu = MfxMenu(self.menubar, label=n_("&Assist")) menu = MfxMenu(self.menubar, label=n_("&Assist"))
@ -911,7 +909,7 @@ class PysolMenubarTkCommon:
label=n_("What's &new?"), label=n_("What's &new?"),
command=self.mHelpNews) command=self.mHelpNews)
menu.add_command( menu.add_command(
label=n_("R&eport a Bug"), label=n_("R&eport a bug"),
command=self.mHelpReportBug) command=self.mHelpReportBug)
menu.add_command( menu.add_command(
label=n_("&License terms"), label=n_("&License terms"),
@ -1400,9 +1398,6 @@ class PysolMenubarTkCommon:
w = getattr(self.app.toolbar, path + "_button") w = getattr(self.app.toolbar, path + "_button")
w["state"] = s w["state"] = s
def _setCommentMenu(self, v):
self.tkopt.comment.set(v)
def _setPauseMenu(self, v): def _setPauseMenu(self, v):
self.tkopt.pause.set(v) self.tkopt.pause.set(v)