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: https://pysolfc.svn.sourceforge.net/svnroot/pysolfc/PySolFC/trunk@122 39dd0a4e-7c14-0410-91b3-c4f2d318f732
This commit is contained in:
parent
f9711c85af
commit
fd69d8a0ba
8 changed files with 46 additions and 18 deletions
|
@ -513,11 +513,11 @@ class Application:
|
||||||
# visual components
|
# visual components
|
||||||
self.top = None # the root toplevel window
|
self.top = None # the root toplevel window
|
||||||
self.top_bg = None # default background
|
self.top_bg = None # default background
|
||||||
self.top_palette = [None, None] # from command line [fg, bg]
|
|
||||||
self.top_cursor = None # default cursor
|
self.top_cursor = None # default cursor
|
||||||
self.menubar = None
|
self.menubar = None
|
||||||
self.toolbar = None
|
self.toolbar = None
|
||||||
self.canvas = None
|
self.canvas = None # MfxCanvas
|
||||||
|
self.scrolled_canvas = None # MfxScrolledCanvas
|
||||||
self.statusbar = None
|
self.statusbar = None
|
||||||
#
|
#
|
||||||
self.game = None
|
self.game = None
|
||||||
|
|
|
@ -61,5 +61,3 @@ import wavemotion
|
||||||
import windmill
|
import windmill
|
||||||
import yukon
|
import yukon
|
||||||
import zodiac
|
import zodiac
|
||||||
from ultra import *
|
|
||||||
from special import *
|
|
|
@ -657,6 +657,45 @@ class Brisbane(Yukon):
|
||||||
shallHighlightMatch = Game._shallHighlightMatch_RK
|
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
|
# register the game
|
||||||
registerGame(GameInfo(19, Yukon, "Yukon",
|
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))
|
GI.GT_SPIDER | GI.GT_ORIGINAL, 2, 0, GI.SL_BALANCED))
|
||||||
registerGame(GameInfo(603, Brisbane, "Brisbane",
|
registerGame(GameInfo(603, Brisbane, "Brisbane",
|
||||||
GI.GT_SPIDER, 1, 0, GI.SL_BALANCED))
|
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))
|
||||||
|
|
|
@ -124,9 +124,6 @@ def parse_option(argv):
|
||||||
-g --game=GAMENAME start game GAMENAME
|
-g --game=GAMENAME start game GAMENAME
|
||||||
-i --gameid=GAMEID
|
-i --gameid=GAMEID
|
||||||
--french-only
|
--french-only
|
||||||
--fg --foreground=COLOR foreground color
|
|
||||||
--bg --background=COLOR background color
|
|
||||||
--fn --font=FONT default font
|
|
||||||
--sound-mod=MOD
|
--sound-mod=MOD
|
||||||
--nosound disable sound support
|
--nosound disable sound support
|
||||||
--noplugins disable load plugins
|
--noplugins disable load plugins
|
||||||
|
@ -186,7 +183,6 @@ def pysol_init(app, args):
|
||||||
# init games database
|
# init games database
|
||||||
import games
|
import games
|
||||||
if not opts['french-only']:
|
if not opts['french-only']:
|
||||||
#import games.contrib
|
|
||||||
import games.ultra
|
import games.ultra
|
||||||
import games.mahjongg
|
import games.mahjongg
|
||||||
import games.special
|
import games.special
|
||||||
|
@ -209,7 +205,6 @@ def pysol_init(app, args):
|
||||||
top = MfxRoot(className=PACKAGE)
|
top = MfxRoot(className=PACKAGE)
|
||||||
app.top = top
|
app.top = top
|
||||||
app.top_bg = top.cget("bg")
|
app.top_bg = top.cget("bg")
|
||||||
app.top_palette = [None, None] # [fg, bg]
|
|
||||||
app.top_cursor = top.cget("cursor")
|
app.top_cursor = top.cget("cursor")
|
||||||
|
|
||||||
# load options
|
# load options
|
||||||
|
|
|
@ -186,12 +186,6 @@ class _MfxToplevel(gtk.Window):
|
||||||
pass
|
pass
|
||||||
##~ self.set_geometry_hints(min_width=width, min_height=height)
|
##~ 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):
|
def wm_title(self, title):
|
||||||
self.set_title(title)
|
self.set_title(title)
|
||||||
|
|
||||||
|
@ -234,6 +228,7 @@ class MfxRoot(_MfxToplevel):
|
||||||
def __init__(self, **kw):
|
def __init__(self, **kw):
|
||||||
apply(_MfxToplevel.__init__, (self,), kw)
|
apply(_MfxToplevel.__init__, (self,), kw)
|
||||||
self.app = None
|
self.app = None
|
||||||
|
self.connect("delete_event", self.wmDeleteWindow)
|
||||||
|
|
||||||
def connectApp(self, app):
|
def connectApp(self, app):
|
||||||
self.app = app
|
self.app = app
|
||||||
|
|
|
@ -89,6 +89,7 @@ class MfxRoot(Tkinter.Tk):
|
||||||
def __init__(self, **kw):
|
def __init__(self, **kw):
|
||||||
apply(Tkinter.Tk.__init__, (self,), kw)
|
apply(Tkinter.Tk.__init__, (self,), kw)
|
||||||
self.app = None
|
self.app = None
|
||||||
|
self.wm_protocol('WM_DELETE_WINDOW', self.wmDeleteWindow)
|
||||||
# for interruptible sleep
|
# for interruptible sleep
|
||||||
#self.sleep_var = Tkinter.IntVar(self)
|
#self.sleep_var = Tkinter.IntVar(self)
|
||||||
#self.sleep_var.set(0)
|
#self.sleep_var.set(0)
|
||||||
|
|
|
@ -90,6 +90,7 @@ class MfxRoot(Tkinter.Tk):
|
||||||
def __init__(self, **kw):
|
def __init__(self, **kw):
|
||||||
apply(Tkinter.Tk.__init__, (self,), kw)
|
apply(Tkinter.Tk.__init__, (self,), kw)
|
||||||
self.app = None
|
self.app = None
|
||||||
|
self.wm_protocol('WM_DELETE_WINDOW', self.wmDeleteWindow)
|
||||||
# for interruptible sleep
|
# for interruptible sleep
|
||||||
#self.sleep_var = Tkinter.IntVar(self)
|
#self.sleep_var = Tkinter.IntVar(self)
|
||||||
#self.sleep_var.set(0)
|
#self.sleep_var.set(0)
|
||||||
|
|
|
@ -56,9 +56,6 @@ class baseInitRootWindow:
|
||||||
#root.wm_group(root)
|
#root.wm_group(root)
|
||||||
root.wm_title(PACKAGE + ' ' + VERSION)
|
root.wm_title(PACKAGE + ' ' + VERSION)
|
||||||
root.wm_iconname(PACKAGE + ' ' + VERSION)
|
root.wm_iconname(PACKAGE + ' ' + VERSION)
|
||||||
|
|
||||||
root.wm_protocol('WM_DELETE_WINDOW', root.wmDeleteWindow)
|
|
||||||
|
|
||||||
# set minsize
|
# set minsize
|
||||||
sw, sh, sd = (root.winfo_screenwidth(),
|
sw, sh, sd = (root.winfo_screenwidth(),
|
||||||
root.winfo_screenheight(),
|
root.winfo_screenheight(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue