def presentQuestGiven(self, quest): self.resetBranch = None if self.resetBranch: container = localAvatar.questStatus.getContainer(quest.getQuestId()) if container.parent and container.parent.getFirstQuestId() == quest.getQuestId(): self.presentBranchReset(False) return None else: self.resetBranch = None def handleOption(option): if len(localAvatar.currentStoryQuests): self.cleanUpQuestDetails(hide = True) while len(localAvatar.currentStoryQuests) and localAvatar.currentStoryQuests[0].getGiverId() != self.uniqueId: localAvatar.currentStoryQuests.remove(localAvatar.currentStoryQuests[0]) if len(localAvatar.currentStoryQuests): storyQuest = localAvatar.currentStoryQuests[0] self.presentQuestGiven(storyQuest) localAvatar.currentStoryQuests.remove(storyQuest) elif hasattr(quest, 'questDNA') and quest.questDNA.getTimeLimit(): quest.startTimer() self._DistributedQuestGiver__handleDoneChatPage(0) self.questDetailGUI = QuestDetailGUI(None, None, quest) self.questDetailGUI.showPanel() localAvatar.guiMgr.subtitler.setPageChat('', options = [ PLocalizer.Accept], callback = handleOption) base.questdet = self.questDetailGUI self.ignore('doneChatPage')
def displayBranchDetails(offer): self.selectedOffer = offer self.cleanUpQuestDetails() self.questDetailGUI = QuestDetailGUI(offer, None) self.questDetailGUI.showPanel() base.questdet = self.questDetailGUI return
def displayBranchDetails(offer): self.selectedOffer = offer self.cleanUpQuestDetails() self.questDetailGUI = QuestDetailGUI(offer, None) self.questDetailGUI.showPanel() base.questdet = self.questDetailGUI subtitleOptions = [ PLocalizer.Accept] if declineOption: subtitleOptions = [ PLocalizer.Decline, PLocalizer.Accept] localAvatar.guiMgr.subtitler.setPageChat('Is that your choice?', options = subtitleOptions, callback = handleBranchOption)
def presentQuestReset(self): if not self.resetQuest: return None def handleOption(option): if option == PLocalizer.Accept: self.resetQuest.startTimer() self.resetQuest = None self._DistributedQuestGiver__handleDoneChatPage(0) self.questDetailGUI = QuestDetailGUI(None, None, self.resetQuest.questDNA) self.questDetailGUI.showPanel() localAvatar.guiMgr.subtitler.setPageChat('', options = [ PLocalizer.Accept], callback = handleOption)
def __init__(self): InventoryPage.InventoryPage.__init__(self) self.initialiseoptions(QuestPage) self.detailId = None self.titleBorder = BorderFrame.BorderFrame(parent=self, frameSize=(-0.02, 0.97, -0.02, 0.56)) self.titleBorder.setPos(0.065, 0, -0.01) self.titleBorder.background.setColor(0, 0, 0, 1) self.titleBorder.resetDecorations() self.titleList = QuestTitleList.QuestTitleList() self.titleList.reparentTo(self.titleBorder) self.titleList.setPos(0.005, 0, 0) self.detailFrame = QuestDetailGUI(parent=self, pos=(0.54, 0, 1.006)) self.dropButton = GuiButton.GuiButton(parent=self, state=DGG.DISABLED, text=PLocalizer.DropQuest, textMayChange=0, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(0, -0.014), pos=(0.91, 0, 0.605), image=GuiButton.GuiButton.redGenericButton, image_scale=0.6, command=self.dropQuest, helpText=PLocalizer.DropQuestHelp, helpDelay=PiratesGuiGlobals.HelpPopupTime, helpPos=(-0.335, 0, 0.125)) gui = loader.loadModel('models/gui/compass_main') objectiveGrey = gui.find('**/icon_objective_grey') self.trackButton = GuiButton.GuiButton(parent=self, state=DGG.DISABLED, text=PLocalizer.TrackQuest, textMayChange=0, text_pos=(0.035, -0.014), text_scale=PiratesGuiGlobals.TextScaleLarge, pos=(0.66, 0, 0.605), command=self.trackQuest, helpText=PLocalizer.TrackQuestHelp, helpDelay=PiratesGuiGlobals.HelpPopupTime, helpPos=(-0.08, 0, 0.125), image=GuiButton.GuiButton.redGenericButton, image_scale=0.6, geom=objectiveGrey, geom_color=Vec4(1, 1, 0, 1), geom_scale=0.2, geom_pos=(-0.07, 0, -0.002)) self.specialInfoPanel = {} self.specialButton = GuiButton.GuiButton(parent=self, state=DGG.NORMAL, text='', textMayChange=1, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(0, -0.014), pos=(0.17, 0, 0.605), image=GuiButton.GuiButton.redGenericButton, image_scale=0.6, command=self.showSpecialInfo, helpText=PLocalizer.DropQuestHelp, helpDelay=PiratesGuiGlobals.HelpPopupTime, helpPos=(-0.335, 0, 0.125)) self.specialButton.hide() self.accept('questGuiSelect', self.showQuestDetails) self.accept('localAvatarQuestComplete', self.updateQuestDetails) self.accept('localAvatarQuestUpdate', self.updateQuestDetails) self.accept('localAvatarQuestItemUpdate', self.updateQuestDetails) self.accept('inventoryAddDoId-%s-%s' % (localAvatar.getInventoryId(), InventoryCategory.QUESTS), self.updateQuestTitlesNewQuest) self.accept('inventoryRemoveDoId-%s-%s' % (localAvatar.getInventoryId(), InventoryCategory.QUESTS), self.updateQuestTitles) self.invRequest = None self.tmButtonQuick = None self.tmButtonSearch = None self.tmReadyDialog = None return
def showDialogQuestOffer(self): if self.dialogQuestOffer: self.questDetailGUI = QuestDetailGUI(self.dialogQuestOffer, None) self.questDetailGUI.showPanel()
def displayQuestDetails(offer): self.questDetailGUI = QuestDetailGUI(offer, None) self.questDetailGUI.showPanel() base.questdet = self.questDetailGUI