本文整理汇总了Python中fofix.game.Dialogs.choosePartDiffs方法的典型用法代码示例。如果您正苦于以下问题:Python Dialogs.choosePartDiffs方法的具体用法?Python Dialogs.choosePartDiffs怎么用?Python Dialogs.choosePartDiffs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fofix.game.Dialogs
的用法示例。
在下文中一共展示了Dialogs.choosePartDiffs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: startGame
# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import choosePartDiffs [as 别名]
#.........这里部分代码省略.........
if part.id == 4 or part.id == 7:
drums.append(part)
elif part.id == 5:
vocals.append(part)
else:
guitars.append(part)
choose = [[] for i in self.players]
for i, player in enumerate(self.players):
j = self.engine.world.songQueue.getParts()[i]
if player.controlType == 2 or player.controlType == 3:
choose[i] = drums
elif player.controlType == 5:
choose[i] = vocals
else:
choose[i] = guitars
if self.queued:
showDialog = False
for i, player in enumerate(self.players):
if song.parts[j] in choose[i]:
p = song.parts[j]
elif self.queueParts == 0:
if j == 0:
for k in [3, 1, 2]:
if song.parts[k] in choose[i]:
p = song.parts[k]
break
elif j == 1:
for k in [2, 0, 3]:
if song.parts[k] in choose[i]:
p = song.parts[k]
break
elif j == 2:
for k in [1, 0, 3]:
if song.parts[k] in choose[i]:
p = song.parts[k]
break
elif j == 3:
for k in [0, 1, 2]:
if song.parts[k] in choose[i]:
p = song.parts[k]
break
j = self.engine.world.songQueue.getDiffs()[i]
if song.difficulties[j] in info.partDifficulties[p.id]:
d = song.difficulties[j]
elif self.queueDiffs == 0:
if j == 0:
for k in range(1,4):
if song.difficulties[k] in info.partDifficulties[p.id]:
d = song.difficulties[k]
elif j == 1:
for k in range(2,5):
if song.difficulties[k%4] in info.partDifficulties[p.id]:
d = song.difficulties[k%4]
elif j == 2:
if song.difficulties[3] in info.partDifficulties[p.id]:
d = song.difficulties[3]
else:
for k in range(1, -1, -1):
if song.difficulties[k] in info.partDifficulties[p.id]:
d = song.difficulties[k]
else:
for k in range(2, -1, -1):
if song.difficulties[k] in info.partDifficulties[p.id]:
d = song.difficulties[k]
elif self.queueDiffs == 1:
if j == 3:
for k in range(2,-1, -1):
if song.difficulties[k] in info.partDifficulties[p.id]:
d = song.difficulties[k]
elif j == 2:
for k in range(1,-2,-1):
if song.difficulties[k%4] in info.partDifficulties[p.id]:
d = song.difficulties[k%4]
elif j == 1:
if song.difficulties[0] in info.partDifficulties[p.id]:
d = song.difficulties[0]
else:
for k in range(2,4):
if song.difficulties[k] in info.partDifficulties[p.id]:
d = song.difficulties[k]
else:
for k in range(1,4):
if song.difficulties[k] in info.partDifficulties[p.id]:
d = song.difficulties[k]
if p and d:
player.part = p
player.difficulty = d
else:
showDialog = True
if showDialog:
ready = False
while not ready:
ready = Dialogs.choosePartDiffs(self.engine, choose, info, self.players)
if not ready and not self.queued and not self.engine.cmdPlay:
return False
if self.engine.cmdPlay > 0:
self.engine.cmdPlay = 3
self.freeResources()
self.engine.world.createScene("GuitarScene", libraryName = self.libraryName, songName = self.songName)
self.gameStarted = True