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

+ 1 new game

* bugs fixes


git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@122 efabe8c0-fbe8-4139-b769-b5e6d273206e
This commit is contained in:
skomoroh 2006-12-16 22:43:15 +00:00
parent 2c570e5a92
commit e22a6cf8f7
8 changed files with 46 additions and 18 deletions

View file

@ -513,11 +513,11 @@ class Application:
# visual components
self.top = None # the root toplevel window
self.top_bg = None # default background
self.top_palette = [None, None] # from command line [fg, bg]
self.top_cursor = None # default cursor
self.menubar = None
self.toolbar = None
self.canvas = None
self.canvas = None # MfxCanvas
self.scrolled_canvas = None # MfxScrolledCanvas
self.statusbar = None
#
self.game = None

View file

@ -61,5 +61,3 @@ import wavemotion
import windmill
import yukon
import zodiac
from ultra import *
from special import *

View file

@ -657,6 +657,45 @@ class Brisbane(Yukon):
shallHighlightMatch = Game._shallHighlightMatch_RK
# /***********************************************************************
# // Hawaiian
# ************************************************************************/
class Hawaiian(Game):
Hint_Class = Yukon_Hint
def createGame(self, rows=10, playcards=20):
l, s = Layout(self), self.s
self.setSize(l.XM+max(rows, 8)*l.XS,
l.YM+2*l.YS+playcards*l.YOFFSET)
x, y = l.XM, l.YM
stack = OpenStack(x, y, self, max_move=1, max_accept=0)
s.reserves.append(stack)
l.createText(stack, 'ne')
x, y = self.width-8*l.XS, l.YM
for i in range(8):
s.foundations.append(SS_FoundationStack(x, y, self, suit=i/2))
x += l.XS
x, y = self.width-rows*l.XS, l.YM+l.YS
for i in range(rows):
s.rows.append(Yukon_AC_RowStack(x, y, self))
x += l.XS
x, y = l.XM, self.height-l.YS
s.talon = InitialDealTalonStack(x, y, self)
l.defaultStackGroups()
def startGame(self):
for i in range(104-5*10):
self.s.talon.dealRow(rows=self.s.reserves, frames=0)
for i in range(4):
self.s.talon.dealRow(frames=0)
self.startDealSample()
self.s.talon.dealRow()
shallHighlightMatch = Game._shallHighlightMatch_AC
# register the game
registerGame(GameInfo(19, Yukon, "Yukon",
@ -716,3 +755,5 @@ registerGame(GameInfo(531, DoubleRussianSpider, "Double Russian Spider",
GI.GT_SPIDER | GI.GT_ORIGINAL, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(603, Brisbane, "Brisbane",
GI.GT_SPIDER, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(707, Hawaiian, "Hawaiian",
GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0, GI.SL_BALANCED))

View file

@ -124,9 +124,6 @@ def parse_option(argv):
-g --game=GAMENAME start game GAMENAME
-i --gameid=GAMEID
--french-only
--fg --foreground=COLOR foreground color
--bg --background=COLOR background color
--fn --font=FONT default font
--sound-mod=MOD
--nosound disable sound support
--noplugins disable load plugins
@ -186,7 +183,6 @@ def pysol_init(app, args):
# init games database
import games
if not opts['french-only']:
#import games.contrib
import games.ultra
import games.mahjongg
import games.special
@ -209,7 +205,6 @@ def pysol_init(app, args):
top = MfxRoot(className=PACKAGE)
app.top = top
app.top_bg = top.cget("bg")
app.top_palette = [None, None] # [fg, bg]
app.top_cursor = top.cget("cursor")
# load options

View file

@ -186,12 +186,6 @@ class _MfxToplevel(gtk.Window):
pass
##~ self.set_geometry_hints(min_width=width, min_height=height)
def wm_protocol(self, name=None, func=None):
if name == 'WM_DELETE_WINDOW':
self.connect("delete_event", func)
else:
raise AttributeError, name
def wm_title(self, title):
self.set_title(title)
@ -234,6 +228,7 @@ class MfxRoot(_MfxToplevel):
def __init__(self, **kw):
apply(_MfxToplevel.__init__, (self,), kw)
self.app = None
self.connect("delete_event", self.wmDeleteWindow)
def connectApp(self, app):
self.app = app

View file

@ -89,6 +89,7 @@ class MfxRoot(Tkinter.Tk):
def __init__(self, **kw):
apply(Tkinter.Tk.__init__, (self,), kw)
self.app = None
self.wm_protocol('WM_DELETE_WINDOW', self.wmDeleteWindow)
# for interruptible sleep
#self.sleep_var = Tkinter.IntVar(self)
#self.sleep_var.set(0)

View file

@ -90,6 +90,7 @@ class MfxRoot(Tkinter.Tk):
def __init__(self, **kw):
apply(Tkinter.Tk.__init__, (self,), kw)
self.app = None
self.wm_protocol('WM_DELETE_WINDOW', self.wmDeleteWindow)
# for interruptible sleep
#self.sleep_var = Tkinter.IntVar(self)
#self.sleep_var.set(0)

View file

@ -56,9 +56,6 @@ class baseInitRootWindow:
#root.wm_group(root)
root.wm_title(PACKAGE + ' ' + VERSION)
root.wm_iconname(PACKAGE + ' ' + VERSION)
root.wm_protocol('WM_DELETE_WINDOW', root.wmDeleteWindow)
# set minsize
sw, sh, sd = (root.winfo_screenwidth(),
root.winfo_screenheight(),