当前位置: 首页>>代码示例>>Python>>正文


Python Dialogs.showMessage方法代码示例

本文整理汇总了Python中fofix.game.Dialogs.showMessage方法的典型用法代码示例。如果您正苦于以下问题:Python Dialogs.showMessage方法的具体用法?Python Dialogs.showMessage怎么用?Python Dialogs.showMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fofix.game.Dialogs的用法示例。


在下文中一共展示了Dialogs.showMessage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: shown

# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import showMessage [as 别名]
 def shown(self):
     self.engine.view.pushLayer(self.menu)
     shaders.checkIfEnabled()
     if not self.shownOnce:
         self.shownOnce = True
         if hasattr(sys, 'frozen'):
             # Check whether this is a release binary being run from an svn/git
             # working copy or whether this is an svn/git binary not being run
             # from an corresponding working copy.
             currentVcs, buildVcs = None, None
             if VFS.isdir('/gameroot/.git'):
                 currentVcs = 'git'
             elif VFS.isdir('/gameroot/src/.svn'):
                 currentVcs = 'Subversion'
             if 'git' in Version.version():
                 buildVcs = 'git'
             elif 'svn' in Version.version():
                 buildVcs = 'Subversion'
             if currentVcs != buildVcs:
                 if buildVcs is None:
                     msg = _('This binary release is being run from a %(currentVcs)s working copy. This is not the correct way to run FoFiX from %(currentVcs)s. Please see one of the following web pages to set your %(currentVcs)s working copy up correctly:') + \
                           '\n\nhttp://code.google.com/p/fofix/wiki/RunningUnderPython26' + \
                           '\nhttp://code.google.com/p/fofix/wiki/RequiredSourceModules'
                 else:
                     msg = _('This binary was built from a %(buildVcs)s working copy but is not running from one. The FoFiX Team will not provide any support whatsoever for this binary. Please see the following site for official binary releases:') + \
                           '\n\nhttp://code.google.com/p/fofix/'
                 Dialogs.showMessage(self.engine, msg % {'buildVcs': buildVcs, 'currentVcs': currentVcs})
开发者ID:arielenter,项目名称:fofix,代码行数:29,代码来源:MainMenu.py

示例2: showTutorial

# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import showMessage [as 别名]
    def showTutorial(self):
        # evilynux - Make sure tutorial exists before launching
        tutorialpath = self.engine.tutorialFolder
        if not os.path.isdir(self.engine.resource.fileName(tutorialpath)):
            log.debug("No folder found: %s" % tutorialpath)
            Dialogs.showMessage(self.engine, _("No tutorials found!"))
            return

        self.engine.startWorld(1, None, 0, 0, tutorial = True)

        self.launchLayer(lambda: Lobby(self.engine))
开发者ID:arielenter,项目名称:fofix,代码行数:13,代码来源:MainMenu.py

示例3: setNewKeyMapping

# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import showMessage [as 别名]
def setNewKeyMapping(engine, config, section, option, key):
    oldKey = config.get(section, option)
    config.set(section, option, key)
    keyCheckerMode = Config.get("game", "key_checker_mode")
    if key == "None" or key is None:
        return True
    b = isKeyMappingOK(config, option)
    if b != 0:
        if keyCheckerMode > 0:
            from fofix.game import Dialogs
            Dialogs.showMessage(engine, _("This key conflicts with the following keys: %s") % str(b))
        if keyCheckerMode == 2:   #enforce no conflicts!
            config.set(section, option, oldKey)
        return False
    return True
开发者ID:fofix,项目名称:fofix,代码行数:17,代码来源:Player.py

示例4: checkParts

# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import showMessage [as 别名]
 def checkParts(self):
     info = song.loadSongInfo(self.engine, self.songName, library = self.libraryName)
     guitars = []
     drums = []
     vocals = []
     for part in info.parts:
         if part.id == 4 or part.id == 7:
             drums.append(part)
         elif part.id == 5:
             vocals.append(part)
         else:
             guitars.append(part)
     if len(drums) == 0 and self.engine.input.gameDrums > 0:
         Dialogs.showMessage(self.engine, _("There are no drum parts in this song. Change your controllers to play."))
         return False
     if len(guitars) == 0 and self.engine.input.gameGuitars > 0:
         Dialogs.showMessage(self.engine, _("There are no guitar parts in this song. Change your controllers to play."))
         return False
     if len(vocals) == 0 and self.engine.input.gameMics > 0:
         Dialogs.showMessage(self.engine, _("There are no vocal parts in this song. Change your controllers to play."))
         return False
     return True
开发者ID:ME7ROPOLIS,项目名称:fofix,代码行数:24,代码来源:SongChoosingScene.py

示例5: saveCharacter

# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import showMessage [as 别名]
 def saveCharacter(self):
     pref = self.choices[0:8]
     pref.insert(7, self.neck)
     if len(self.choices[0]) > 0:
         if self.choices[0].lower() == "default":
             Dialogs.showMessage(self.engine, _("That is a terrible name. Choose something not 'default'"))
         elif self.choices[0].lower() not in self.invalidNames or self.choices[0] == self.player:
             Player.updatePlayer(self.player, pref)
             self.updatedName  = self.choices[0]
             if self.avatar is not None:
                 shutil.copy(self.engine.resource.fileName(self.avatar),os.path.join(self.engine.data.path,"users","players",self.choices[0]+".png"))
             if self.oldName:
                 if os.path.exists(self.engine.resource.fileName(os.path.join("users","players",self.oldName+".png"))) and self.oldName != self.choices[0]:
                     if self.avatar is None:
                         os.rename(self.engine.resource.fileName(os.path.join("users","players",self.oldName+".png")), os.path.join(self.engine.data.path,"users","players",self.choices[0]+".png"))
                     else:
                         os.remove(self.engine.resource.fileName(os.path.join("users","players",self.oldName+".png")))
             self.engine.view.popLayer(self)
             self.engine.input.removeKeyListener(self)
         else:
             Dialogs.showMessage(self.engine, _("That name already exists!"))
     else:
         Dialogs.showMessage(self.engine, _("Please enter a name!"))
开发者ID:ME7ROPOLIS,项目名称:fofix,代码行数:25,代码来源:Lobby.py

示例6: showMessages

# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import showMessage [as 别名]
 def showMessages(self):
     msg = self.engine.startupMessages.pop()
     self.showStartupMessages = False
     Dialogs.showMessage(self.engine, msg)
开发者ID:arielenter,项目名称:fofix,代码行数:6,代码来源:MainMenu.py

示例7: __init__

# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import showMessage [as 别名]
    def __init__(self, engine):
        if not engine.world:
            raise WorldNotStarted
        self.engine         = engine
        self.minPlayers     = self.engine.world.minPlayers
        self.maxPlayers     = self.engine.world.maxPlayers
        self.tutorial       = self.engine.world.tutorial
        self.gameMode       = self.engine.world.gameMode
        self.multiMode      = self.engine.world.multiMode
        self.time           = 0.0
        self.keyControl     = 0
        self.keyGrab        = False
        self.scrolling      = [0,0,0,0]
        self.rate           = [0,0,0,0]
        self.delay          = [0,0,0,0]
        self.scroller       = [0, self.scrollUp, self.scrollDown]
        self.gameStarted    = False
        self.done           = True
        self.active         = False
        self.blockedItems   = [1]
        self.selectedItems  = []
        self.blockedPlayers = []
        self.selectedPlayers = []
        self.playerList     = [None for i in range(4)]
        self.fullView     = self.engine.view.geometry[2:4]
        self.music        = True
        self.creator      = CreateCharacter(self.engine)

        #key vars
        self.fontDict         = self.engine.data.fontDict
        self.geometry         = self.engine.view.geometry[2:4]
        self.fontScreenBottom = self.engine.data.fontScreenBottom
        self.aspectRatio      = self.engine.view.aspectRatio
        self.drawStarScore    = self.engine.drawStarScore

        self.gameModeText = self.engine.world.gameName

        self.yes        = []
        self.no         = []
        self.conf       = []
        self.up         = []
        self.down       = []
        self.controls   = [j for j in self.engine.input.controls.controls]
        self.types      = []
        self.allowed    = [True for i in range(4)]
        for i, type in enumerate(self.engine.input.controls.type):
            self.types.append(type)
            if type in GUITARTYPES:
                if not self.engine.world.allowGuitar:
                    self.allowed[i] = False
                else:
                    self.yes.extend([Player.CONTROLS[i][Player.KEY1], Player.CONTROLS[i][Player.KEY1A], Player.CONTROLS[i][Player.START]])
                    self.no.extend([Player.CONTROLS[i][Player.KEY2], Player.CONTROLS[i][Player.KEY2A], Player.CONTROLS[i][Player.CANCEL]])
                    self.conf.extend([Player.CONTROLS[i][Player.KEY3], Player.CONTROLS[i][Player.KEY3A]])
                    self.up.extend([Player.CONTROLS[i][Player.ACTION1], Player.CONTROLS[i][Player.UP]])
                    self.down.extend([Player.CONTROLS[i][Player.ACTION2], Player.CONTROLS[i][Player.DOWN]])
            elif type in DRUMTYPES:
                if not self.engine.world.allowDrum:
                    self.allowed[i] = False
                else:
                    self.yes.extend([Player.CONTROLS[i][Player.DRUM5], Player.CONTROLS[i][Player.DRUM5A], Player.CONTROLS[i][Player.START]])
                    self.no.extend([Player.CONTROLS[i][Player.DRUM1], Player.CONTROLS[i][Player.DRUM1A], Player.CONTROLS[i][Player.CANCEL]])
                    self.conf.extend([Player.CONTROLS[i][Player.DRUMBASS], Player.CONTROLS[i][Player.DRUMBASSA]])
                    self.up.extend([Player.CONTROLS[i][Player.DRUM2], Player.CONTROLS[i][Player.DRUM2A], Player.CONTROLS[i][Player.UP]])
                    self.down.extend([Player.CONTROLS[i][Player.DRUM3], Player.CONTROLS[i][Player.DRUM3A], Player.CONTROLS[i][Player.DOWN]])
            elif type in MICTYPES:
                if not self.engine.world.allowMic:
                    self.allowed[i] = False
                else:
                    self.yes.extend([Player.CONTROLS[i][Player.START]])
                    self.no.extend([Player.CONTROLS[i][Player.CANCEL]])
                    self.up.extend([Player.CONTROLS[i][Player.UP]])
                    self.down.extend([Player.CONTROLS[i][Player.DOWN]])

        for i, control in enumerate(self.engine.input.controls.controls):
            if control == "None":
                self.controls[i] = _("No Controller")
                self.blockedPlayers.append(i)
            elif not self.allowed[i]:
                self.controls[i] = _("Disabled Controller")
                self.blockedPlayers.append(i)
            elif control == "defaultg":
                self.controls[i] = _("Default Guitar")
            elif control == "defaultd":
                self.controls[i] = _("Default Drums")
            elif control == "defaultm":
                self.controls[i] = _("Default Microphone")

        if 4 - len(self.blockedPlayers) < self.minPlayers:
            Dialogs.showMessage(self.engine, _("Your controls are not properly set up for this mode. Please check your settings."))
            #FIXME: Go back to the main menu (or the control menu) without screwing up the layers.
        self.engine.input.activeGameControls = [i for i in range(4) if i not in self.blockedPlayers]
        self.engine.input.pluginControls()
        self.panelOrder = range(4)
        self.oldOrder   = range(4)

        themename  = self.engine.data.themeLabel
        self.theme = self.engine.theme

        self.engine.data.loadAllImages(self, os.path.join("themes",themename,"lobby"))
#.........这里部分代码省略.........
开发者ID:ME7ROPOLIS,项目名称:fofix,代码行数:103,代码来源:Lobby.py

示例8: checkCmdPlay

# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import showMessage [as 别名]
 def checkCmdPlay(self):
     info = song.loadSongInfo(self.engine, self.songName, library = self.libraryName)
     guitars = []
     drums = []
     vocals = []
     autoPart = None
     for part in info.parts:
         if part.id == 4 or part.id == 7:
             drums.append(part)
         elif part.id == 5:
             vocals.append(part)
         else:
             guitars.append(part)
         if self.engine.cmdPlay == 2 and self.engine.cmdPart is not None and len(self.playerList) == 1:
             if self.engine.cmdPart == part.id:
                 log.debug("Command-line mode: Part found!")
                 if part.id == 4 and self.engine.input.gameDrums > 0:
                     autoPart = part.id
                 elif part.id == 5 and self.engine.input.gameMics > 0:
                     autoPart = part.id
                 elif self.engine.input.gameGuitars > 0:
                     autoPart = part.id
     if autoPart is None:
         if len(drums) == 0 and self.engine.input.gameDrums > 0:
             if self.splash:
                 Dialogs.hideLoadingSplashScreen(self.engine, self.splash)
                 self.splash = None
             Dialogs.showMessage(self.engine, _("There are no drum parts in this song. Change your controllers to play."))
             if self.engine.cmdPlay == 2:
                 self.engine.cmdPlay = 0
                 return False
         if len(guitars) == 0 and self.engine.input.gameGuitars > 0:
             if self.splash:
                 Dialogs.hideLoadingSplashScreen(self.engine, self.splash)
                 self.splash = None
             Dialogs.showMessage(self.engine, _("There are no guitar parts in this song. Change your controllers to play."))
             if self.engine.cmdPlay == 2:
                 self.engine.cmdPlay = 0
                 return False
         if len(vocals) == 0 and self.engine.input.gameMics > 0:
             if self.splash:
                 Dialogs.hideLoadingSplashScreen(self.engine, self.splash)
                 self.splash = None
             Dialogs.showMessage(self.engine, _("There are no vocal parts in this song. Change your controllers to play."))
             if self.engine.cmdPlay == 2:
                 self.engine.cmdPlay = 0
                 return False
     # Make sure the difficulty we chose is available
     p = self.playerList[0].part
     player = self.playerList[0]
     if self.engine.cmdDiff is not None:
         diff = song.difficulties[self.engine.cmdDiff]
         if diff in info.partDifficulties[p.id]:
             self.playerList[0].difficulty = diff
         else:
             self.playerList[0].difficulty = info.partDifficulties[p.id][0]
     else:
         if self.splash:
             Dialogs.hideLoadingSplashScreen(self.engine, self.splash)
             self.splash = None
         self.playerList[0].difficulty = Dialogs.chooseItem(self.engine, info.partDifficulties[p.id],
                               "%s \n %s" % (song.removeSongOrderPrefixFromName(info.name), _("%s Choose a difficulty:") % player.name), selected = player.difficulty)
     return True
开发者ID:ME7ROPOLIS,项目名称:fofix,代码行数:65,代码来源:SongChoosingScene.py

示例9: prepareSetlist

# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import showMessage [as 别名]
    def prepareSetlist(self, songs):
        if self.songLoader:
            self.songLoader.stop()
        msg = self.engine.setlistMsg
        self.engine.setlistMsg = None
        self.selectedIndex = 0
        if self.listingMode == 0 or self.careerMode:
            self.items = self.libraries + self.songs
        else:
            self.items = self.songs
        self.itemRenderAngles = [0.0]  * len(self.items)
        self.itemLabels       = [None] * len(self.items)
        self.searching        = False
        self.searchText       = ""

        shownItems = []
        for item in self.items: #remove things we don't want to see. Some redundancy, but that's okay.
            if isinstance(item, song.TitleInfo) or isinstance(item, song.SortTitleInfo):
                if self.showCareerTiers == 2:
                    if isinstance(item, song.TitleInfo):
                        if len(shownItems) > 0:
                            if isinstance(shownItems[-1], song.TitleInfo):
                                shownItems.pop()
                        shownItems.append(item)
                    elif isinstance(item, song.SortTitleInfo):
                        continue
                else:
                    if isinstance(item, song.TitleInfo):
                        continue
                    elif isinstance(item, song.SortTitleInfo):
                        if not self.showSortTiers:
                            continue
                        if len(shownItems) > 0:
                            if isinstance(shownItems[-1], song.SortTitleInfo):
                                shownItems.pop()
                        shownItems.append(item)
            elif isinstance(item, song.SongInfo):
                if self.careerMode and (not self.showLockedSongs) and item.getLocked():
                    continue
                else:
                    shownItems.append(item)
            else:
                shownItems.append(item)
        if len(shownItems) > 0:
            if isinstance(shownItems[-1], song.TitleInfo) or isinstance(shownItems[-1], song.SortTitleInfo):
                shownItems.pop()

        if len(self.items) > 0 and len(shownItems) == 0:
            msg = _("No songs in this setlist are available to play!")
            if self.careerMode:
                msg = msg + " " + _("Make sure you have a working career pack!")
            Dialogs.showMessage(self.engine, msg)
        elif len(shownItems) > 0:
            for item in shownItems:
                if isinstance(item, song.SongInfo) or isinstance(item, song.LibraryInfo):
                    self.items = shownItems #make sure at least one item is selectable
                    break
            else:
                msg = _("No songs in this setlist are available to play!")
                if self.careerMode:
                    msg = msg + " " + _("Make sure you have a working career pack!")
                Dialogs.showMessage(self.engine, msg)
                self.items = []

        if self.items == []:    #MFH: Catch when there ain't a damn thing in the current folder - back out!
            if self.library != song.DEFAULT_LIBRARY:
                Dialogs.hideLoadingSplashScreen(self.engine, self.splash)
                self.splash = None
                self.startingSelected = self.library
                self.library     = os.path.dirname(self.library)
                self.selectedItem = None
                self.loadLibrary()
                return

        log.debug("Setlist loaded.")

        self.loaded           = True

        if self.setlistStyle == 1:
            for i in range(self.headerSkip):
                self.items.insert(0, song.BlankSpaceInfo())
            for i in range(self.footerSkip):
                self.items.append(song.BlankSpaceInfo())

        if self.startingSelected is not None:
            for i, item in enumerate(self.items):
                if isinstance(item, song.SongInfo) and self.startingSelected == item.songName: #TODO: SongDB
                    self.selectedIndex =  i
                    break
                elif isinstance(item, song.LibraryInfo) and self.startingSelected == item.libraryName:
                    self.selectedIndex =  i
                    break

        for item in self.items:
            if isinstance(item, song.SongInfo):
                item.name = song.removeSongOrderPrefixFromName(item.name) #TODO: I don't like this.
            elif not self.tiersPresent and (isinstance(item, song.TitleInfo) or isinstance(item, song.SortTitleInfo)):
                self.tiersPresent = True

        while isinstance(self.items[self.selectedIndex], song.BlankSpaceInfo) or ((isinstance(self.items[self.selectedIndex], song.TitleInfo) or isinstance(self.items[self.selectedIndex], song.SortTitleInfo)) and not self.selectTiers):
#.........这里部分代码省略.........
开发者ID:ME7ROPOLIS,项目名称:fofix,代码行数:103,代码来源:SongChoosingScene.py


注:本文中的fofix.game.Dialogs.showMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。