def __UpdateQuestClock(self): if "QUEST" == self.state: # QUEST_LIMIT_COUNT_BUG_FIX for i in xrange(min(quest.GetQuestCount(), quest.QUEST_MAX_NUM)): # END_OF_QUEST_LIMIT_COUNT_BUG_FIX (lastName, lastTime) = quest.GetQuestLastTime(i) clockText = localeInfo.QUEST_UNLIMITED_TIME if len(lastName) > 0: if lastTime <= 0: clockText = localeInfo.QUEST_TIMEOVER else: questLastMinute = lastTime / 60 questLastSecond = lastTime % 60 clockText = lastName + " : " if questLastMinute > 0: clockText += str(questLastMinute) + localeInfo.QUEST_MIN if questLastSecond > 0: clockText += " " if questLastSecond > 0: clockText += str(questLastSecond) + localeInfo.QUEST_SEC self.questLastTimeList[i].SetText(clockText)
def OnQuestScroll(self): questCount = quest.GetQuestCount() scrollLineCount = max(0, questCount - quest.QUEST_MAX_NUM) startIndex = int(scrollLineCount * self.questScrollBar.GetPos()) if startIndex != self.questShowingStartIndex: self.questShowingStartIndex = startIndex self.RefreshQuest()
def RefreshQuest(self): if self.isLoaded == 0: return questCount = quest.GetQuestCount() questRange = range(quest.QUEST_MAX_NUM) if questCount > quest.QUEST_MAX_NUM: self.questScrollBar.Show() else: self.questScrollBar.Hide() for i in questRange[:questCount]: (questName, questIcon, questCounterName, questCounterValue ) = quest.GetQuestData(self.questShowingStartIndex + i) self.questNameList[i].SetText(questName) self.questNameList[i].Show() self.questLastCountList[i].Show() self.questLastTimeList[i].Show() if len(questCounterName) > 0: self.questLastCountList[i].SetText( "%s : %d" % (questCounterName, questCounterValue)) else: self.questLastCountList[i].SetText("") ## Icon self.questSlot.SetSlot(i, i, 1, 1, questIcon) for i in questRange[questCount:]: self.questNameList[i].Hide() self.questLastTimeList[i].Hide() self.questLastCountList[i].Hide() self.questSlot.ClearSlot(i) self.questSlot.HideSlotBaseImage(i) self.__UpdateQuestClock()