本文整理汇总了Python中fofix.game.Dialogs.chooseItem方法的典型用法代码示例。如果您正苦于以下问题:Python Dialogs.chooseItem方法的具体用法?Python Dialogs.chooseItem怎么用?Python Dialogs.chooseItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fofix.game.Dialogs
的用法示例。
在下文中一共展示了Dialogs.chooseItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: deleteCharacter
# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import chooseItem [as 别名]
def deleteCharacter(self):
tsYes = _("Yes")
q = Dialogs.chooseItem(self.engine, [tsYes, _("No")], _("Are you sure you want to delete this player?"))
if q == tsYes:
if self.player:
Player.deletePlayer(self.player)
self.engine.view.popLayer(self)
self.engine.input.removeKeyListener(self)
示例2: checkCmdPlay
# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import chooseItem [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