예제 #1
0
    def fatal_no_cardsets(app):
        app.wm_withdraw()
        MfxMessageDialog(app.top, title=_("%s installation error") % TITLE,
                         text=_('''No cardsets were found!!!

Cardsets should be installed into:
%(dir)s

Please check your %(app)s installation.
''') % {'dir': getprefdir(PACKAGE) + '/cardsets/', 'app': TITLE},
            bitmap="error", strings=(_("&Quit"),))
예제 #2
0
파일: main.py 프로젝트: shlomif/PySolFC
    def fatal_no_cardsets(app):
        app.wm_withdraw()
        MfxMessageDialog(app.top, title=_("%s installation error") % TITLE,
                         text=_('''No cardsets were found !!!

Cardsets should be installed into:
%s/cardsets/

Please check your %s installation.
''') % (getprefdir(PACKAGE), TITLE),
            bitmap="error", strings=(_("&Quit"),))
예제 #3
0
 def __init__(self):
     self.gdb = GAME_DB
     self.opt = Options()
     self.startup_opt = self.opt.copy()
     self.stats = Statistics()
     self.splashscreen = 1
     # visual components
     self.top = None  # the root toplevel window
     self.top_bg = None  # default background
     self.top_cursor = None  # default cursor
     self.menubar = None
     self.toolbar = None
     self.canvas = None  # MfxCanvas
     self.scrolled_canvas = None  # MfxScrolledCanvas
     self.statusbar = None
     #
     self.game = None
     self.dataloader = None
     self.audio = None
     self.images = None
     self.subsampled_images = None
     self.gimages = Struct(  # global images
         demo=[],  # demo logos
         pause=[],  # pause logos
         logos=[],
         redeal=[],
     )
     # self.progress_bg = None
     self.progress_images = []
     self.cardset_manager = CardsetManager()
     self.cardset = None  # current cardset
     self.cardsets_cache = {}
     self.tabletile_manager = TileManager()
     self.tabletile_index = 0  # current table tile
     self.sample_manager = SampleManager()
     self.music_manager = MusicManager()
     self.music_playlist = []
     self.intro = Struct(
         progress=None,  # progress bar
     )
     # directory names
     config = os.path.normpath(getprefdir(PACKAGE))
     self.dn = Struct(
         config=config,
         plugins=os.path.join(config, "plugins"),
         savegames=os.path.join(config, "savegames"),
         maint=os.path.join(config, "maint"),  # debug
     )
     for k, v in self.dn.__dict__.items():
         #             if os.name == "nt":
         #                 v = os.path.normcase(v)
         v = os.path.normpath(v)
         self.dn.__dict__[k] = v
     # file names
     self.fn = Struct(
         opt=os.path.join(self.dn.config, "options.dat"),
         opt_cfg=os.path.join(self.dn.config, "options.cfg"),
         stats=os.path.join(self.dn.config, "statistics.dat"),
         holdgame=os.path.join(self.dn.config, "holdgame.dat"),
         comments=os.path.join(self.dn.config, "comments.dat"),
     )
     for k, v in self.dn.__dict__.items():
         if os.name == "nt":
             v = os.path.normcase(v)
         v = os.path.normpath(v)
         self.fn.__dict__[k] = v
     # random generators
     self.gamerandom = PysolRandom()
     self.miscrandom = PysolRandom()
     # player
     player = getusername()
     if not player:
         player = "unknown"
     player = player[:30]
     self.opt.player = player
     # misc
     self.nextgame = Struct(
         id=0,  # start this game
         random=None,  # use this random generator
         loadedgame=None,  # data for loaded game
         startdemo=0,  # start demo ?
         cardset=None,  # use this cardset
         holdgame=0,  # hold this game on exit ?
         bookmark=None,  # goto this bookmark (load new cardset)
     )
     self.commandline = Struct(
         loadgame=None,  # load a game ?
         game=None,
         gameid=None,
         deal=None,
     )
     self.demo_counter = 0