def addTreasureMapButtons(self, tm, buttonOffset): self.removeTreasureMapButtons() helpPos = (-0.26, 0, 0.095) if __debug__ and base.config.GetBool('enable-bp-solo', False): self.tmButtonQuick = GuiButton.GuiButton(parent=self, text=PLocalizer.PlayTMNow, text_align=TextNode.ACenter, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(0.0, -0.01), text_fg=PiratesGuiGlobals.TextFG1, text_shadow=PiratesGuiGlobals.TextShadow, text_wordwrap=40, image_scale=(0.45, 1, 0.24), command=self.startTreasureMap, extraArgs=[tm], pos=(0.3, 0, buttonOffset), helpText=PLocalizer.PlayTMNowHelp, helpPos=helpPos) searchPos = ( 0.775, 0, buttonOffset) else: searchPos = ( 0.55, 0, buttonOffset) self.tmButtonSearch = GuiButton.GuiButton(parent=self, text=PLocalizer.PlayTMLookout, text_align=TextNode.ACenter, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(0.0, -0.01), text_fg=PiratesGuiGlobals.TextFG1, text_shadow=PiratesGuiGlobals.TextShadow, text_wordwrap=40, image_scale=(0.45, 1, 0.24), command=self.startTreasureMap, extraArgs=[tm, False], pos=searchPos, helpText=PLocalizer.PlayTMLookoutHelp, helpPos=helpPos) if base.cr.teleportMgr.inInstanceType == PiratesGlobals.INSTANCE_TM: self.disableTreasureMapButtons() else: self.enableTreasureMapButtons()
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