本文整理汇总了Python中fofix.game.Dialogs.changeLoadingSplashScreenText方法的典型用法代码示例。如果您正苦于以下问题:Python Dialogs.changeLoadingSplashScreenText方法的具体用法?Python Dialogs.changeLoadingSplashScreenText怎么用?Python Dialogs.changeLoadingSplashScreenText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fofix.game.Dialogs
的用法示例。
在下文中一共展示了Dialogs.changeLoadingSplashScreenText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadLibrary
# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import changeLoadingSplashScreenText [as 别名]
def loadLibrary(self):
log.debug("Loading libraries in %s" % self.library)
self.loaded = False
self.tiersPresent = False
if self.splash:
Dialogs.changeLoadingSplashScreenText(self.engine, self.splash, _("Browsing Collection..."))
else:
self.splash = Dialogs.showLoadingSplashScreen(self.engine, _("Browsing Collection..."))
self.loadStartTime = time.time()
self.engine.resource.load(self, "libraries", lambda: song.getAvailableLibraries(self.engine, self.library), onLoad = self.loadSongs, synch = True)
示例2: loadItemLabel
# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import changeLoadingSplashScreenText [as 别名]
def loadItemLabel(self, i, preload=False):
# Load the item label if it isn't yet loaded
item = self.items[i]
if self.itemLabels[i] is None:
if isinstance(item, song.SongInfo):
# CD covers
if self.labelType == 1:
f = "label.png"
else:
f = "album.png"
if self.texturedLabels:
label = self.engine.resource.fileName(item.libraryNam, item.songName, f)
if os.path.exists(label):
self.itemLabels[i] = Texture(label)
else:
self.itemLabels[i] = False
else:
self.itemLabels[i] = self.engine.loadImgDrawing(None, "label", os.path.join(item.libraryNam, item.songName, f))
elif isinstance(item, song.LibraryInfo):
if self.texturedLabels:
label = self.engine.resource.fileName(item.libraryName, "label.png")
if os.path.exists(label):
self.itemLabels[i] = Texture(label)
else:
self.itemLabels[i] = False
else:
self.itemLabels[i] = self.engine.loadImgDrawing(None, "label", os.path.join(item.libraryName, "label.png"))
elif isinstance(item, song.RandomSongInfo):
self.itemLabels[i] = "Random"
else:
return
if preload:
if time.time() - self.loadStartTime > 3:
self.loadStartTime = time.time()
percent = (i * 100) / len(self.items)
Dialogs.changeLoadingSplashScreenText(self.engine, self.splash, _("Loading Album Artwork...") + " %d%%" % percent)
示例3: prepareSetlist
# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import changeLoadingSplashScreenText [as 别名]
#.........这里部分代码省略.........
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):
self.selectedIndex += 1
if self.selectedIndex >= len(self.items):
self.selectedIndex = 0
self.itemRenderAngles = [0.0] * len(self.items)
self.itemLabels = [None] * len(self.items)
if self.preloadSongLabels:
for i in range(len(self.items)):
self.loadStartTime = time.time()
Dialogs.changeLoadingSplashScreenText(self.engine, self.splash, _("Loading Album Artwork..."))
self.loadItemLabel(i, preload = True)
self.updateSelection()
Dialogs.hideLoadingSplashScreen(self.engine, self.splash)
self.splash = None
示例4: progressCallback
# 需要导入模块: from fofix.game import Dialogs [as 别名]
# 或者: from fofix.game.Dialogs import changeLoadingSplashScreenText [as 别名]
def progressCallback(self, percent):
if time.time() - self.loadStartTime > 7:
Dialogs.changeLoadingSplashScreenText(self.engine, self.splash, _("Browsing Collection...") + ' (%d%%)' % (percent*100))