Exemple #1
0
 def __init__(self, fishingGame):
     NodePath.__init__(self, 'FishingResults')
     self.reparentTo(base.a2dRightCenter)
     self.gameObject = fishingGame
     self.setPos(-1.0, 0.0, -0.25)
     self.background = loader.loadModel('models/minigames/pir_m_gui_fsh_rewardScreen')
     self.background.reparentTo(self)
     self.background.setScale(0.80000000000000004, 0.75, 0.75)
     self.background.setPos(0.65000000000000002, 0.75, 0.75)
     self.bAgain = RequestButton(width = 1.5, text = PLocalizer.FishingGui['PlayAgainButton'], command = self.playAgain)
     self.bAgain.reparentTo(self)
     self.bAgain.setPos(0.57999999999999996, 0, 0.10000000000000001)
     self.bAgain.setScale(1.2, 1.2, 1.2)
     self.titleText = PLocalizer.FishingGui['WinTitle']
     self.messageText = PLocalizer.FishingGui['WinText']
     self.title = DirectLabel(parent = self, relief = None, text = self.titleText, text_scale = PiratesGuiGlobals.TextScaleTitleJumbo, text_font = PiratesGlobals.getPirateOutlineFont(), text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextLT14, pos = (0.62, 0, 1.3), textMayChange = 0)
     self.message = DirectLabel(parent = self, relief = None, text = self.messageText, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.64000000000000001, 0, 1.1499999999999999), textMayChange = 0)
     self.fishName = None
     self.levelUnlockDetails = None
     self.fishWeight = None
     self.fishXpAmt = 0
     self.fishXp = None
     self.fishXpBonus = None
     self.fishGoldAmt = 0
     self.fishGold = None
     self.fishGoldBonus = None
     self.collectionCard = loader.loadModel('models/gui/treasure_gui')
class PotionTableMsgPanel(GuiPanel):
    def __init__(self):
        GuiPanel.__init__(self,
                          'Training needed',
                          1,
                          0.40000000000000002,
                          showClose=False,
                          titleSize=1.5)
        self.setPos((-0.5, 0, 0))
        self.bQuit = RequestButton(text='OK', command=self.quit)
        self.bQuit.reparentTo(self)
        self.bQuit.setPos(0.45000000000000001, 0, 0.050000000000000003)
        self.message = None

    def show(self):
        if self.message is not None:
            self.message.removeNode()

        self.messageText = 'Please visit the gypsy before crafting potions.'
        self.message = DirectLabel(parent=self,
                                   relief=None,
                                   text=self.messageText,
                                   text_scale=PiratesGuiGlobals.TextScaleLarge,
                                   text_align=TextNode.ACenter,
                                   text_fg=PiratesGuiGlobals.TextFG2,
                                   text_shadow=PiratesGuiGlobals.TextShadow,
                                   text_wordwrap=17,
                                   pos=(0.5, 0, 0.20000000000000001),
                                   textMayChange=0)
        self.unstash()
        localAvatar.motionFSM.off()

    def quit(self):
        localAvatar.motionFSM.on()
        self.stash()
class PotionInstructionPanel(GuiPanel):
    
    def __init__(self):
        GuiPanel.__init__(self, PLocalizer.GypsyPotionCraftingTitle, 1, 0.40000000000000002, showClose = False, titleSize = 1.5)
        self.setPos((-0.5, 0, 0))
        self.bQuit = RequestButton(text = PLocalizer.GypsyPotionCraftingClose, command = self.quit)
        self.bQuit.reparentTo(self)
        self.bQuit.setPos(0.45000000000000001, 0, 0.029999999999999999)
        self.message = None
        self.callBack = None

    
    def show(self, onInstructionsComplete):
        if self.message is not None:
            self.message.removeNode()
        
        self.callBack = onInstructionsComplete
        self.messageText = PLocalizer.GypsyPotionCraftingMessage
        self.message = DirectLabel(parent = self, relief = None, text = self.messageText, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 22, pos = (0.5, 0, 0.27000000000000002), textMayChange = 0)
        self.unstash()
        localAvatar.motionFSM.off()

    
    def quit(self):
        localAvatar.motionFSM.on()
        self.stash()
        if self.callBack is not None:
            self.callBack()
class PotionInstructionPanel(GuiPanel):
    
    def __init__(self):
        GuiPanel.__init__(self, PLocalizer.GypsyPotionCraftingTitle, 1, 0.40000000000000002, showClose = False, titleSize = 1.5)
        self.setPos((-0.5, 0, 0))
        self.bQuit = RequestButton(text = PLocalizer.GypsyPotionCraftingClose, command = self.quit)
        self.bQuit.reparentTo(self)
        self.bQuit.setPos(0.45000000000000001, 0, 0.029999999999999999)
        self.message = None
        self.callBack = None

    
    def show(self, onInstructionsComplete):
        if self.message is not None:
            self.message.removeNode()
        
        self.callBack = onInstructionsComplete
        self.messageText = PLocalizer.GypsyPotionCraftingMessage
        self.message = DirectLabel(parent = self, relief = None, text = self.messageText, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 22, pos = (0.5, 0, 0.27000000000000002), textMayChange = 0)
        self.unstash()
        localAvatar.motionFSM.off()

    
    def quit(self):
        localAvatar.motionFSM.on()
        self.stash()
        if self.callBack is not None:
            self.callBack()
 def __init__(self):
     GuiPanel.__init__(self, PLocalizer.GypsyPotionCraftingTitle, 1, 0.40000000000000002, showClose = False, titleSize = 1.5)
     self.setPos((-0.5, 0, 0))
     self.bQuit = RequestButton(text = PLocalizer.GypsyPotionCraftingClose, command = self.quit)
     self.bQuit.reparentTo(self)
     self.bQuit.setPos(0.45000000000000001, 0, 0.029999999999999999)
     self.message = None
     self.callBack = None
 def __init__(self):
     GuiPanel.__init__(self,
                       'Training needed',
                       1,
                       0.40000000000000002,
                       showClose=False,
                       titleSize=1.5)
     self.setPos((-0.5, 0, 0))
     self.bQuit = RequestButton(text='OK', command=self.quit)
     self.bQuit.reparentTo(self)
     self.bQuit.setPos(0.45000000000000001, 0, 0.050000000000000003)
     self.message = None
 def __init__(self, potionGame):
     self.potionGame = potionGame
     GuiPanel.__init__(self, PLocalizer.PotionGui['FailTitle'], 1, 0.40000000000000002, showClose = False, titleSize = 1.5)
     self.setPos((-0.5, 0, 0))
     self.bQuit = RequestButton(width = 2.0, text = PLocalizer.PotionGui['StopButton'], command = self.quit)
     self.bQuit.reparentTo(self)
     self.bQuit.setPos(0.25, 0, 0.050000000000000003)
     self.bPlayAgain = RequestButton(width = 2.0, text = PLocalizer.PotionGui['PlayAgainButton'], command = self.playAgain)
     self.bPlayAgain.reparentTo(self)
     self.bPlayAgain.setPos(0.65000000000000002, 0, 0.050000000000000003)
     self.message = None
     self.message2 = None
     self.message3 = None
Exemple #8
0
 def __init__(self, potionGame):
     self.potionGame = potionGame
     GuiPanel.__init__(self, PLocalizer.PotionGui['FailTitle'], 1, 0.4, showClose=False, titleSize=1.5)
     self.setPos((-0.5, 0, 0))
     self.bQuit = RequestButton(width=2.0, text=PLocalizer.PotionGui['StopButton'], command=self.quit)
     self.bQuit.reparentTo(self)
     self.bQuit.setPos(0.25, 0, 0.05)
     self.bPlayAgain = RequestButton(width=2.0, text=PLocalizer.PotionGui['PlayAgainButton'], command=self.playAgain)
     self.bPlayAgain.reparentTo(self)
     self.bPlayAgain.setPos(0.65, 0, 0.05)
     self.message = None
     self.message2 = None
     self.message3 = None
     return
 def __init__(self, fishingGame):
     NodePath.__init__(self, 'FishingResults')
     self.reparentTo(base.a2dRightCenter)
     self.gameObject = fishingGame
     self.setPos(-1.0, 0.0, -0.25)
     self.background = loader.loadModel('models/minigames/pir_m_gui_fsh_rewardScreen')
     self.background.reparentTo(self)
     self.background.setScale(0.80000000000000004, 0.75, 0.75)
     self.background.setPos(0.65000000000000002, 0.75, 0.75)
     self.bAgain = RequestButton(width = 1.5, text = PLocalizer.FishingGui['PlayAgainButton'], command = self.playAgain)
     self.bAgain.reparentTo(self)
     self.bAgain.setPos(0.57999999999999996, 0, 0.10000000000000001)
     self.bAgain.setScale(1.2, 1.2, 1.2)
     self.titleText = PLocalizer.FishingGui['WinTitle']
     self.messageText = PLocalizer.FishingGui['WinText']
     self.title = DirectLabel(parent = self, relief = None, text = self.titleText, text_scale = PiratesGuiGlobals.TextScaleTitleJumbo, text_font = PiratesGlobals.getPirateOutlineFont(), text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextLT14, pos = (0.62, 0, 1.3), textMayChange = 0)
     self.message = DirectLabel(parent = self, relief = None, text = self.messageText, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.64000000000000001, 0, 1.1499999999999999), textMayChange = 0)
     self.fishName = None
     self.levelUnlockDetails = None
     self.fishWeight = None
     self.fishXpAmt = 0
     self.fishXp = None
     self.fishXpBonus = None
     self.fishGoldAmt = 0
     self.fishGold = None
     self.fishGoldBonus = None
     self.collectionCard = loader.loadModel('models/gui/treasure_gui')
 def __init__(self):
     GuiPanel.__init__(self, 'Training needed', 1, 0.40000000000000002, showClose = False, titleSize = 1.5)
     self.setPos((-0.5, 0, 0))
     self.bQuit = RequestButton(text = 'OK', command = self.quit)
     self.bQuit.reparentTo(self)
     self.bQuit.setPos(0.45000000000000001, 0, 0.050000000000000003)
     self.message = None
 def __init__(self):
     GuiPanel.__init__(self, PLocalizer.GypsyPotionCraftingTitle, 1, 0.40000000000000002, showClose = False, titleSize = 1.5)
     self.setPos((-0.5, 0, 0))
     self.bQuit = RequestButton(text = PLocalizer.GypsyPotionCraftingClose, command = self.quit)
     self.bQuit.reparentTo(self)
     self.bQuit.setPos(0.45000000000000001, 0, 0.029999999999999999)
     self.message = None
     self.callBack = None
Exemple #12
0
 def __init__(self, potionGame):
     self.potionGame = potionGame
     GuiPanel.__init__(self, '', 1.5, 1.0, showClose=False, titleSize=1.5)
     self.setPos((-0.75, 0, -0.4))
     self.bQuit = RequestButton(width=1.5,
                                text=PLocalizer.PotionGui['StopButton'],
                                command=self.quit)
     self.bQuit.reparentTo(self)
     self.bQuit.setPos(0.15, 0, 0.05)
     self.bQuit.setScale(1.2, 1.2, 1.2)
     self.bAgain = RequestButton(
         width=1.5,
         text=PLocalizer.PotionGui['PlayAgainButton'],
         command=self.playAgain)
     self.bAgain.reparentTo(self)
     self.bAgain.setPos(1.25, 0, 0.05)
     self.bAgain.setScale(1.2, 1.2, 1.2)
     self.titleText = PLocalizer.PotionGui['WinTitle']
     self.messageText = PLocalizer.PotionGui['WinText']
     self.Title = DirectLabel(
         parent=self,
         relief=None,
         text=self.titleText,
         text_scale=PiratesGuiGlobals.TextScaleTitleJumbo,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         text_align=TextNode.ACenter,
         text_fg=PiratesGuiGlobals.TextFG1,
         text_shadow=PiratesGuiGlobals.TextLT14,
         pos=(0.75, 0, 0.83),
         textMayChange=0)
     self.message = DirectLabel(
         parent=self,
         relief=None,
         text=self.messageText,
         text_scale=PiratesGuiGlobals.TextScaleTitleSmall,
         text_align=TextNode.ACenter,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_wordwrap=17,
         pos=(0.75, 0, 0.72),
         textMayChange=0)
     self.potionName = None
     self.potionDesc = None
     self.potionXp = None
     self.potionImg = None
     return
 def __init__(self, potionGame):
     self.potionGame = potionGame
     GuiPanel.__init__(self, '', 1.5, 1.0, showClose = False, titleSize = 1.5)
     self.setPos((-0.75, 0, -0.40000000000000002))
     self.bQuit = RequestButton(width = 1.5, text = PLocalizer.PotionGui['StopButton'], command = self.quit)
     self.bQuit.reparentTo(self)
     self.bQuit.setPos(0.14999999999999999, 0, 0.050000000000000003)
     self.bQuit.setScale(1.2, 1.2, 1.2)
     self.bAgain = RequestButton(width = 1.5, text = PLocalizer.PotionGui['PlayAgainButton'], command = self.playAgain)
     self.bAgain.reparentTo(self)
     self.bAgain.setPos(1.25, 0, 0.050000000000000003)
     self.bAgain.setScale(1.2, 1.2, 1.2)
     self.titleText = PLocalizer.PotionGui['WinTitle']
     self.messageText = PLocalizer.PotionGui['WinText']
     self.Title = DirectLabel(parent = self, relief = None, text = self.titleText, text_scale = PiratesGuiGlobals.TextScaleTitleJumbo, text_font = PiratesGlobals.getPirateOutlineFont(), text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextLT14, pos = (0.75, 0, 0.82999999999999996), textMayChange = 0)
     self.message = DirectLabel(parent = self, relief = None, text = self.messageText, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.75, 0, 0.71999999999999997), textMayChange = 0)
     self.potionName = None
     self.potionDesc = None
     self.potionXp = None
     self.potionImg = None
class PotionTableMsgPanel(GuiPanel):
    
    def __init__(self):
        GuiPanel.__init__(self, 'Training needed', 1, 0.40000000000000002, showClose = False, titleSize = 1.5)
        self.setPos((-0.5, 0, 0))
        self.bQuit = RequestButton(text = 'OK', command = self.quit)
        self.bQuit.reparentTo(self)
        self.bQuit.setPos(0.45000000000000001, 0, 0.050000000000000003)
        self.message = None

    
    def show(self):
        if self.message is not None:
            self.message.removeNode()
        
        self.messageText = 'Please visit the gypsy before crafting potions.'
        self.message = DirectLabel(parent = self, relief = None, text = self.messageText, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.5, 0, 0.20000000000000001), textMayChange = 0)
        self.unstash()
        localAvatar.motionFSM.off()

    
    def quit(self):
        localAvatar.motionFSM.on()
        self.stash()
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(LeaveCrewWarningButton)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(MainMenuConfirmButton)
class PotionResults(GuiPanel):
    
    def __init__(self, potionGame):
        self.potionGame = potionGame
        GuiPanel.__init__(self, '', 1.5, 1.0, showClose = False, titleSize = 1.5)
        self.setPos((-0.75, 0, -0.40000000000000002))
        self.bQuit = RequestButton(width = 1.5, text = PLocalizer.PotionGui['StopButton'], command = self.quit)
        self.bQuit.reparentTo(self)
        self.bQuit.setPos(0.14999999999999999, 0, 0.050000000000000003)
        self.bQuit.setScale(1.2, 1.2, 1.2)
        self.bAgain = RequestButton(width = 1.5, text = PLocalizer.PotionGui['PlayAgainButton'], command = self.playAgain)
        self.bAgain.reparentTo(self)
        self.bAgain.setPos(1.25, 0, 0.050000000000000003)
        self.bAgain.setScale(1.2, 1.2, 1.2)
        self.titleText = PLocalizer.PotionGui['WinTitle']
        self.messageText = PLocalizer.PotionGui['WinText']
        self.Title = DirectLabel(parent = self, relief = None, text = self.titleText, text_scale = PiratesGuiGlobals.TextScaleTitleJumbo, text_font = PiratesGlobals.getPirateOutlineFont(), text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextLT14, pos = (0.75, 0, 0.82999999999999996), textMayChange = 0)
        self.message = DirectLabel(parent = self, relief = None, text = self.messageText, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.75, 0, 0.71999999999999997), textMayChange = 0)
        self.potionName = None
        self.potionDesc = None
        self.potionXp = None
        self.potionImg = None

    
    def destroy(self):
        self.bQuit.destroy()
        self.bAgain.destroy()
        GuiPanel.destroy(self)

    
    def show(self):
        if self.potionName is not None:
            self.potionName.removeNode()
        
        if self.potionDesc is not None:
            self.potionDesc.removeNode()
        
        if self.potionXp is not None:
            self.potionXp.removeNode()
        
        if self.potionImg is not None:
            self.potionImg.removeNode()
        
        self.potionName = DirectLabel(parent = self, relief = None, text = self.potionGame.currentRecipe.name, text_scale = PiratesGuiGlobals.TextScaleTitleMed, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.75, 0, 0.65000000000000002), textMayChange = 0)
        self.potionDesc = DirectLabel(parent = self, relief = None, text = self.potionGame.currentRecipe.desc, text_scale = PiratesGuiGlobals.TextScaleExtraLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 34, pos = (0.75, 0, 0.22), textMayChange = 0)
        xpAmt = PotionGlobals.getPotionBuffXP(self.potionGame.currentRecipe.potionID)
        xpAmt = int(math.ceil(float(xpAmt) / 2.0))
        xpBonus = self.potionGame.dist.getXpBonus()
        labelTxt = '+ ' + str(xpAmt) + ' ' + PLocalizer.PotionGui['XPLabel']
        if xpBonus:
            xpAmt = xpAmt + xpBonus
            labelTxt = PLocalizer.PotionGui['XPLabelBonus'] % (str(xpAmt), str(xpBonus))
        
        self.potionXp = DirectLabel(parent = self, relief = None, text = labelTxt, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.75, 0, 0.28999999999999998), textMayChange = 0)
        asset = ItemGlobals.getIcon(PotionGlobals.potionBuffIdToInventoryTypeId(self.potionGame.currentRecipe.potionID))
        skillIcons = loader.loadModel('models/textureCards/skillIcons')
        geom = skillIcons.find('**/%s' % asset)
        if geom.isEmpty():
            geom = skillIcons.find('**/base')
        
        geom_scale = 0.23999999999999999
        self.potionImg = DirectFrame(parent = self, geom = geom, geom_scale = geom_scale, pos = (0.75, 0, 0.5), image = None, relief = None)
        self.unstash()
        self.potionGame.closeCurrentDialog = self.cleanUp
        self.potionGame.disableButtons()
        skillIcons.removeNode()

    
    def cleanUp(self):
        self.stash()
        self.potionGame.closeCurrentDialog = None
        self.potionGame.enableButtons()

    
    def playAgain(self):
        if self.potionGame.gameFSM.getCurrentOrNextState() not in [
            'Anim',
            'ChestOpened']:
            self.cleanUp()
            self.potionGame.gameFSM.request('Reset')
        

    
    def quit(self):
        if self.potionGame.gameFSM.getCurrentOrNextState() not in [
            'Anim']:
            self.cleanUp()
            self.potionGame.gameFSM.request('Exit')
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(MainMenuConfirmButton)
class FishingResults(NodePath):
    def __init__(self, fishingGame):
        NodePath.__init__(self, 'FishingResults')
        self.reparentTo(base.a2dRightCenter)
        self.gameObject = fishingGame
        self.setPos(-1.0, 0.0, -0.25)
        self.background = loader.loadModel(
            'models/minigames/pir_m_gui_fsh_rewardScreen')
        self.background.reparentTo(self)
        self.background.setScale(0.8, 0.75, 0.75)
        self.background.setPos(0.65, 0.75, 0.75)
        self.bAgain = RequestButton(
            width=1.5,
            text=PLocalizer.FishingGui['PlayAgainButton'],
            command=self.playAgain)
        self.bAgain.reparentTo(self)
        self.bAgain.setPos(0.58, 0, 0.1)
        self.bAgain.setScale(1.2, 1.2, 1.2)
        self.titleText = PLocalizer.FishingGui['WinTitle']
        self.messageText = PLocalizer.FishingGui['WinText']
        self.title = DirectLabel(
            parent=self,
            relief=None,
            text=self.titleText,
            text_scale=PiratesGuiGlobals.TextScaleTitleJumbo,
            text_font=PiratesGlobals.getPirateOutlineFont(),
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG1,
            text_shadow=PiratesGuiGlobals.TextLT14,
            pos=(0.62, 0, 1.3),
            textMayChange=0)
        self.message = DirectLabel(
            parent=self,
            relief=None,
            text=self.messageText,
            text_scale=PiratesGuiGlobals.TextScaleTitleSmall,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_wordwrap=17,
            pos=(0.64, 0, 1.15),
            textMayChange=0)
        self.fishName = None
        self.levelUnlockDetails = None
        self.fishWeight = None
        self.fishXpAmt = 0
        self.fishXp = None
        self.fishXpBonus = None
        self.fishGoldAmt = 0
        self.fishGold = None
        self.fishGoldBonus = None
        self.collectionCard = loader.loadModel('models/gui/treasure_gui')
        return

    def destroy(self):
        self.bAgain.destroy()

    def showAll(self):
        if self.fishName is not None:
            self.fishName.removeNode()
        if self.levelUnlockDetails is not None:
            self.levelUnlockDetails.removeNode()
        if self.fishWeight is not None:
            self.fishWeight.removeNode()
        if self.fishXp is not None:
            self.fishXp.removeNode()
        if self.fishGold is not None:
            self.fishGold.removeNode()
        self.fishName = DirectLabel(
            parent=self,
            relief=None,
            text=self.gameObject.fishManager.activeFish.myData['name'],
            text_scale=PiratesGuiGlobals.TextScaleTitleMed,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_wordwrap=17,
            pos=(0.64, 0, 1.04),
            textMayChange=0)
        unlockText = ''
        newLevel = self.gameObject.getPredictedPlayerFishingLevel(
            int(self.gameObject.fishManager.activeFish.myData['experience']))
        if newLevel > self.gameObject.levelAtCastStart:
            self.gameObject.currentFishingLevel = newLevel
            unlockText = PLocalizer.FishingGui[
                'LevelUp'] + ' ' + PLocalizer.Minigame_Fishing_Level_Unlocks[
                    newLevel]
            self.gameObject.tutorialManager.showTutorial(
                InventoryType.FishingLevelGain)
            if newLevel == 10:
                self.gameObject.tutorialManager.showTutorial(
                    InventoryType.FishingLevel10)
            if FishingGlobals.unlockLevelToSkillId.has_key(newLevel):
                unlock = FishingGlobals.unlockLevelToSkillId[newLevel]
                if FishingGlobals.skillIdToTutorialId.has_key(unlock):
                    tutorialContext = FishingGlobals.skillIdToTutorialId[
                        unlock]
                    self.gameObject.tutorialManager.showTutorial(
                        tutorialContext)
        self.levelUnlockDetails = DirectLabel(
            parent=self,
            relief=None,
            text=unlockText,
            text_scale=PiratesGuiGlobals.TextScaleTitleSmall,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_wordwrap=16,
            pos=(0.64, 0.0, 0.42),
            textMayChange=0)
        self.fishXpAmt = self.gameObject.fishManager.activeFish.myData[
            'experience']
        self.fishXp = DirectLabel(
            parent=self,
            relief=None,
            text='+ ' + str(self.fishXpAmt) + ' ' +
            PLocalizer.FishingGui['XPLabel'],
            text_scale=PiratesGuiGlobals.TextScaleTitleSmall,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_wordwrap=17,
            pos=(0.9, 0, 0.63),
            textMayChange=1)
        self.fishGoldAmt = int(
            self.gameObject.fishManager.activeFish.myData['gold'] *
            self.gameObject.fishManager.activeFish.weight)
        self.fishGold = DirectLabel(
            parent=self,
            relief=None,
            text='+ ' + str(self.fishGoldAmt) + ' ' +
            PLocalizer.FishingGui['GoldText'],
            text_scale=PiratesGuiGlobals.TextScaleTitleSmall,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_wordwrap=17,
            pos=(0.9, 0, 0.54),
            textMayChange=1)
        self.updateGoldAndXpBonus()
        self.fishWeight = DirectLabel(
            parent=self,
            relief=None,
            text=str(self.gameObject.fishManager.activeFish.weight) + ' ' +
            PLocalizer.FishingGui['WeightLabel'],
            text_scale=PiratesGuiGlobals.TextScaleTitleLarge,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_wordwrap=17,
            pos=(0.4, 0, 0.6),
            textMayChange=0)
        pic_name = CollectionMap.Assets[
            self.gameObject.fishManager.activeFish.myData['id']]
        fishIcon = self.collectionCard.find('**/%s*' % pic_name)
        self.glow = DirectFrame(parent=self,
                                geom=fishIcon,
                                geom_scale=1.0,
                                pos=(0.64, 0.0, 0.85),
                                image=None,
                                relief=None)
        self.setScale(0.75, 0.75, 0.75)
        self.show()
        return

    def updateGoldAndXpBonus(self):
        if self.fishXpBonus is not None:
            self.fishXpBonus.removeNode()
        xpBonus = self.gameObject.distributedFishingSpot.getXpBonus()
        if xpBonus:
            self.fishXp['text'] = '+ ' + str(
                self.fishXpAmt +
                xpBonus) + ' ' + PLocalizer.FishingGui['XPLabel']
            self.fishXpBonus = DirectLabel(
                parent=self,
                relief=None,
                text=PLocalizer.FishingGui['XPBonusLabel'] % str(xpBonus),
                text_scale=PiratesGuiGlobals.TextScaleMed,
                text_align=TextNode.ACenter,
                text_fg=PiratesGuiGlobals.TextFG4,
                text_shadow=PiratesGuiGlobals.TextShadow,
                text_wordwrap=17,
                pos=(0.9, 0, 0.6),
                textMayChange=0)
        if self.fishGoldBonus is not None:
            self.fishGoldBonus.removeNode()
        goldBonus = self.gameObject.distributedFishingSpot.getGoldBonus()
        if goldBonus:
            self.fishGold['text'] = '+ ' + str(
                self.fishGoldAmt +
                goldBonus) + ' ' + PLocalizer.FishingGui['GoldText']
            self.fishGoldBonus = DirectLabel(
                parent=self,
                relief=None,
                text=PLocalizer.FishingGui['GoldBonusLabel'] % str(goldBonus),
                text_scale=PiratesGuiGlobals.TextScaleMed,
                text_align=TextNode.ACenter,
                text_fg=PiratesGuiGlobals.TextFG4,
                text_shadow=PiratesGuiGlobals.TextShadow,
                text_wordwrap=17,
                pos=(0.9, 0, 0.51),
                textMayChange=0)
        return

    def cleanUp(self):
        self.hide()

    def playAgain(self):
        self.cleanUp()
        if localAvatar.guiMgr.inventoryUIManager.hasPlunder():
            localAvatar.guiMgr.inventoryUIManager.showPlunder()
        elif self.gameObject.fsm.getCurrentOrNextState() != 'PlayerIdle':
            self.gameObject.fsm.request('PlayerIdle')

    def quit(self):
        self.cleanUp()
        self.gameObject.fsm.request('Offscreen')
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command, 1.8500000000000001)
     self.initialiseoptions(FeedbackAccountButton)
Exemple #21
0
class PotionResults(GuiPanel):
    def __init__(self, potionGame):
        self.potionGame = potionGame
        GuiPanel.__init__(self, '', 1.5, 1.0, showClose=False, titleSize=1.5)
        self.setPos((-0.75, 0, -0.40000000000000002))
        self.bQuit = RequestButton(width=1.5,
                                   text=PLocalizer.PotionGui['StopButton'],
                                   command=self.quit)
        self.bQuit.reparentTo(self)
        self.bQuit.setPos(0.14999999999999999, 0, 0.050000000000000003)
        self.bQuit.setScale(1.2, 1.2, 1.2)
        self.bAgain = RequestButton(
            width=1.5,
            text=PLocalizer.PotionGui['PlayAgainButton'],
            command=self.playAgain)
        self.bAgain.reparentTo(self)
        self.bAgain.setPos(1.25, 0, 0.050000000000000003)
        self.bAgain.setScale(1.2, 1.2, 1.2)
        self.titleText = PLocalizer.PotionGui['WinTitle']
        self.messageText = PLocalizer.PotionGui['WinText']
        self.Title = DirectLabel(
            parent=self,
            relief=None,
            text=self.titleText,
            text_scale=PiratesGuiGlobals.TextScaleTitleJumbo,
            text_font=PiratesGlobals.getPirateOutlineFont(),
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG1,
            text_shadow=PiratesGuiGlobals.TextLT14,
            pos=(0.75, 0, 0.82999999999999996),
            textMayChange=0)
        self.message = DirectLabel(
            parent=self,
            relief=None,
            text=self.messageText,
            text_scale=PiratesGuiGlobals.TextScaleTitleSmall,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_wordwrap=17,
            pos=(0.75, 0, 0.71999999999999997),
            textMayChange=0)
        self.potionName = None
        self.potionDesc = None
        self.potionXp = None
        self.potionImg = None

    def destroy(self):
        self.bQuit.destroy()
        self.bAgain.destroy()
        GuiPanel.destroy(self)

    def show(self):
        if self.potionName is not None:
            self.potionName.removeNode()

        if self.potionDesc is not None:
            self.potionDesc.removeNode()

        if self.potionXp is not None:
            self.potionXp.removeNode()

        if self.potionImg is not None:
            self.potionImg.removeNode()

        self.potionName = DirectLabel(
            parent=self,
            relief=None,
            text=self.potionGame.currentRecipe.name,
            text_scale=PiratesGuiGlobals.TextScaleTitleMed,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_wordwrap=17,
            pos=(0.75, 0, 0.65000000000000002),
            textMayChange=0)
        self.potionDesc = DirectLabel(
            parent=self,
            relief=None,
            text=self.potionGame.currentRecipe.desc,
            text_scale=PiratesGuiGlobals.TextScaleExtraLarge,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_wordwrap=34,
            pos=(0.75, 0, 0.22),
            textMayChange=0)
        xpAmt = PotionGlobals.getPotionBuffXP(
            self.potionGame.currentRecipe.potionID)
        xpAmt = int(math.ceil(float(xpAmt) / 2.0))
        xpBonus = self.potionGame.dist.getXpBonus()
        labelTxt = '+ ' + str(xpAmt) + ' ' + PLocalizer.PotionGui['XPLabel']
        if xpBonus:
            xpAmt = xpAmt + xpBonus
            labelTxt = PLocalizer.PotionGui['XPLabelBonus'] % (str(xpAmt),
                                                               str(xpBonus))

        self.potionXp = DirectLabel(
            parent=self,
            relief=None,
            text=labelTxt,
            text_scale=PiratesGuiGlobals.TextScaleTitleSmall,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_wordwrap=17,
            pos=(0.75, 0, 0.28999999999999998),
            textMayChange=0)
        asset = ItemGlobals.getIcon(
            PotionGlobals.potionBuffIdToInventoryTypeId(
                self.potionGame.currentRecipe.potionID))
        skillIcons = loader.loadModel('models/textureCards/skillIcons')
        geom = skillIcons.find('**/%s' % asset)
        if geom.isEmpty():
            geom = skillIcons.find('**/base')

        geom_scale = 0.23999999999999999
        self.potionImg = DirectFrame(parent=self,
                                     geom=geom,
                                     geom_scale=geom_scale,
                                     pos=(0.75, 0, 0.5),
                                     image=None,
                                     relief=None)
        self.unstash()
        self.potionGame.closeCurrentDialog = self.cleanUp
        self.potionGame.disableButtons()
        skillIcons.removeNode()

    def cleanUp(self):
        self.stash()
        self.potionGame.closeCurrentDialog = None
        self.potionGame.enableButtons()

    def playAgain(self):
        if self.potionGame.gameFSM.getCurrentOrNextState() not in [
                'Anim', 'ChestOpened'
        ]:
            self.cleanUp()
            self.potionGame.gameFSM.request('Reset')

    def quit(self):
        if self.potionGame.gameFSM.getCurrentOrNextState() not in ['Anim']:
            self.cleanUp()
            self.potionGame.gameFSM.request('Exit')
class PotionFail(GuiPanel):
    def __init__(self, potionGame):
        self.potionGame = potionGame
        GuiPanel.__init__(self,
                          PLocalizer.PotionGui['FailTitle'],
                          1,
                          0.40000000000000002,
                          showClose=False,
                          titleSize=1.5)
        self.setPos((-0.5, 0, 0))
        self.bQuit = RequestButton(width=2.0,
                                   text=PLocalizer.PotionGui['StopButton'],
                                   command=self.quit)
        self.bQuit.reparentTo(self)
        self.bQuit.setPos(0.25, 0, 0.050000000000000003)
        self.bPlayAgain = RequestButton(
            width=2.0,
            text=PLocalizer.PotionGui['PlayAgainButton'],
            command=self.playAgain)
        self.bPlayAgain.reparentTo(self)
        self.bPlayAgain.setPos(0.65000000000000002, 0, 0.050000000000000003)
        self.message = None
        self.message2 = None
        self.message3 = None

    def destroy(self):
        self.bQuit.destroy()
        self.bPlayAgain.destroy()
        GuiPanel.destroy(self)

    def show(self):
        if self.potionGame.closeCurrentDialog is not None:
            self.potionGame.closeCurrentDialog()

        if self.message is not None:
            self.message.removeNode()

        if self.message2 is not None:
            self.message2.removeNode()

        if self.message3 is not None:
            self.message3.removeNode()

        if len(self.potionGame.currentRecipe.ingredients) > 0:
            self.messageText = PLocalizer.PotionGui['FailText']
            self.message = DirectLabel(
                parent=self,
                relief=None,
                text=self.messageText,
                text_scale=PiratesGuiGlobals.TextScaleLarge,
                text_align=TextNode.ACenter,
                text_fg=PiratesGuiGlobals.TextFG2,
                text_shadow=PiratesGuiGlobals.TextShadow,
                text_wordwrap=17,
                pos=(0.5, 0, 0.25),
                textMayChange=0)
        else:
            self.messageText = PLocalizer.PotionGui[
                'IngredientCount'] + ' : ' + str(
                    self.potionGame.currentRecipe.ingredientsMade)
            self.message = DirectLabel(
                parent=self,
                relief=None,
                text=self.messageText,
                text_scale=PiratesGuiGlobals.TextScaleLarge,
                text_align=TextNode.ACenter,
                text_fg=PiratesGuiGlobals.TextFG2,
                text_shadow=PiratesGuiGlobals.TextShadow,
                text_wordwrap=17,
                pos=(0.5, 0, 0.28000000000000003),
                textMayChange=0)
            effBonus = 0
            xpEarned = 0
            if self.potionGame.currentRecipe.tilesUsed > 0:
                effBonus = int(
                    math.ceil(
                        100.0 *
                        float(self.potionGame.currentRecipe.ingredientsMade) /
                        float(self.potionGame.currentRecipe.tilesUsed)))
                xpEarned = int(
                    math.ceil(
                        float(self.potionGame.currentRecipe.ingredientsMade) *
                        float(self.potionGame.currentRecipe.ingredientsMade) /
                        10.0 * float(self.potionGame.currentRecipe.tilesUsed)))

            self.messageText2 = PLocalizer.PotionGui[
                'Efficiency'] + ' : ' + str(effBonus) + '%'
            self.message2 = DirectLabel(
                parent=self,
                relief=None,
                text=self.messageText2,
                text_scale=PiratesGuiGlobals.TextScaleLarge,
                text_align=TextNode.ACenter,
                text_fg=PiratesGuiGlobals.TextFG2,
                text_shadow=PiratesGuiGlobals.TextShadow,
                text_wordwrap=17,
                pos=(0.5, 0, 0.23999999999999999),
                textMayChange=0)
            self.messageText3 = PLocalizer.PotionGui['XPEarned'] + ' : ' + str(
                xpEarned)
            self.message3 = DirectLabel(
                parent=self,
                relief=None,
                text=self.messageText3,
                text_scale=PiratesGuiGlobals.TextScaleExtraLarge,
                text_align=TextNode.ACenter,
                text_fg=PiratesGuiGlobals.TextFG2,
                text_shadow=PiratesGuiGlobals.TextShadow,
                text_wordwrap=17,
                pos=(0.5, 0, 0.17999999999999999),
                textMayChange=0)
        self.unstash()
        self.potionGame.closeCurrentDialog = self.cleanUp
        self.potionGame.disableButtons()

    def cleanUp(self):
        self.stash()
        self.potionGame.closeCurrentDialog = None
        self.potionGame.enableButtons()

    def playAgain(self):
        self.cleanUp()
        self.potionGame.gameFSM.request('Reset')

    def quit(self):
        self.cleanUp()
        self.potionGame.gameFSM.request('Exit')
Exemple #23
0
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(GuildInviteeButton)
class FishingResults(NodePath):
    
    def __init__(self, fishingGame):
        NodePath.__init__(self, 'FishingResults')
        self.reparentTo(base.a2dRightCenter)
        self.gameObject = fishingGame
        self.setPos(-1.0, 0.0, -0.25)
        self.background = loader.loadModel('models/minigames/pir_m_gui_fsh_rewardScreen')
        self.background.reparentTo(self)
        self.background.setScale(0.80000000000000004, 0.75, 0.75)
        self.background.setPos(0.65000000000000002, 0.75, 0.75)
        self.bAgain = RequestButton(width = 1.5, text = PLocalizer.FishingGui['PlayAgainButton'], command = self.playAgain)
        self.bAgain.reparentTo(self)
        self.bAgain.setPos(0.57999999999999996, 0, 0.10000000000000001)
        self.bAgain.setScale(1.2, 1.2, 1.2)
        self.titleText = PLocalizer.FishingGui['WinTitle']
        self.messageText = PLocalizer.FishingGui['WinText']
        self.title = DirectLabel(parent = self, relief = None, text = self.titleText, text_scale = PiratesGuiGlobals.TextScaleTitleJumbo, text_font = PiratesGlobals.getPirateOutlineFont(), text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextLT14, pos = (0.62, 0, 1.3), textMayChange = 0)
        self.message = DirectLabel(parent = self, relief = None, text = self.messageText, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.64000000000000001, 0, 1.1499999999999999), textMayChange = 0)
        self.fishName = None
        self.levelUnlockDetails = None
        self.fishWeight = None
        self.fishXpAmt = 0
        self.fishXp = None
        self.fishXpBonus = None
        self.fishGoldAmt = 0
        self.fishGold = None
        self.fishGoldBonus = None
        self.collectionCard = loader.loadModel('models/gui/treasure_gui')

    
    def destroy(self):
        self.bAgain.destroy()

    
    def showAll(self):
        if self.fishName is not None:
            self.fishName.removeNode()
        
        if self.levelUnlockDetails is not None:
            self.levelUnlockDetails.removeNode()
        
        if self.fishWeight is not None:
            self.fishWeight.removeNode()
        
        if self.fishXp is not None:
            self.fishXp.removeNode()
        
        if self.fishGold is not None:
            self.fishGold.removeNode()
        
        self.fishName = DirectLabel(parent = self, relief = None, text = self.gameObject.fishManager.activeFish.myData['name'], text_scale = PiratesGuiGlobals.TextScaleTitleMed, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.64000000000000001, 0, 1.04), textMayChange = 0)
        unlockText = ''
        newLevel = self.gameObject.getPredictedPlayerFishingLevel(int(self.gameObject.fishManager.activeFish.myData['experience']))
        if newLevel > self.gameObject.levelAtCastStart:
            self.gameObject.currentFishingLevel = newLevel
            unlockText = PLocalizer.FishingGui['LevelUp'] + ' ' + PLocalizer.Minigame_Fishing_Level_Unlocks[newLevel]
            self.gameObject.tutorialManager.showTutorial(InventoryType.FishingLevelGain)
            if newLevel == 10:
                self.gameObject.tutorialManager.showTutorial(InventoryType.FishingLevel10)
            
            if FishingGlobals.unlockLevelToSkillId.has_key(newLevel):
                unlock = FishingGlobals.unlockLevelToSkillId[newLevel]
                if FishingGlobals.skillIdToTutorialId.has_key(unlock):
                    tutorialContext = FishingGlobals.skillIdToTutorialId[unlock]
                    self.gameObject.tutorialManager.showTutorial(tutorialContext)
                
            
        
        self.levelUnlockDetails = DirectLabel(parent = self, relief = None, text = unlockText, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 16, pos = (0.64000000000000001, 0.0, 0.41999999999999998), textMayChange = 0)
        self.fishXpAmt = self.gameObject.fishManager.activeFish.myData['experience']
        self.fishXp = DirectLabel(parent = self, relief = None, text = '+ ' + str(self.fishXpAmt) + ' ' + PLocalizer.FishingGui['XPLabel'], text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.90000000000000002, 0, 0.63), textMayChange = 1)
        self.fishGoldAmt = int(self.gameObject.fishManager.activeFish.myData['gold'] * self.gameObject.fishManager.activeFish.weight)
        self.fishGold = DirectLabel(parent = self, relief = None, text = '+ ' + str(self.fishGoldAmt) + ' ' + PLocalizer.FishingGui['GoldText'], text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.90000000000000002, 0, 0.54000000000000004), textMayChange = 1)
        self.updateGoldAndXpBonus()
        self.fishWeight = DirectLabel(parent = self, relief = None, text = str(self.gameObject.fishManager.activeFish.weight) + ' ' + PLocalizer.FishingGui['WeightLabel'], text_scale = PiratesGuiGlobals.TextScaleTitleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.40000000000000002, 0, 0.59999999999999998), textMayChange = 0)
        pic_name = CollectionMap.Assets[self.gameObject.fishManager.activeFish.myData['id']]
        fishIcon = self.collectionCard.find('**/%s*' % pic_name)
        self.glow = DirectFrame(parent = self, geom = fishIcon, geom_scale = 1.0, pos = (0.64000000000000001, 0.0, 0.84999999999999998), image = None, relief = None)
        self.setScale(0.75, 0.75, 0.75)
        self.show()

    
    def updateGoldAndXpBonus(self):
        if self.fishXpBonus is not None:
            self.fishXpBonus.removeNode()
        
        xpBonus = self.gameObject.distributedFishingSpot.getXpBonus()
        if xpBonus:
            self.fishXp['text'] = '+ ' + str(self.fishXpAmt + xpBonus) + ' ' + PLocalizer.FishingGui['XPLabel']
            self.fishXpBonus = DirectLabel(parent = self, relief = None, text = PLocalizer.FishingGui['XPBonusLabel'] % str(xpBonus), text_scale = PiratesGuiGlobals.TextScaleMed, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG4, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.90000000000000002, 0, 0.59999999999999998), textMayChange = 0)
        
        if self.fishGoldBonus is not None:
            self.fishGoldBonus.removeNode()
        
        goldBonus = self.gameObject.distributedFishingSpot.getGoldBonus()
        if goldBonus:
            self.fishGold['text'] = '+ ' + str(self.fishGoldAmt + goldBonus) + ' ' + PLocalizer.FishingGui['GoldText']
            self.fishGoldBonus = DirectLabel(parent = self, relief = None, text = PLocalizer.FishingGui['GoldBonusLabel'] % str(goldBonus), text_scale = PiratesGuiGlobals.TextScaleMed, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG4, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.90000000000000002, 0, 0.51000000000000001), textMayChange = 0)
        

    
    def cleanUp(self):
        self.hide()

    
    def playAgain(self):
        self.cleanUp()
        if localAvatar.guiMgr.inventoryUIManager.hasPlunder():
            localAvatar.guiMgr.inventoryUIManager.showPlunder()
        elif self.gameObject.fsm.getCurrentOrNextState() != 'PlayerIdle':
            self.gameObject.fsm.request('PlayerIdle')
        

    
    def quit(self):
        self.cleanUp()
        self.gameObject.fsm.request('Offscreen')
Exemple #25
0
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(TeleportConfirmButton)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(TeleportConfirmButton)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(FeedbackCancelButton)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(FeedbackCancelButton)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(PiratesConfirmButton)
Exemple #30
0
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command, 1.0)
     self.initialiseoptions(GuildMemberButtonYesNo)
     self['text_pos'] = (0.050000000000000003, 0.025000000000000001)
class PotionFail(GuiPanel):
    
    def __init__(self, potionGame):
        self.potionGame = potionGame
        GuiPanel.__init__(self, PLocalizer.PotionGui['FailTitle'], 1, 0.40000000000000002, showClose = False, titleSize = 1.5)
        self.setPos((-0.5, 0, 0))
        self.bQuit = RequestButton(width = 2.0, text = PLocalizer.PotionGui['StopButton'], command = self.quit)
        self.bQuit.reparentTo(self)
        self.bQuit.setPos(0.25, 0, 0.050000000000000003)
        self.bPlayAgain = RequestButton(width = 2.0, text = PLocalizer.PotionGui['PlayAgainButton'], command = self.playAgain)
        self.bPlayAgain.reparentTo(self)
        self.bPlayAgain.setPos(0.65000000000000002, 0, 0.050000000000000003)
        self.message = None
        self.message2 = None
        self.message3 = None

    
    def destroy(self):
        self.bQuit.destroy()
        self.bPlayAgain.destroy()
        GuiPanel.destroy(self)

    
    def show(self):
        if self.potionGame.closeCurrentDialog is not None:
            self.potionGame.closeCurrentDialog()
        
        if self.message is not None:
            self.message.removeNode()
        
        if self.message2 is not None:
            self.message2.removeNode()
        
        if self.message3 is not None:
            self.message3.removeNode()
        
        if len(self.potionGame.currentRecipe.ingredients) > 0:
            self.messageText = PLocalizer.PotionGui['FailText']
            self.message = DirectLabel(parent = self, relief = None, text = self.messageText, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.5, 0, 0.25), textMayChange = 0)
        else:
            self.messageText = PLocalizer.PotionGui['IngredientCount'] + ' : ' + str(self.potionGame.currentRecipe.ingredientsMade)
            self.message = DirectLabel(parent = self, relief = None, text = self.messageText, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.5, 0, 0.28000000000000003), textMayChange = 0)
            effBonus = 0
            xpEarned = 0
            if self.potionGame.currentRecipe.tilesUsed > 0:
                effBonus = int(math.ceil(100.0 * float(self.potionGame.currentRecipe.ingredientsMade) / float(self.potionGame.currentRecipe.tilesUsed)))
                xpEarned = int(math.ceil(float(self.potionGame.currentRecipe.ingredientsMade) * float(self.potionGame.currentRecipe.ingredientsMade) / 10.0 * float(self.potionGame.currentRecipe.tilesUsed)))
            
            self.messageText2 = PLocalizer.PotionGui['Efficiency'] + ' : ' + str(effBonus) + '%'
            self.message2 = DirectLabel(parent = self, relief = None, text = self.messageText2, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.5, 0, 0.23999999999999999), textMayChange = 0)
            self.messageText3 = PLocalizer.PotionGui['XPEarned'] + ' : ' + str(xpEarned)
            self.message3 = DirectLabel(parent = self, relief = None, text = self.messageText3, text_scale = PiratesGuiGlobals.TextScaleExtraLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 17, pos = (0.5, 0, 0.17999999999999999), textMayChange = 0)
        self.unstash()
        self.potionGame.closeCurrentDialog = self.cleanUp
        self.potionGame.disableButtons()

    
    def cleanUp(self):
        self.stash()
        self.potionGame.closeCurrentDialog = None
        self.potionGame.enableButtons()

    
    def playAgain(self):
        self.cleanUp()
        self.potionGame.gameFSM.request('Reset')

    
    def quit(self):
        self.cleanUp()
        self.potionGame.gameFSM.request('Exit')
Exemple #32
0
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(CrewBootButton)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(CrewMatchNewMemberRequestButton)
Exemple #34
0
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(PVPInviteeButton)
Exemple #35
0
 def __init__(self, text, command, width = 1.0):
     RequestButton.__init__(self, text, command, width)
     self.initialiseoptions(IgnoreConfirmButton)
Exemple #36
0
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command, 2.0)
     self.initialiseoptions(GuildMemberButton)
     self['text_pos'] = (0.05, 0.025)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(CrewInviterButton)
Exemple #38
0
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(PiratesInfoButton)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command, 1.8500000000000001)
     self.initialiseoptions(FeedbackAccountButton)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(CrewIconSelectorCancelButton)
 def __init__(self, text, command):
     if text == PLocalizer.CrewMatchAdvancedOptionsButton or text == PLocalizer.CrewMatchSimpleOptionsButton:
         RequestButton.__init__(self, text, command, 2.1)
     else:
         RequestButton.__init__(self, text, command)
     self.initialiseoptions(CrewMatchInviterButton)
Exemple #42
0
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(CrewIconSelectorCancelButton)
Exemple #43
0
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(TradeInviterButton)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(LeaveCrewWarningButton)
Exemple #45
0
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(PiratesOffLineEMailButton)
 def __init__(self, text, command):
     RequestButton.__init__(self, text, command)
     self.initialiseoptions(PiratesOffLineEMailButton)