Exemplo n.º 1
0
 def __init__(self, callback, skillId, skillRank):
     if not SkillpageGuiButton.SkillIcons:
         SkillpageGuiButton.SkillIcons = loader.loadModel(
             'models/textureCards/skillIcons')
         SkillpageGuiButton.Image = (
             SkillpageGuiButton.SkillIcons.find('**/base'),
             SkillpageGuiButton.SkillIcons.find('**/base_down'),
             SkillpageGuiButton.SkillIcons.find('**/base_over'))
     asset = RadialMenu.getSkillIconName(skillId, 0)
     geom = SkillpageGuiButton.SkillIcons.find('**/%s' % asset)
     DirectButton.__init__(self,
                           relief=None,
                           pos=(0, 0, 0),
                           image=SkillpageGuiButton.Image,
                           image_scale=0.12,
                           geom=geom,
                           geom_scale=0.12,
                           command=callback,
                           textMayChange=1,
                           sortOrder=70,
                           extraArgs=[skillId])
     self.initialiseoptions(SkillpageGuiButton)
     self.skillId = skillId
     self.skillRank = skillRank
     self.showUpgrade = 0
     self.helpBox = None
     self.quantity = None
     self.bind(DGG.ENTER, self.showDetails)
     self.bind(DGG.EXIT, self.hideDetails)
     return
 def __init__(self, callback, skillId, skillRank):
     if not AmmoPanelButton.SkillIcons:
         AmmoPanelButton.SkillIcons = loader.loadModel('models/textureCards/skillIcons')
         AmmoPanelButton.Image = (AmmoPanelButton.SkillIcons.find('**/base'), AmmoPanelButton.SkillIcons.find('**/base_down'), AmmoPanelButton.SkillIcons.find('**/base_over'))
     
     self.locked = True
     self.purchaseable = True
     self.cost = CannonDefenseGlobals.getDefenseCannonAmmoCost(skillId)
     self.amount = CannonDefenseGlobals.getDefenseCannonAmmoAmount(skillId)
     if self.amount == -1:
         self.amount = PLocalizer.Unlimited
     
     self.skillId = skillId
     self.skillRank = skillRank
     self.infoBox = None
     self.flashIval = None
     asset = RadialMenu.getSkillIconName(skillId, 0)
     geom = AmmoPanelButton.SkillIcons.find('**/%s' % asset)
     self.geom = geom
     if self.locked:
         asset = None
         geom = None
     
     DirectButton.__init__(self, relief = None, pos = (0, 0, 0), text = '?', text_scale = 0.10000000000000001, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_pos = (0.0050000000000000001, -0.035000000000000003), text_align = TextNode.ACenter, image = AmmoPanelButton.Image, image_scale = 0.12, geom = geom, geom_scale = 0.12, command = callback, textMayChange = 1, sortOrder = 70, extraArgs = [
         skillId])
     self.initialiseoptions(AmmoPanelButton)
     gui = loader.loadModel('models/gui/toplevel_gui')
     self.lockIcon = gui.find('**/pir_t_gui_gen_key_subscriber')
     if not Freebooter.getPaidStatus(base.localAvatar.doId) and skillId > CannonDefenseGlobals.FREEBOOTER_LAST_AMMO_AVAILABLE:
         self.lock = DirectFrame(parent = self, relief = None, image = self.lockIcon, image_scale = 0.14000000000000001, image_pos = (0.050000000000000003, 0, -0.025000000000000001), sortOrder = 99)
     
     self.bind(DGG.ENTER, self.showDetails)
     self.bind(DGG.EXIT, self.hideDetails)
Exemplo n.º 3
0
 def __init__(self, callback, skillId, skillRank):
     if not AmmoPanelButton.SkillIcons:
         AmmoPanelButton.SkillIcons = loader.loadModel(
             'models/textureCards/skillIcons')
         AmmoPanelButton.Image = (
             AmmoPanelButton.SkillIcons.find('**/base'),
             AmmoPanelButton.SkillIcons.find('**/base_down'),
             AmmoPanelButton.SkillIcons.find('**/base_over'))
     self.locked = True
     self.purchaseable = True
     self.cost = CannonDefenseGlobals.getDefenseCannonAmmoCost(skillId)
     self.amount = CannonDefenseGlobals.getDefenseCannonAmmoAmount(skillId)
     if self.amount == -1:
         self.amount = PLocalizer.Unlimited
     self.skillId = skillId
     self.skillRank = skillRank
     self.infoBox = None
     self.flashIval = None
     asset = RadialMenu.getSkillIconName(skillId, 0)
     geom = AmmoPanelButton.SkillIcons.find('**/%s' % asset)
     self.geom = geom
     if self.locked:
         asset = None
         geom = None
     DirectButton.__init__(self,
                           relief=None,
                           pos=(0, 0, 0),
                           text='?',
                           text_scale=0.1,
                           text_fg=PiratesGuiGlobals.TextFG2,
                           text_shadow=PiratesGuiGlobals.TextShadow,
                           text_pos=(0.005, -0.035),
                           text_align=TextNode.ACenter,
                           image=AmmoPanelButton.Image,
                           image_scale=0.12,
                           geom=geom,
                           geom_scale=0.12,
                           command=callback,
                           textMayChange=1,
                           sortOrder=70,
                           extraArgs=[skillId])
     self.initialiseoptions(AmmoPanelButton)
     gui = loader.loadModel('models/gui/toplevel_gui')
     self.lockIcon = gui.find('**/pir_t_gui_gen_key_subscriber')
     if not Freebooter.getPaidStatus(
             base.localAvatar.doId
     ) and skillId > CannonDefenseGlobals.FREEBOOTER_LAST_AMMO_AVAILABLE:
         self.lock = DirectFrame(parent=self,
                                 relief=None,
                                 image=self.lockIcon,
                                 image_scale=0.14,
                                 image_pos=(0.05, 0, -0.025),
                                 sortOrder=99)
     self.bind(DGG.ENTER, self.showDetails)
     self.bind(DGG.EXIT, self.hideDetails)
     return
    def __init__(self, callback, skillId, skillRank):
        if not SkillpageGuiButton.SkillIcons:
            SkillpageGuiButton.SkillIcons = loader.loadModel('models/textureCards/skillIcons')
            SkillpageGuiButton.Image = (SkillpageGuiButton.SkillIcons.find('**/base'), SkillpageGuiButton.SkillIcons.find('**/base_down'), SkillpageGuiButton.SkillIcons.find('**/base_over'))

        asset = RadialMenu.getSkillIconName(skillId, 0)
        geom = SkillpageGuiButton.SkillIcons.find('**/%s' % asset)
        DirectButton.__init__(self, relief = None, pos = (0, 0, 0), image = SkillpageGuiButton.Image, image_scale = 0.12, geom = geom, geom_scale = 0.12, command = callback, textMayChange = 1, sortOrder = 70, extraArgs = [
            skillId])
        self.initialiseoptions(SkillpageGuiButton)
        self.skillId = skillId
        self.skillRank = skillRank
        self.showUpgrade = 0
        self.helpBox = None
        self.quantity = None
        self.bind(DGG.ENTER, self.showDetails)
        self.bind(DGG.EXIT, self.hideDetails)
Exemplo n.º 5
0
 def showSkill(self, skillId, ammoSkillId=0, timestamp=0):
     if ammoSkillId:
         visSkillId = skillId != EnemySkills.PISTOL_RELOAD and skillId != EnemySkills.GRENADE_RELOAD and ammoSkillId
     else:
         visSkillId = skillId
     self.activeName['text'] = PLocalizer.InventoryTypeNames[visSkillId]
     asset = RadialMenu.getSkillIconName(visSkillId, 0)
     if self.card:
         tex = self.card.find('**/%s' % asset)
         self.skillFrame['image'] = tex
         self.skillFrame['image_scale'] = 0.075
         self.skillFrame.setPos(-0.105, 0, -0.255)
     ts = globalClockDelta.localElapsedTime(timestamp)
     delay = self.SHOW_SKILL_DURATION - ts
     if delay > 0:
         if self.fader:
             self.fader.finish()
         self.reloadFrame.show()
         self.reloadFrame.setAlphaScale(1.0)
         taskMgr.remove('hideSkillTask')
         taskMgr.doMethodLater(delay, self.hideSkill, 'hideSkillTask')
    def showSkill(self, skillId, ammoSkillId = 0, timestamp = 0):
        if ammoSkillId and skillId != EnemySkills.PISTOL_RELOAD and skillId != EnemySkills.GRENADE_RELOAD:
            visSkillId = ammoSkillId
        else:
            visSkillId = skillId
        self.activeName['text'] = PLocalizer.InventoryTypeNames[visSkillId]
        asset = RadialMenu.getSkillIconName(visSkillId, 0)
        if self.card:
            tex = self.card.find('**/%s' % asset)
            self.skillFrame['image'] = tex
            self.skillFrame['image_scale'] = 0.074999999999999997
            self.skillFrame.setPos(-0.105, 0, -0.255)

        ts = globalClockDelta.localElapsedTime(timestamp)
        delay = self.SHOW_SKILL_DURATION - ts
        if delay > 0:
            if self.fader:
                self.fader.finish()

            self.reloadFrame.show()
            self.reloadFrame.setAlphaScale(1.0)
            taskMgr.remove('hideSkillTask')
            taskMgr.doMethodLater(delay, self.hideSkill, 'hideSkillTask')