From 86aecf019a523c79db94953ac50a3b6316be37d8 Mon Sep 17 00:00:00 2001 From: skomoroh Date: Fri, 29 Sep 2006 23:27:02 +0000 Subject: [PATCH] * bugs fixes git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@74 efabe8c0-fbe8-4139-b769-b5e6d273206e --- pysollib/app.py | 4 ++-- pysollib/games/canfield.py | 10 +++++----- pysollib/games/capricieuse.py | 3 ++- pysollib/games/numerica.py | 13 +++++++++++-- pysollib/games/royalcotillion.py | 4 ++-- pysollib/games/sultan.py | 3 ++- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/pysollib/app.py b/pysollib/app.py index d1621159..c1c8329f 100644 --- a/pysollib/app.py +++ b/pysollib/app.py @@ -177,7 +177,7 @@ class Options: 'hintarrow': '#303030', 'not_matching': '#ff0000', } - self.use_default_text_color = True + self.use_default_text_color = False # delays self.timeouts = { 'hint': 1.0, @@ -202,7 +202,7 @@ class Options: self.splashscreen = True self.mouse_type = 'drag-n-drop' # or 'sticky-mouse' or 'point-n-click' self.mouse_undo = False # use mouse for undo/redo - self.negative_bottom = False + self.negative_bottom = True self.randomize_place = False self.cache_carsets = True # defaults & constants diff --git a/pysollib/games/canfield.py b/pysollib/games/canfield.py index 97510582..fb43ffff 100644 --- a/pysollib/games/canfield.py +++ b/pysollib/games/canfield.py @@ -420,20 +420,20 @@ class Gate(Game): l, s = Layout(self), self.s # set window - w, h = l.XM+max(8*l.XS, 6*l.XS+8*l.XOFFSET), l.YM+3*l.YS+12*l.YOFFSET - self.setSize(w, h) + w, h = max(8*l.XS, 6*l.XS+8*l.XOFFSET), l.YM+3*l.YS+12*l.YOFFSET + self.setSize(w+l.XM, h) # create stacks y = l.YM - for x in (l.XM+(w-(l.XM+8*l.XS))/2, w-l.XS-4*l.XOFFSET): + for x in (l.XM, l.XM+w-l.XS-4*l.XOFFSET): stack = OpenStack(x, y, self, max_accept=0) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 s.reserves.append(stack) - x, y = l.XM+2*l.XS, l.YM + x, y = l.XM+(w-4*l.XS)/2, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i)) x += l.XS - x, y = l.XM, l.YM+l.YS + x, y = l.XM+(w-8*l.XS)/2, l.YM+l.YS for i in range(8): s.rows.append(AC_RowStack(x, y, self)) x += l.XS diff --git a/pysollib/games/capricieuse.py b/pysollib/games/capricieuse.py index d6ffc19c..f3351ded 100644 --- a/pysollib/games/capricieuse.py +++ b/pysollib/games/capricieuse.py @@ -154,7 +154,8 @@ class Strata(Game): registerGame(GameInfo(292, Capricieuse, "Capricieuse", GI.GT_BAKERS_DOZEN | GI.GT_OPEN, 2, 2, GI.SL_MOSTLY_SKILL)) registerGame(GameInfo(293, Nationale, "Nationale", - GI.GT_BAKERS_DOZEN | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL)) + GI.GT_BAKERS_DOZEN | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL, + altnames=('Zigzag Course',) )) registerGame(GameInfo(606, Strata, "Strata", GI.GT_BAKERS_DOZEN | GI.GT_OPEN, 2, 1, GI.SL_MOSTLY_SKILL, ranks=(0, 6, 7, 8, 9, 10, 11, 12) )) diff --git a/pysollib/games/numerica.py b/pysollib/games/numerica.py index f160deef..7497c5a6 100644 --- a/pysollib/games/numerica.py +++ b/pysollib/games/numerica.py @@ -679,11 +679,20 @@ class Strategerie(Game): # // Anno Domini # ************************************************************************/ +class Assembly_RowStack(RK_RowStack): + def acceptsCards(self, from_stack, cards): + if not RK_RowStack.acceptsCards(self, from_stack, cards): + return False + if not self.cards: + return from_stack is self.game.s.waste + return True + + class Assembly(Numerica): Hint_Class = DefaultHint Foundation_Class = StackWrapper(RK_FoundationStack, suit=ANY_SUIT) - RowStack_Class = StackWrapper(RK_RowStack, max_move=1) + RowStack_Class = StackWrapper(Assembly_RowStack, max_move=1) def createGame(self): Numerica.createGame(self, waste_max_cards=UNLIMITED_CARDS) @@ -837,7 +846,7 @@ class DoubleMeasure(Measure): # register the game registerGame(GameInfo(257, Numerica, "Numerica", GI.GT_NUMERICA | GI.GT_CONTRIB, 1, 0, GI.SL_BALANCED, - altnames="Sir Tommy")) + altnames=("Sir Tommy",) )) registerGame(GameInfo(171, LadyBetty, "Lady Betty", GI.GT_NUMERICA, 1, 0, GI.SL_BALANCED)) registerGame(GameInfo(355, Frog, "Frog", diff --git a/pysollib/games/royalcotillion.py b/pysollib/games/royalcotillion.py index c6d52e81..0c1e134b 100644 --- a/pysollib/games/royalcotillion.py +++ b/pysollib/games/royalcotillion.py @@ -914,8 +914,8 @@ registerGame(GameInfo(97, Carpet, "Carpet", GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_LUCK)) registerGame(GameInfo(391, BritishConstitution, "British Constitution", GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED, - ranks=range(11) # without Queens and Kings - )) + ranks=range(11), # without Queens and Kings + altnames=("Constitution",) )) registerGame(GameInfo(392, NewBritishConstitution, "New British Constitution", GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0, GI.SL_BALANCED, ranks=range(11) # without Queens and Kings diff --git a/pysollib/games/sultan.py b/pysollib/games/sultan.py index f1d3322e..d59da55e 100644 --- a/pysollib/games/sultan.py +++ b/pysollib/games/sultan.py @@ -991,7 +991,8 @@ registerGame(GameInfo(559, Marshal, "Marshal", registerGame(GameInfo(565, RoyalAids, "Royal Aids", GI.GT_2DECK_TYPE, 2, UNLIMITED_REDEALS, GI.SL_BALANCED)) registerGame(GameInfo(598, PicturePatience, "Picture Patience", - GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_LUCK)) + GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_LUCK, + rules_filename="patriarchs.html")) registerGame(GameInfo(635, CircleEight, "Circle Eight", GI.GT_1DECK_TYPE, 1, 1, GI.SL_MOSTLY_LUCK)) registerGame(GameInfo(646, Adela, "Adela",