def __init__(self, inventory, name, **kw): optiondefs = (('relief', None, None), ('framSize', (0, self.width, 0, self.height), None), ('sortOrder', 20, None)) self.defineoptions(kw, optiondefs) DirectFrame.__init__(self, None, **None) self.initialiseoptions(MusicianGUI) if not MusicianGUI.CoinImage: MusicianGUI.CoinImage = loader.loadModel( 'models/gui/toplevel_gui').find('**/treasure_w_coin*') self.panel = GuiPanel.GuiPanel(name, self.width, self.height, parent=self) self.panel.closeButton['command'] = self.closePanel self.setPos(-0.59999999999999998, 0, -0.66000000000000003) self.balance = 0 self.inventory = inventory self.storeInventory = InventoryItemList.InventoryItemList( self.inventory, self.height - 0.14999999999999999, buy=PiratesGuiGlobals.InventoryAdd, listItemClass=SongItemGui) self.storeInventory.reparentTo(self.panel) self.storeInventory.setPos(0.029999999999999999, 0, 0.040000000000000001) self.cartWidth = self.columnWidth - 0.10000000000000001 self.cartHeight = self.height - 0.25 self.cartFrame = DirectFrame(parent=self.panel, relief=None, frameSize=(0, self.cartWidth, 0, self.cartHeight)) self.cartFrame.setPos(self.columnWidth + 0.025000000000000001, 0, 0.080000000000000002) self.myGoldTitle = DirectFrame( parent=self.cartFrame, relief=None, text=PLocalizer.YourMoney, text_fg=PiratesGuiGlobals.TextFG2, text_align=TextNode.ALeft, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(0.0, 0.0), pos=(0.01, 0, 0.155)) self.myGold = DirectFrame(parent=self.cartFrame, relief=None, text=str(localAvatar.getMoney()), text_fg=PiratesGuiGlobals.TextFG2, text_align=TextNode.ARight, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(-0.055, 0.0), textMayChange=1, image=MusicianGUI.CoinImage, image_scale=0.14999999999999999, image_pos=(-0.025000000000000001, 0, 0.025000000000000001), pos=(self.cartWidth, 0, 0.155)) self.accept(PiratesGuiGlobals.InventoryBuyEvent, self.handleBuyItem) self.acceptOnce('escape', self.closePanel)
def __init__(self, inventory, name, **kw): optiondefs = ( ('relief', None, None), ('framSize', (0, self.width, 0, self.height), None), ('sortOrder', 20, None)) self.defineoptions(kw, optiondefs) DirectFrame.__init__(self, None, **kw) self.initialiseoptions(StoreGUI) if not StoreGUI.CoinImage: StoreGUI.CoinImage = loader.loadModel('models/gui/toplevel_gui').find('**/treasure_w_coin*') if not StoreGUI.WeaponIcons: StoreGUI.WeaponIcons = loader.loadModel('models/gui/gui_icons_weapon') if not StoreGUI.SkillIcons: StoreGUI.SkillIcons = loader.loadModel('models/textureCards/skillIcons') if not StoreGUI.FishingIcons: StoreGUI.FishingIcons = loader.loadModel('models/textureCards/fishing_icons') self.backTabParent = self.attachNewNode('backTabs', sort=0) self.panel = GuiPanel.GuiPanel(name, self.width, self.height, parent=self) self.panel.closeButton['command'] = self.closePanel self.setPos(-1.1, 0, -0.66) self.balance = 0 self.inventory = inventory self.storeInventory = InventoryItemList.InventoryItemList(self.inventory, self.height - 0.15, buy=PiratesGuiGlobals.InventoryAdd) self.storeInventory.reparentTo(self.panel) self.storeInventory.setPos(0.03, 0, 0.04) self.storeInventory.sortByTypeAndLevel() self.cartWidth = self.columnWidth - 0.1 self.cartHeight = self.height - 0.25 self.cartFrame = DirectFrame(parent=self.panel, relief=None, frameSize=(0, self.cartWidth, 0, self.cartHeight)) self.cartFrame.setPos(self.columnWidth + 0.025, 0, 0.08) self.purchaseTitle = DirectFrame(parent=self.cartFrame, relief=None, text=PLocalizer.PurchaseCart, text_fg=PiratesGuiGlobals.TextFG1, text_align=TextNode.ACenter, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(0.0, -0.03), textMayChange=0, pos=(self.cartWidth / 2, 0, self.cartHeight)) self.purchaseInventory = PurchaseList.PurchaseList([], self.cartHeight - 0.25, buy=PiratesGuiGlobals.InventoryRemove) self.purchaseInventory.reparentTo(self.cartFrame) self.purchaseInventory.setPos(0, 0, 0.2) self.frontTabParent = self.panel.attachNewNode('frontTab', sort=2) self.balanceTitle = DirectFrame(parent=self.cartFrame, relief=None, text=PLocalizer.Total, text_fg=PiratesGuiGlobals.TextFG2, text_align=TextNode.ALeft, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(0.0, 0.0), pos=(0.01, 0, 0.225)) self.balanceValue = DirectFrame(parent=self.cartFrame, relief=None, text=str(self.balance), text_fg=PiratesGuiGlobals.TextFG2, text_align=TextNode.ARight, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(-0.055, 0.0), textMayChange=1, image=StoreGUI.CoinImage, image_scale=0.15, image_pos=(-0.025, 0, 0.025), pos=(self.cartWidth, 0, 0.225)) self.myGoldTitle = DirectFrame(parent=self.cartFrame, relief=None, text=PLocalizer.YourMoney, text_fg=PiratesGuiGlobals.TextFG2, text_align=TextNode.ALeft, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(0.0, 0.0), pos=(0.01, 0, 0.155)) self.myGold = DirectFrame(parent=self.cartFrame, relief=None, text=str(localAvatar.getMoney()), text_fg=PiratesGuiGlobals.TextFG2, text_align=TextNode.ARight, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(-0.055, 0.0), textMayChange=1, image=StoreGUI.CoinImage, image_scale=0.15, image_pos=(-0.025, 0, 0.025), pos=(self.cartWidth, 0, 0.155)) self.commitButton = GuiButton.GuiButton(command=self.handleCommitPurchase, parent=self.cartFrame, text=PLocalizer.PurchaseCommit, text_fg=PiratesGuiGlobals.TextFG2, text_pos=(0, -PiratesGuiGlobals.TextScaleLarge * 0.25), text_scale=PiratesGuiGlobals.TextScaleLarge, pos=(self.width - 0.2, 0, 0.075)) self.commitButton.setPos(self.cartWidth / 2, 0, 0.05) self.initTabs() self.updateBalance() self.accept(getCategoryChangeMsg(localAvatar.getInventoryId(), InventoryType.ItemTypeMoney), self.updateBalance) self.accept(PiratesGuiGlobals.InventoryBuyEvent, self.handleBuyItem) base.localAvatar.guiMgr.setIgnoreEscapeHotKey(True) self.acceptOnce('escape', self.closePanel) return
def __init__(self, inventory, name, **kw): optiondefs = (('relief', None, None), ('framSize', (0, self.width, 0, self.height), None), ('sortOrder', 20, None)) self.defineoptions(kw, optiondefs) DirectFrame.__init__(self, None, **kw) self.initialiseoptions(StowawayGUI) if not StowawayGUI.CoinImage: StowawayGUI.CoinImage = loader.loadModel( 'models/gui/toplevel_gui').find('**/treasure_w_coin*') if not StowawayGUI.CrateShutSound: StowawayGUI.CrateShutSound = loadSfx( SoundGlobals.SFX_STOWAWAY_CRATE_SHUT) self.panel = GuiPanel.GuiPanel(name, self.width, self.height, parent=self) self.panel.closeButton['command'] = self.closePanel self.setPos(-0.8, 0, -0.66) self.balance = 0 self.inventory = inventory self.storeInventory = InventoryItemList.InventoryItemList( self.inventory, self.height - 0.15, buy=PiratesGuiGlobals.InventoryAdd, listItemClass=StowawayItemGui) self.storeInventory.reparentTo(self.panel) self.storeInventory.setPos(0.03, 0, 0.04) self.myGoldTitle = DirectFrame( parent=self.panel, relief=None, text=PLocalizer.YourMoney, text_fg=PiratesGuiGlobals.TextFG2, text_align=TextNode.ALeft, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(0.0, 0.0), pos=(0.1, 0, 0.155)) self.myGold = DirectFrame(parent=self.myGoldTitle, relief=None, text=str(localAvatar.getMoney()), text_fg=PiratesGuiGlobals.TextFG2, text_align=TextNode.ARight, text_scale=PiratesGuiGlobals.TextScaleLarge, text_pos=(-0.055, 0.0), textMayChange=1, image=StowawayGUI.CoinImage, image_scale=0.15, image_pos=(-0.025, 0, 0.025), pos=(0.4, 0, 0)) self.accept(PiratesGuiGlobals.InventoryBuyEvent, self.handleBuyItem) self.acceptOnce('escape', self.closePanel) return
def enterNoSecretChatAtAll(self): if self.noSecretChatAtAll == None: offX = -0.75 offZ = -0.45000000000000001 self.noSecretChatAtAll = GuiPanel.GuiPanel('Secret Codes!!! Arg!!', 1.6000000000000001, 1.2) self.noSecretChatAtAll.setPos(offX, 0, offZ) DirectLabel(parent = self.noSecretChatAtAll, relief = None, pos = (-offX, 0, 0.94999999999999996), text_fg = (0.90000000000000002, 0.90000000000000002, 0.90000000000000002, 1), text = OTPLocalizer.NoSecretChatAtAllTitle, textMayChange = 0, text_scale = 0.080000000000000002) DirectLabel(parent = self.noSecretChatAtAll, relief = None, pos = (-offX, 0, 0.80000000000000004), text_fg = (0.90000000000000002, 0.90000000000000002, 0.90000000000000002, 1), text = PLocalizer.NoSecretChatAtAll, text_wordwrap = 20, textMayChange = 0, text_scale = 0.070000000000000007) def handleNoSecretChatAtAllOK(value): self.fsm.request('mainMenu') DirectButton(self.noSecretChatAtAll, relief = None, text_fg = (0.90000000000000002, 0.90000000000000002, 0.90000000000000002, 1), text = OTPLocalizer.NoSecretChatAtAllOK, text_scale = 0.050000000000000003, text_pos = (0.0, -0.10000000000000001), textMayChange = 0, pos = (-offX, 0.0, 0.14999999999999999), command = handleNoSecretChatAtAllOK) self.noSecretChatAtAll.show()
def enter(self): StateData.StateData.enter(self) base.localAvatar.chatMgr.fsm.request('otherDialog') if self.dialog == None: charGui = loader.loadModel('models/gui/char_gui') buttonImage = (charGui.find('**/chargui_text_block_large'), charGui.find('**/chargui_text_block_large_down'), charGui.find('**/chargui_text_block_large_over')) self.dialog = GuiPanel.GuiPanel('Secret Codes!!! Arg!!', 1.6, 1.2, False) offX = -0.75 offZ = -0.45 self.dialog.setPos(offX, 0, offZ) okPos = ( -0.22 - offX, 0.0, -0.3 - offZ) cancelPos = (0.2 - offX, 0.0, -0.3 - offZ) textPos = (0, 0.25) okCommand = self.__handleOK DirectButton(self.dialog, image=buttonImage, image_scale=(0.4, 1, 0.4), relief=None, text=OTPLocalizer.FriendSecretNeedsPasswordWarningOK, text_fg=PiratesGuiGlobals.TextFG2, text_scale=0.05, text_pos=(0.0, -0.01), textMayChange=0, pos=okPos, command=okCommand) DirectLabel(parent=self.dialog, relief=None, pos=(0 - offX, 0, 0.55 - offZ), text=OTPLocalizer.FriendSecretNeedsPasswordWarningTitle, text_fg=PiratesGuiGlobals.TextFG2, textMayChange=0, text_scale=0.08) if base.cr.productName != 'Terra-DMC': self.usernameLabel = DirectLabel(parent=self.dialog, relief=None, pos=(-0.07 - offX, 0.0, 0.1 - offZ), text=OTPLocalizer.ParentLogin, text_fg=PiratesGuiGlobals.TextFG2, text_scale=0.06, text_align=TextNode.ARight, textMayChange=0) self.usernameEntry = DirectEntry(parent=self.dialog, relief=None, text_fg=PiratesGuiGlobals.TextFG2, scale=0.064, pos=(0.0 - offX, 0.0, 0.1 - offZ), width=OTPGlobals.maxLoginWidth, numLines=1, focus=1, cursorKeys=1, obscured=1, suppressKeys=1, command=self.__handleUsername) self.passwordLabel = DirectLabel(parent=self.dialog, relief=None, pos=(-0.07 - offX, 0.0, -0.1 - offZ), text=OTPLocalizer.ParentPassword, text_fg=PiratesGuiGlobals.TextFG2, text_scale=0.06, text_align=TextNode.ARight, textMayChange=0) self.passwordEntry = DirectEntry(parent=self.dialog, relief=None, text_fg=PiratesGuiGlobals.TextFG2, scale=0.064, pos=(0.0 - offX, 0.0, -0.1 - offZ), width=OTPGlobals.maxLoginWidth, numLines=1, focus=1, cursorKeys=1, obscured=1, suppressKeys=1, command=self.__handleOK) DirectButton(self.dialog, image=buttonImage, image_scale=(0.4, 1, 0.4), relief=None, text=OTPLocalizer.FriendSecretNeedsPasswordWarningCancel, text_scale=0.05, text_pos=(0.0, -0.01), textMayChange=1, text_fg=PiratesGuiGlobals.TextFG2, pos=cancelPos, command=self.__handleCancel) self.usernameEntry['focus'] = 1 self.usernameEntry.enterText('') charGui.removeNode() else: self.dialog['text'] = OTPLocalizer.FriendSecretNeedsParentLoginWarning if self.usernameEntry: self.usernameEntry['focus'] = 1 self.usernameEntry.enterText('') else: if self.passwordEntry: self.passwordEntry['focus'] = 1 self.passwordEntry.enterText('') self.dialog.show() return
def __init__(self, gameObject=None): base.loadingScreen.beginStep('LegendaryGameGUI', 4, 20) self.gameObject = gameObject self.guiImage = loader.loadModel( 'models/minigames/pir_m_gam_fsh_legendaryGui') self.UICompoments = {} self.uiBaseNode = NodePath('baseNode') self.uiBaseNode.reparentTo(aspect2d) self.uiBaseNode.show() self.leftBaseNode = NodePath('leftBaseNode') self.leftBaseNode.reparentTo(base.a2dLeftCenter) self.leftBaseNode.show() self.fishActor = None self.actorAnim = {} self.scaleSize = { InventoryType.Collection_Set11_Part1: 0.059999999999999998, InventoryType.Collection_Set11_Part2: 0.055, InventoryType.Collection_Set11_Part3: 0.12, InventoryType.Collection_Set11_Part4: 0.086999999999999994, InventoryType.Collection_Set11_Part5: 0.080000000000000002 } self.meterFrame = DirectFrame( parent=self.leftBaseNode, frameSize=(-0.29999999999999999, 0.29999999999999999, -1.0, 0.0), frameColor=(1.0, 1.0, 1.0, 0.0), relief=None, state=DGG.DISABLED, pos=(1.0, 0.0, -0.45000000000000001), hpr=(0, 0, 0), scale=(1.3, 0.0, 1.3), image=self.guiImage.find('**/pir_t_gui_fsh_meter'), image_scale=(0.20000000000000001, 0.0, 0.80000000000000004), image_pos=(0, 0, 0), text='', textMayChange=1, text_scale=PiratesGuiGlobals.TextScaleTitleLarge, text_pos=(-0.55000000000000004, 0.10000000000000001), text_shadow=PiratesGuiGlobals.TextShadow) self.UICompoments['meterFrame'] = self.meterFrame self.fishingRod = DirectFrame( parent=self.meterFrame, frameSize=(-0.29999999999999999, 0.29999999999999999, -1.0, 0.0), relief=None, state=DGG.DISABLED, pos=FishingGlobals.fishingRodScreenPosition, image=self.guiImage.find('**/pir_t_gui_fsh_fullRod'), image_scale=(1.0, 0.0, 0.125), image_pos=(0.20000000000000001, 0, 0)) self.fishingRod.setR(FishingGlobals.fishingRodInitSlope) self.UICompoments['fishingRod'] = self.fishingRod base.loadingScreen.tick() self.fishingHandleBaseFrame = DirectFrame( parent=self.uiBaseNode, frameSize=(-0.29999999999999999, 0.29999999999999999, -1.5, 1.5), frameColor=(1.0, 1.0, 1.0, 0.0), relief=None, state=DGG.DISABLED, pos=(0.0, 0.0, 0.0), hpr=(0, 0, 0), scale=(0.71999999999999997, 0.0, 0.71999999999999997), image=self.guiImage.find('**/pir_t_gui_fsh_partialRod'), image_scale=(3.7999999999999998, 0.0, 1.8999999999999999), image_pos=(0, 0, 0), image_hpr=(0.0, 0.0, 0)) self.fishingHandleBaseFrame.hide() self.UICompoments[ 'fishingHandleBaseFrame'] = self.fishingHandleBaseFrame self.fishingHandle = DirectFrame( parent=self.fishingHandleBaseFrame, frameSize=(-0.080000000000000002, 0.080000000000000002, -0.20000000000000001, 0.20000000000000001), relief=None, state=DGG.DISABLED, pos=(-0.10000000000000001, 0.0, -0.050000000000000003), hpr=(0, 0, 0), image=self.guiImage.find('**/pir_t_gui_fsh_handleArm'), image_scale=(1.0, 0.0, 1.0), image_pos=(-0.042000000000000003, 0, -0.115), image_hpr=(0.0, 0.0, 0)) self.UICompoments['fishingHandle'] = self.fishingHandle self.arrowImage = DirectFrame( parent=self.fishingHandleBaseFrame, frameSize=(-0.40000000000000002, 0.40000000000000002, -0.40000000000000002, 0.40000000000000002), relief=None, state=DGG.DISABLED, pos=(0.0, 0.0, 0.0), hpr=(0, 0, 0), scale=(1.2, 0.0, 1.2), image=self.guiImage.find('**/pir_t_gui_fsh_arrow'), image_scale=(1.0, 0.0, 1.0), image_pos=(0.0, 0, 0.0), image_hpr=(0.0, 0.0, 0.0)) self.arrowImage.hide() self.UICompoments['arrowImage'] = self.arrowImage btnGeom = (self.guiImage.find('**/pir_t_gui_fsh_handle'), self.guiImage.find('**/pir_t_gui_fsh_handle'), self.guiImage.find('**/pir_t_gui_fsh_handleOn')) self.fishingHandleButton = GuiButton(pos=(-0.29999999999999999, 0, -0.55000000000000004), hpr=(0, 0, 0), scale=0.45000000000000001, image=btnGeom, image_pos=(0, 0, 0), image_scale=1.0, sortOrder=2) self.fishingHandleButton.bind(DGG.B1PRESS, self.handleButtonClicked) self.fishingHandleButton.reparentTo(self.fishingHandle) self.UICompoments['fishingHandleButton'] = self.fishingHandleButton self.fishingHandleBaseFrame.setTransparency(TransparencyAttrib.MAlpha) self.meterFrame.setTransparency(TransparencyAttrib.MAlpha) self.lineOneTransitTextNode = TextNode('lineOneTransitText') self.lineOneTransitTextNode.setFont(PiratesGlobals.getPirateFont()) self.lineOneTransitTextNode.setText('') self.lineOneTransitTextNode.setAlign(TextNode.ACenter) self.lineOneTransitTextNode.setTextColor(1.0, 1.0, 1.0, 0.5) self.lineOneTransitTextNodePath = NodePath(self.lineOneTransitTextNode) self.lineOneTransitTextNodePath.setPos(0.0, 0.0, -0.80000000000000004) self.lineOneTransitTextNodePath.setScale(0.34999999999999998, 0.34999999999999998, 0.34999999999999998) self.lineOneTransitTextNodePath.reparentTo(self.uiBaseNode) self.lineOneTransitTextNodePath.hide() self.UICompoments[ 'lineOneTransitText'] = self.lineOneTransitTextNodePath self.lineTwoTransitTextNode = TextNode('lineTwoTransitText') self.lineTwoTransitTextNode.setFont(PiratesGlobals.getPirateFont()) self.lineTwoTransitTextNode.setText('') self.lineTwoTransitTextNode.setAlign(TextNode.ACenter) self.lineTwoTransitTextNode.setTextColor(1.0, 1.0, 1.0, 0.5) self.lineTwoTransitTextNodePath = NodePath(self.lineTwoTransitTextNode) self.lineTwoTransitTextNodePath.setPos(-0.40000000000000002, 0.0, -0.94999999999999996) self.lineTwoTransitTextNodePath.setScale(0.12, 0.12, 0.12) self.lineTwoTransitTextNodePath.reparentTo(self.uiBaseNode) self.lineTwoTransitTextNodePath.hide() self.UICompoments[ 'lineTwoTransitText'] = self.lineTwoTransitTextNodePath base.loadingScreen.tick() self.test_guiImage = loader.loadModel('models/gui/toplevel_gui') self.buttonIcon = ( self.test_guiImage.find('**/treasure_chest_closed'), self.test_guiImage.find('**/treasure_chest_closed'), self.test_guiImage.find('**/treasure_chest_closed_over')) self.winImagePanel = GuiPanel.GuiPanel('', 2.6000000000000001, 1.8999999999999999, True) self.winImagePanel.setPos(-1.3, 0.0, -0.94999999999999996) self.winImagePanel.reparentTo(self.uiBaseNode) self.winImagePanel.background = OnscreenImage( parent=self.winImagePanel, scale=(2.3999999999999999, 0, 1.8), image=self.guiImage.find('**/pir_t_gui_fsh_posterBackground'), hpr=(0, 0, 0), pos=(1.3, 0, 0.94999999999999996)) self.winImagePanel.setBin('gui-popup', -4) self.winTitleTextNode = TextNode('winTitleTextNode') self.winTitleTextNode.setText('Congratulations!') self.winTitleTextNode.setAlign(TextNode.ACenter) self.winTitleTextNode.setFont(PiratesGlobals.getPirateFont()) self.winTitleTextNode.setTextColor(0.23000000000000001, 0.089999999999999997, 0.029999999999999999, 1.0) self.winTitleTextNodePath = NodePath(self.winTitleTextNode) self.winTitleTextNodePath.setPos(1.3500000000000001, 0.0, 1.6699999999999999) self.winTitleTextNodePath.setScale(0.17999999999999999) self.winTitleTextNodePath.reparentTo(self.winImagePanel) self.wholeStoryTextNode = TextNode('storyTextNode') self.wholeStoryTextNode.setText('') self.wholeStoryTextNode.setWordwrap(19.0) self.wholeStoryTextNode.setTextColor(0.23000000000000001, 0.089999999999999997, 0.029999999999999999, 1.0) self.wholeStoryTextNodePath = NodePath(self.wholeStoryTextNode) self.wholeStoryTextNodePath.setPos(0.33000000000000002, 0.0, 1.6399999999999999) self.wholeStoryTextNodePath.setScale(0.050000000000000003) self.wholeStoryTextNodePath.reparentTo(self.winImagePanel) self.winImagePanel.closeButton[ 'command'] = self.closeDialogGotNextState self.winImagePanel.closeButton['extraArgs'] = [ 'winImagePanel', 'FarewellLegendaryFish', False ] self.UICompoments['winImagePanel'] = self.winImagePanel self.winImagePanel.hide() self.luiCloseDialogSequence = Sequence() self.arrowImageRotationInterval = LerpHprInterval( self.arrowImage, 2.2000000000000002, self.arrowImage.getHpr() + Point3(0.0, 0.0, 280.0), self.arrowImage.getHpr()) self.luiArrowRotatingSequence = Sequence( Func(self.showGui, ['arrowImage']), Parallel(Func(self.arrowImageRotationInterval.start), Wait(2.2000000000000002)), Func(self.hideGui, ['arrowImage']), Func(self.arrowImage.setHpr, self.arrowImage.getHpr() + Point3(0.0, 0.0, 5.0)), name=self.gameObject.distributedFishingSpot.uniqueName( 'luiArrowRotatingSequence')) self.lineOneColorChange = LerpColorScaleInterval( self.lineOneTransitTextNodePath, FishingGlobals.legendaryTransitionTextDuration, (1.0, 1.0, 1.0, 0.0), (1.0, 1.0, 1.0, 1.0), blendType='easeOut') self.lineOnePosChange = LerpPosInterval( self.lineOneTransitTextNodePath, FishingGlobals.legendaryTransitionTextDuration, (0.0, 0.0, -0.20000000000000001), (0.0, 0.0, -0.80000000000000004), blendType='easeOut') self.lineTwoCholorChange = LerpColorScaleInterval( self.lineTwoTransitTextNodePath, FishingGlobals.legendaryTransitionTextDuration, (1.0, 1.0, 1.0, 1.0), (1.0, 1.0, 1.0, 1.0), blendType='easeOut') self.lineTwoPosChange = LerpPosInterval( self.lineTwoTransitTextNodePath, FishingGlobals.legendaryTransitionTextDuration, (0.0, 0.0, -0.32000000000000001), (0.0, 0.0, -0.94999999999999996), blendType='easeOut') self.transitionTextMovingSequence = Sequence( Func(self.lineOneTransitTextNodePath.show), Func(self.lineTwoTransitTextNodePath.show), Parallel(self.lineOnePosChange, self.lineTwoPosChange, self.lineOneColorChange, self.lineTwoCholorChange), Func(self.lineOneTransitTextNodePath.hide), Func(self.lineTwoTransitTextNodePath.hide), name=self.gameObject.distributedFishingSpot.uniqueName( 'transitionTextMovingSequence')) self.meterFadeInInterval = Sequence( Func(self.meterFrame.show), LerpColorScaleInterval( self.meterFrame, FishingGlobals.legendaryTransitionTextDuration, colorScale=(1.0, 1.0, 1.0, 1.0), startColorScale=(1.0, 1.0, 1.0, 0.0), blendType='easeOut'), name='FadeInLegendaryMeter') self.meterFadeOutInterval = Sequence(LerpColorScaleInterval( self.meterFrame, FishingGlobals.legendaryTransitionTextDuration, colorScale=(1.0, 1.0, 1.0, 0.0), startColorScale=(1.0, 1.0, 1.0, 1.0), blendType='easeOut'), Func(self.meterFrame.hide), name='FadeOutLegendaryMeter') self.rodFadeInInterval = Sequence( Func(self.fishingHandleBaseFrame.show), LerpColorScaleInterval( self.fishingHandleBaseFrame, FishingGlobals.legendaryTransitionTextDuration, colorScale=(1.0, 1.0, 1.0, 1.0), startColorScale=(1.0, 1.0, 1.0, 0.0), blendType='easeOut'), name='FadeInLegendaryRodInterface') self.rodFadeOutInterval = Sequence( LerpColorScaleInterval( self.fishingHandleBaseFrame, FishingGlobals.legendaryTransitionTextDuration, colorScale=(1.0, 1.0, 1.0, 0.0), startColorScale=(1.0, 1.0, 1.0, 1.0), blendType='easeOut'), Func(self.fishingHandleBaseFrame.hide), name='FadeOutLegendaryRodInterface') base.loadingScreen.tick() smallScale = self.fishingHandleButton['scale'] bigScale = self.fishingHandleButton['scale'] * 1.2 self.buttonGrowUpInterval = LerpScaleInterval(self.fishingHandleButton, 1.0, bigScale, smallScale) self.luiFightTransitSequence = Sequence( Parallel(Func(self.fishingHandleBaseFrame.show), Func(self.meterFadeOutInterval.start), Func(self.rodFadeInInterval.start), Func(self.buttonGrowUpInterval.start)), Wait(1.0), Func(self.meterFrame.hide), name=self.gameObject.distributedFishingSpot.uniqueName( 'luiFightTransitSequence')) self.luiReelTransitSequence = Sequence( Parallel(Func(self.fishingHandleBaseFrame.show), Func(self.meterFadeOutInterval.start), Func(self.rodFadeInInterval.start)), Wait(1.0), Func(self.meterFrame.hide), name=self.gameObject.distributedFishingSpot.uniqueName( 'luiReelTransitSequence')) self.luiStruggleTransitSequence = Sequence( Parallel(Func(self.meterFrame.show), Func(self.resetFishingRod), self.meterFadeInInterval, self.rodFadeOutInterval), Wait(1.0), Func(self.fishingHandleBaseFrame.hide), name=self.gameObject.distributedFishingSpot.uniqueName( 'luiStruggleTransitSequence')) self.meterFadeOutInterval.start() self.rodFadeOutInterval.start() self.hideAllGUI() base.loadingScreen.endStep('LegendaryGameGUI')
def __init__(self, npc, shopId, **kw): optiondefs = (('relief', None, None), ('framSize', (0, self.width, 0, self.height), None), ('sortOrder', 20, None)) self.defineoptions(kw, optiondefs) DirectFrame.__init__(self, None, **None) self.initialiseoptions(BarberStoreGUI) self.pirate = None self.camIval = None self.buttons = [] self.buttonIndex = 0 self.itemAmount = 0 self.currentPage = None self.confirmBox = None self.buttonsPerPage = 3 self.displayRegionStates = { } self.numPages = 0 gui = loader.loadModel('models/gui/toplevel_gui') self.CoinImage = gui.find('**/treasure_w_coin*') self.ParchmentIcon = gui.find('**/main_gui_quest_scroll') self.barberIconsA = loader.loadModel('models/gui/char_gui') self.barberIconsB = loader.loadModel('models/textureCards/shopIcons') self.ShirtIcon = loader.loadModel('models/gui/char_gui').find('**/chargui_cloth') self.LockIcon = gui.find('**/pir_t_gui_gen_key_subscriber') self.backTabParent = self.attachNewNode('backTabs', sort = 0) self.panel = GuiPanel.GuiPanel(None, self.width, self.height, parent = self, showClose = False) self.setPos(0.0, 0, -0.75) self.balance = 0 self.npc = npc self.rootTitle = PLocalizer.ShopBarber self.paid = Freebooter.getPaidStatus(localAvatar.getDoId()) self.shopId = shopId if localAvatar.gameFSM.camIval is not None: if localAvatar.gameFSM.camIval.isPlaying(): localAvatar.gameFSM.camIval.finish() self.initialCamPos = camera.getPos() self.initialCamHpr = camera.getHpr() self.initialPirateH = 0 self.cartWidth = self.columnWidth - 0.10000000000000001 self.cartHeight = self.height - 0.25 self.cartFrame = DirectFrame(parent = self.panel, relief = None, frameSize = (0, self.cartWidth, 0, self.cartHeight)) self.cartFrame.setPos(self.columnWidth + 0.025000000000000001, 0, 0.080000000000000002) self.categoryText = [ [ PLocalizer.Hat, PLocalizer.Hats], [ PLocalizer.Shirt, PLocalizer.Shirts], [ PLocalizer.Vest, PLocalizer.Vests], [ PLocalizer.Coat, PLocalizer.Coats], [ PLocalizer.Pants, PLocalizer.Pants], [ PLocalizer.Belt, PLocalizer.Belts], [ None, None], [ PLocalizer.Shoe, PLocalizer.Shoes]] self.frontTabParent = self.panel.attachNewNode('frontTab', sort = 2) self.myGoldTitle = DirectFrame(parent = self.cartFrame, relief = None, text = PLocalizer.YourMoney, text_fg = PiratesGuiGlobals.TextFG2, text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleLarge, text_shadow = PiratesGuiGlobals.TextShadow, pos = (-0.375, 0, 0.17499999999999999)) self.myGold = DirectFrame(parent = self.cartFrame, relief = None, text = str(localAvatar.getMoney()), text_fg = PiratesGuiGlobals.TextFG2, text_align = TextNode.ARight, text_scale = PiratesGuiGlobals.TextScaleLarge, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, image = self.CoinImage, image_scale = 0.14999999999999999, image_pos = (0.029999999999999999, 0, 0.014999999999999999), pos = (-0.059999999999999998, 0, 0.17499999999999999)) self.closeButton = DialogButton.DialogButton(command = self.closePanel, parent = self.cartFrame, text = PLocalizer.lClose, text_fg = PiratesGuiGlobals.TextFG2, text_pos = (0.02, -(PiratesGuiGlobals.TextScaleLarge) * 0.25), text_scale = PiratesGuiGlobals.TextScaleLarge, text_shadow = PiratesGuiGlobals.TextShadow, buttonStyle = DialogButton.DialogButton.NO) self.closeButton.setPos(0, 0, 0.0050000000000000001) tGui = loader.loadModel('models/gui/triangle') triangle = (tGui.find('**/triangle'), tGui.find('**/triangle_down'), tGui.find('**/triangle_over')) self.nextPageButton = DirectButton(parent = self.cartFrame, relief = None, state = DGG.DISABLED, image = triangle, image_scale = 0.065000000000000002, pos = (0.17999999999999999, 0.0, 0.10000000000000001), rolloverSound = None, command = self.nextPage) self.prevPageButton = DirectButton(parent = self.cartFrame, relief = None, state = DGG.DISABLED, image = triangle, image_scale = -0.065000000000000002, pos = (-0.17999999999999999, 0.0, 0.10000000000000001), rolloverSound = None, command = self.previousPage) self.pageNumber = DirectFrame(parent = self.cartFrame, relief = None, text = '', text_fg = PiratesGuiGlobals.TextFG2, text_align = TextNode.ACenter, text_scale = PiratesGuiGlobals.TextScaleLarge, text_pos = (0.0, 0.0), text_shadow = PiratesGuiGlobals.TextShadow, pos = (0, 0, 0.089999999999999997)) self.titleLabel = DirectLabel(parent = self, relief = None, text = '', text_fg = PiratesGuiGlobals.TextFG1, text_align = TextNode.ACenter, text_scale = PiratesGuiGlobals.TextScaleLarge * 1.3, text_shadow = PiratesGuiGlobals.TextShadow, pos = (0.62, 0.0, 1.3300000000000001)) self.titleLabel.setBin('gui-fixed', 1) self.createPirate() charGui = loader.loadModel('models/gui/char_gui') self.rotateSlider = DirectSlider(parent = base.a2dBottomLeft, relief = None, command = self.rotatePirate, image = charGui.find('**/chargui_slider_small'), image_scale = (2.1499999999999999, 2.1499999999999999, 1.5), thumb_relief = None, thumb_image = (charGui.find('**/chargui_slider_node'), charGui.find('**/chargui_slider_node_down'), charGui.find('**/chargui_slider_node_over')), pos = (0.80000000000000004, 0.0, 0.089999999999999997), text_align = TextNode.ACenter, text_scale = (0.10000000000000001, 0.10000000000000001), text_pos = (0.0, 0.10000000000000001), text_fg = PiratesGuiGlobals.TextFG1, scale = 0.42999999999999999, text = PLocalizer.RotateSlider, value = 0.5, sortOrder = -1) self.rotateSlider['extraArgs'] = [ self.rotateSlider] self.rotateSliderOrigin = 0.5 self.accept('mouse1', self._startMouseReadTask) self.accept('mouse1-up', self._stopMouseReadTask) self.clothWindows = [] self.clothRenders = [] self.clothHumans = [] self.clothCameraNPs = [] self.clothCameras = [] self.createDisplayRegions() self.alertDialog = None self.accept('aspectRatioChanged', self.aspectRatioChange) self.accept('NonPayerPanelShown', self.hideDisplayRegions) self.accept('NonPayerPanelHidden', self.showDisplayRegions) self.accept('MainMenuShown', self.hideDisplayRegions) self.accept('MainMenuHidden', self.showDisplayRegions) self.accept('GUIShown', self.showDisplayRegions) self.accept('GUIHidden', self.hideDisplayRegions) localAvatar.guiMgr.chatPanel.show() localAvatar.guiMgr.chatPanel.startFadeTextIval() self.model = loader.loadModel('models/gui/gui_shop_tailor') self.model.reparentTo(self.panel) self.model.setBin('gui-fixed', 0) self.model.setPos(0.625, 0.0, 1.05) self.model.setScale(0.33700000000000002, 0.0, 0.32700000000000001) localAvatar.guiMgr.hideTrackedQuestInfo() self.initTabs() self.updateBalance() self.focusCamera()
def __init__(self, w, h, locationId=LocationIds.PORT_ROYAL_ISLAND): GuiPanel.GuiPanel.__init__(self, '', w, h, True) self.card = loader.loadModel( 'models/gui/pir_m_gui_fsh_legendaryScreen') self.storyImageCard = loader.loadModel( 'models/minigames/pir_m_gam_fsh_legendaryGui') self.UICompoments = {} self.setPos(-1.1499999999999999, 0.0, -0.59999999999999998) self['geom'] = self.card.find('**/background') self['geom_pos'] = (0.57999999999999996, 0.0, 0.63) self['geom_scale'] = (0.94999999999999996, 0.0, 0.84999999999999998) self.coinImage = OnscreenImage(parent=self, image=self.card.find('**/coin'), scale=0.90000000000000002, hpr=(0, 0, 0), pos=(0.84999999999999998, 0, 0.84999999999999998)) self.titleTextNode = TextNode('legendPanelTitle') self.titleTextNode.setText(PLocalizer.LegendSelectionGui['panelTitle']) self.titleTextNode.setFont(PiratesGlobals.getPirateFont()) self.titleTextNode.setTextColor(0.87, 0.81999999999999995, 0.54000000000000004, 0.90000000000000002) self.titleTextNodePath = NodePath(self.titleTextNode) self.titleTextNodePath.setPos(0.65000000000000002, 0.0, 1.2) self.titleTextNodePath.setScale(0.070000000000000007) self.titleTextNodePath.reparentTo(self) self.introTextNode = TextNode('legendaryIntroTextNode') self.introTextNode.setText( PLocalizer.LegendSelectionGui['legendIntro']) self.introTextNode.setWordwrap(14.0) self.introTextNode.setTextColor(0.90000000000000002, 0.80000000000000004, 0.46999999999999997, 0.90000000000000002) self.introTextNodePath = NodePath(self.introTextNode) self.introTextNodePath.setPos(0.59999999999999998, 0.0, 0.5) self.introTextNodePath.setScale(0.042000000000000003) self.introTextNodePath.reparentTo(self) self.buttonRootNode = NodePath('button_RootNode') self.buttonRootNode.reparentTo(self) self.buttonRootNode.setPos(-0.080000000000000002, 0.0, 1.1499999999999999) self.iconCard = loader.loadModel('models/gui/treasure_gui') self.legendSelectionButtons = {} btnGeom = (self.card.find('**/fishButton/idle'), self.card.find('**/fishButton/idle'), self.card.find('**/fishButton/over')) for i in range(len(FishingGlobals.legendaryFishData)): fishName = FishingGlobals.legendaryFishData[i]['name'] fishId = FishingGlobals.legendaryFishData[i]['id'] assetsKey = CollectionMap.Assets[fishId] pos_x = 0.29999999999999999 pos_z = 0.0 - i * 0.25 button = GuiButton( parent=self.buttonRootNode, text=(fishName, fishName, fishName, fishName), text0_fg=(0.42999999999999999, 0.28999999999999998, 0.19, 1.0), text1_fg=(0.42999999999999999, 0.28999999999999998, 0.19, 1.0), text2_fg=(0.42999999999999999, 0.28999999999999998, 0.19, 1.0), text3_fg=(0.42999999999999999, 0.28999999999999998, 0.19, 1.0), text_scale=0.035000000000000003, text_pos=(0.037999999999999999, -0.0050000000000000001), pos=(pos_x, 0, pos_z), hpr=(0, 0, 0), scale=1.5, image=btnGeom, image_pos=(0, 0, 0), image_scale=0.69999999999999996, sortOrder=2, command=self.buttonClickHandle, extraArgs=[fishId, assetsKey, locationId]) button.icon = OnscreenImage(parent=button, image=self.iconCard.find('**/%s*' % assetsKey), scale=0.34999999999999998, hpr=(0, 0, 0), pos=(-0.123, 0, 0.0050000000000000001)) self.legendPanel = GuiPanel.GuiPanel('', 2.6000000000000001, 1.8999999999999999, True) self.legendPanel.setPos(-1.3, 0.0, -0.94999999999999996) self.legendPanel.background = OnscreenImage( parent=self.legendPanel, scale=(2.3999999999999999, 0, 1.8), image=self.storyImageCard.find( '**/pir_t_gui_fsh_posterBackground'), hpr=(0, 0, 0), pos=(1.3, 0, 0.94999999999999996)) self.legendPanel.storyImage = OnscreenImage( parent=self.legendPanel, scale=1, image=self.card.find('**/coin'), hpr=(0, 0, 0), pos=(1.8, 0, 1)) self.storyTextNode = TextNode('storyTextNode') self.storyTextNode.setText('') self.storyTextNode.setWordwrap(19.0) self.storyTextNode.setTextColor(0.23000000000000001, 0.089999999999999997, 0.029999999999999999, 1.0) self.storyTextNodePath = NodePath(self.storyTextNode) self.storyTextNodePath.setPos(0.33000000000000002, 0.0, 1.6699999999999999) self.storyTextNodePath.setScale(0.050000000000000003) self.storyTextNodePath.reparentTo(self.legendPanel) self.callBack = None self.legendPanel.hide()
def __init__(self, gameObject=None): base.loadingScreen.beginStep('GameGUI', 3, 20) self.gameObject = gameObject gui = loader.loadModel('models/gui/toplevel_gui') guiIcons = loader.loadModel('models/textureCards/icons') weaponIcons = loader.loadModel('models/gui/gui_icons_weapon') fishingIcons = loader.loadModel('models/textureCards/fishing_icons') self.tackleBoxButton = DirectButton( parent=base.a2dBottomRight, relief=None, pos=(-0.53000000000000003, 0.0, 0.10000000000000001), scale=0.5, text=PLocalizer.FishingGui['Lures'], text_pos=(0, -0.14999999999999999), text_scale=0.065000000000000002, text_fg=PiratesGuiGlobals.TextFG2, text_shadow=PiratesGuiGlobals.TextShadow, text_font=PiratesGlobals.getPirateBoldOutlineFont(), image_pos=(0, 0, 0), image_scale=0.17999999999999999, geom=(fishingIcons.find('**/pir_t_gui_fsh_tackleBasket'), fishingIcons.find('**/pir_t_gui_fsh_tackleBasket'), fishingIcons.find('**/pir_t_gui_fsh_tackleBasket_over')), geom_pos=(0, 0, 0), geom_scale=0.25, geom_color=(1.0, 1.0, 1.0, 1), sortOrder=2, command=self.toggleLureSelectionDialog) self.tackleBoxInterval = Sequence( self.tackleBoxButton.colorScaleInterval( 0.5, Vec4(1.0, 0.59999999999999998, 0.59999999999999998, 1.0)), self.tackleBoxButton.colorScaleInterval(0.5, Vec4(1.0, 1.0, 1.0, 1.0))) self.exitButton = DirectButton( parent=base.a2dBottomRight, relief=None, pos=(-0.29999999999999999, 0.0, 0.10000000000000001), scale=0.5, text=PLocalizer.FishingGui['ExitButton'], text_pos=(0, -0.14999999999999999), text_scale=0.065000000000000002, text_fg=PiratesGuiGlobals.TextFG2, text_shadow=PiratesGuiGlobals.TextShadow, text_font=PiratesGlobals.getPirateBoldOutlineFont(), image_pos=(0, 0, 0), image_scale=0.17999999999999999, geom=(fishingIcons.find('**/pir_t_gui_fsh_esc'), fishingIcons.find('**/pir_t_gui_fsh_esc'), fishingIcons.find('**/pir_t_gui_fsh_esc_over')), geom_pos=(0, 0, 0), geom_scale=0.25, geom_color=(1.0, 1.0, 1.0, 1), sortOrder=2, command=self.handleExitGame) self.OkDialog = None base.loadingScreen.tick() dialogText = PLocalizer.FishingGui['ChooseYourLure'] self.lureSelectionPanel = GuiPanel.GuiPanel(dialogText, 0.75, 0.5, True, 1) self.lureSelectionPanel.reparentTo(base.a2dBottomRight) self.lureSelectionPanel.setPos(-0.90000000000000002, 0.0, 0.22) self.lureSelectionPanel.regularLureButton = DirectButton( parent=self.lureSelectionPanel, relief=None, pos=(0.20000000000000001, 0, 0.25), scale=0.5, text='', text_pos=(0, 0), text_scale=PiratesGuiGlobals.TextScaleSmall, text_fg=PiratesGuiGlobals.TextFG2, text_shadow=PiratesGuiGlobals.TextShadow, text_font=PiratesGlobals.getPirateBoldOutlineFont(), image=fishingIcons.find('**/pir_t_gui_fsh_lureReg'), image_pos=(0, 0, 0), image_scale=0.17999999999999999, geom=(gui.find('**/pir_t_gui_but_circle'), gui.find('**/pir_t_gui_but_circle'), gui.find('**/pir_t_gui_but_circle_over')), geom_pos=(0, 0, 0), geom_scale=1, geom_hpr=(0, 0, 90), geom_color=(1.0, 1.0, 1.0, 1), sortOrder=2, command=self.chooseRegularLure) self.lureSelectionPanel.regularLureButtonText = DirectLabel( parent=self.lureSelectionPanel, relief=None, text=PLocalizer.FishingGui['RegularLures'], text_align=TextNode.ARight, text_scale=PiratesGuiGlobals.TextScaleSmall, text_pos=(0.28000000000000003, 0.14999999999999999), text_fg=PiratesGuiGlobals.TextFG2, text_shadow=PiratesGuiGlobals.TextShadow, text_font=PiratesGlobals.getPirateBoldOutlineFont(), textMayChange=1) base.loadingScreen.tick() inv = localAvatar.getInventory() regQty = inv.getStackQuantity(InventoryType.RegularLure) self.lureSelectionPanel.regularLureQty = DirectLabel( parent=self.lureSelectionPanel, relief=None, text='x' + str(regQty), text_align=TextNode.ACenter, text_scale=PiratesGuiGlobals.TextScaleSmall, text_pos=(0.29999999999999999, 0.20000000000000001), text_fg=PiratesGuiGlobals.TextFG2, text_shadow=PiratesGuiGlobals.TextShadow, text_font=PiratesGlobals.getPirateBoldOutlineFont(), textMayChange=1) self.lureSelectionPanel.legendaryLureButton = DirectButton( parent=self.lureSelectionPanel, relief=None, pos=(0.55000000000000004, 0.0, 0.25), scale=0.5, text='', text_pos=(0, 0), text_scale=PiratesGuiGlobals.TextScaleSmall, text_fg=PiratesGuiGlobals.TextFG2, text_shadow=PiratesGuiGlobals.TextShadow, text_font=PiratesGlobals.getPirateBoldOutlineFont(), image=fishingIcons.find('**/pir_t_gui_fsh_lureLegend'), image_pos=(0, 0, 0), image_scale=0.17999999999999999, geom=(gui.find('**/pir_t_gui_but_circle'), gui.find('**/pir_t_gui_but_circle'), gui.find('**/pir_t_gui_but_circle_over')), geom_pos=(0, 0, 0), geom_scale=1, geom_hpr=(0, 0, 90), geom_color=(1.0, 1.0, 1.0, 1), sortOrder=2, command=self.chooseLegendaryLure) self.lureSelectionPanel.legendaryLureButtonText = DirectLabel( parent=self.lureSelectionPanel, relief=None, text=PLocalizer.FishingGui['LegendaryLures'], text_align=TextNode.ARight, text_scale=PiratesGuiGlobals.TextScaleSmall, text_pos=(0.65000000000000002, 0.14999999999999999), text_fg=PiratesGuiGlobals.TextFG2, text_shadow=PiratesGuiGlobals.TextShadow, text_font=PiratesGlobals.getPirateBoldOutlineFont(), textMayChange=1) inv = localAvatar.getInventory() legQty = inv.getStackQuantity(InventoryType.LegendaryLure) self.lureSelectionPanel.legendaryLureQty = DirectLabel( parent=self.lureSelectionPanel, relief=None, text='x' + str(legQty), text_align=TextNode.ACenter, text_scale=PiratesGuiGlobals.TextScaleSmall, text_pos=(0.66000000000000003, 0.20000000000000001), text_fg=PiratesGuiGlobals.TextFG2, text_shadow=PiratesGuiGlobals.TextShadow, text_font=PiratesGlobals.getPirateBoldOutlineFont(), textMayChange=1) self.lureSelectionPanel.hide() self.lureSelectionPanelShowing = False self.resultsScreen = FishingResults(self.gameObject) self.resultsScreen.hide() bestRod = self.gameObject.getAvatarsBestRod() if bestRod == -1: base.notify.error( 'Somehow the avatar got into the fishing game without a rod in their inventory!' ) if bestRod == ItemGlobals.FISHING_ROD_3: self.castPowerMeterModel = loader.loadModel( 'models/gui/pir_m_gui_fsh_fishingBarExpert') elif bestRod == ItemGlobals.FISHING_ROD_2: self.castPowerMeterModel = loader.loadModel( 'models/gui/pir_m_gui_fsh_fishingBarNovice') else: self.castPowerMeterModel = loader.loadModel( 'models/gui/pir_m_gui_fsh_fishingBarBeginner') base.loadingScreen.tick() self.castPowerMeter = NodePath('castPowerMeter') self.castPowerMeter.reparentTo(base.a2dLeftCenter) self.castMeterBackground = self.castPowerMeterModel.find( '**/background') self.castMeterBackground.setBin('fixed', 32) self.castMeterBackground.reparentTo(self.castPowerMeter) self.castMeterBar = self.castPowerMeterModel.find('**/meter') self.castMeterBar.setBin('fixed', 33) self.castMeterBar.reparentTo(self.castPowerMeter) self.castMeterBar.setColorScale(0.5, 0.5, 1.0, 1.0) self.castMeterFrame = self.castPowerMeterModel.find('**/bar') self.castMeterFrame.setBin('fixed', 34) self.castMeterFrame.reparentTo(self.castPowerMeter) self.castPowerMeter.setPos(0.13700000000000001, 0, 0.22800000000000001) self.castPowerMeter.setScale(1) self.lineHealthMeter = NodePath('lineHealthMeter') self.lineHealthMeter.reparentTo(base.a2dLeftCenter) self.lineHealthMeterModel = loader.loadModel( 'models/gui/pir_m_gui_fsh_fishingBarHealth') self.lineHealthMeterBackground = self.lineHealthMeterModel.find( '**/background') self.lineHealthMeterBackground.setBin('fixed', 32) self.lineHealthMeterBackground.reparentTo(self.lineHealthMeter) self.lineHealthMeterBar = self.lineHealthMeterModel.find('**/meter') self.lineHealthMeterBar.setBin('fixed', 33) self.lineHealthMeterBar.reparentTo(self.lineHealthMeter) self.lineHealthMeterFrame = self.lineHealthMeterModel.find('**/bar') self.lineHealthMeterFrame.setBin('fixed', 34) self.lineHealthMeterFrame.reparentTo(self.lineHealthMeter) self.lineHealthMeter.setPos(0.13700000000000001, 0, 0.25) self.lineHealthMeter.setScale(1) self.lineLengthLabel = TextPrinter() self.lineLengthLabel.text.setScale(1.2) self.lineLengthLabel.text.setHpr(0.0, 0.0, 0.0) self.lineLengthLabel.text['sortOrder'] = 200 self.lineLengthLabel.text.setBin('gui-fixed', 10) self.lineLengthLabel.text.setDepthTest(0) self.lineLengthLabel.text.setDepthWrite(0) self.lineLengthLabel.showText('0', (1, 1, 1, 1)) base.loadingScreen.endStep('GameGUI')