Esempio n. 1
0
 def createTimerText(self, titleText, titleFg, infoText):
     self.titleText = DirectFrame(
         parent=self,
         state=DGG.DISABLED,
         relief=None,
         text=titleText,
         text_align=TextNode.ACenter,
         text_scale=0.050000000000000003,
         text_fg=titleFg,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         textMayChange=1,
         text_wordwrap=6,
         pos=(0, 0, 0.69999999999999996))
     self.infoText = DirectFrame(
         parent=self,
         state=DGG.DISABLED,
         relief=None,
         text=infoText,
         text_align=TextNode.ACenter,
         text_scale=0.14000000000000001,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         textMayChange=1,
         text_wordwrap=6,
         pos=(0, 0, -0.75))
Esempio n. 2
0
 def __init__(self):
     DirectObject.DirectObject.__init__(self)
     self.combo = 0
     self.totalDamage = 0
     self.text = DirectLabel(
         parent=base.a2dTopLeft,
         relief=None,
         text=PLocalizer.HitCombo,
         text_align=TextNode.ALeft,
         text_scale=PiratesGuiGlobals.TextScaleTitleLarge,
         text_fg=self.TEXT_COLOR,
         text_shadow=PiratesGuiGlobals.TextShadow,
         textMayChange=1,
         pos=(0.5, 0, -0.5),
         text_font=PiratesGlobals.getPirateOutlineFont())
     self.text.setTransparency(1)
     self.subText = DirectLabel(
         parent=self.text,
         relief=None,
         text=PLocalizer.Damage,
         text_align=TextNode.ALeft,
         text_scale=PiratesGuiGlobals.TextScaleTitleSmall,
         text_fg=self.SUB_TEXT_COLOR,
         text_shadow=PiratesGuiGlobals.TextShadow,
         textMayChange=1,
         pos=(0.09, 0, -0.07),
         text_font=PiratesGlobals.getPirateOutlineFont())
     self.comboCounter = DirectLabel(
         parent=self.text,
         relief=None,
         text='',
         text_align=TextNode.ARight,
         text_scale=self.COMBO_NUM_SCALE,
         text_fg=self.NUMBER_COLOR,
         text_shadow=PiratesGuiGlobals.TextShadow,
         textMayChange=1,
         pos=(-0.026, 0, -0.01),
         text_font=PiratesGlobals.getPirateOutlineFont())
     self.backstabText = DirectLabel(
         parent=base.a2dTopLeft,
         relief=None,
         text='Backstab!',
         text_align=TextNode.ALeft,
         text_scale=self.BACKSTAB_SCALE,
         text_fg=self.BACKSTAB_COLOR,
         text_shadow=PiratesGuiGlobals.TextShadow,
         textMayChange=1,
         pos=(1.165, 0, -0.97),
         text_font=PiratesGlobals.getPirateOutlineFont())
     self.text.hide()
     self.backstabText.hide()
     self.faderIn = None
     self.faderOut = None
     self.animIval = None
     self.backstabFaderIn = None
     self.backstabFaderOut = None
     self.backstabAnimIval = None
     self.accept('trackCombo', self.newHit)
     return
Esempio n. 3
0
    def createScoreboard(self, scoreboardPos):
        invasionResults = self.getInvasionResults()
        self.panel = Scoreboard.Scoreboard('', self.width, self.height - 0.715, invasionResults, self.titleHeight)
        self.panel.reparentTo(self)
        self.panel.setPos(scoreboardPos)
        for item in self.panel.list.items:
            item.descText['text_font'] = PiratesGlobals.getPirateOutlineFont()
            item.valueText['text_font'] = PiratesGlobals.getPirateOutlineFont()

        lenItems = len(self.panel.list.items)
        self.panel.list.items[0].descText.configure(text_fg=PiratesGuiGlobals.TextFG4)
        self.panel.list.items[0].valueText.configure(text_fg=PiratesGuiGlobals.TextFG4)
Esempio n. 4
0
 def createScoreboard(self, scoreboardPos):
     invasionResults = self.getInvasionResults()
     self.panel = Scoreboard.Scoreboard('', self.width, self.height - 0.71499999999999997, invasionResults, self.titleHeight)
     self.panel.reparentTo(self)
     self.panel.setPos(scoreboardPos)
     for item in self.panel.list.items:
         item.descText['text_font'] = PiratesGlobals.getPirateOutlineFont()
         item.valueText['text_font'] = PiratesGlobals.getPirateOutlineFont()
     
     lenItems = len(self.panel.list.items)
     self.panel.list.items[0].descText.configure(text_fg = PiratesGuiGlobals.TextFG4)
     self.panel.list.items[0].valueText.configure(text_fg = PiratesGuiGlobals.TextFG4)
    def __init__(self, type):
        guiMain = loader.loadModel('models/gui/gui_main')
        DirectFrame.__init__(self,
                             relief=None,
                             image=loader.loadModel('models/misc/fade'),
                             image_scale=(5, 2, 2),
                             image_color=(0, 0, 0, 0.80000000000000004),
                             image_pos=(0.5, 0, 0.80000000000000004),
                             state=DGG.NORMAL,
                             pos=(-0.80000000000000004, 0.0,
                                  -0.80000000000000004),
                             sortOrder=20)
        self.confirmBox = DirectFrame(parent=self,
                                      relief=None,
                                      pos=(0.55000000000000004, 0,
                                           0.65000000000000002),
                                      image=guiMain.find('**/general_frame_e'),
                                      image_pos=(0.25, 0, 0.27500000000000002),
                                      image_scale=0.25)
        self.initialiseoptions(MainMenuConfirm)
        titleText = ''
        messageText = ''
        self.type = type
        if self.type == 'logout':
            titleText = PLocalizer.MainMenuLogout
            messageText = PLocalizer.MainMenuLogoutConfirm
        elif self.type == 'quit':
            titleText = PLocalizer.MainMenuQuit
            messageText = PLocalizer.MainMenuQuitConfirm

        self.title = DirectLabel(
            parent=self.confirmBox,
            relief=None,
            text=titleText,
            text_scale=PiratesGuiGlobals.TextScaleExtraLarge,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_font=PiratesGlobals.getPirateOutlineFont(),
            pos=(0.25, 0, 0.41999999999999998))
        self.message = DirectLabel(parent=self.confirmBox,
                                   relief=None,
                                   text=messageText,
                                   text_scale=PiratesGuiGlobals.TextScaleLarge,
                                   text_align=TextNode.ACenter,
                                   text_fg=PiratesGuiGlobals.TextFG2,
                                   text_shadow=PiratesGuiGlobals.TextShadow,
                                   text_wordwrap=11,
                                   pos=(0.25, 0, 0.32500000000000001),
                                   textMayChange=1)
        self.bOk = MainMenuConfirmButton(
            text=PLocalizer.TeleportConfirmOK,
            command=self._MainMenuConfirm__handleOk)
        self.bOk.reparentTo(self.confirmBox)
        self.bOk.setPos(0.10000000000000001, 0, 0.050000000000000003)
        self.bNo = MainMenuConfirmButton(
            text=PLocalizer.TeleportConfirmNo,
            command=self._MainMenuConfirm__handleNo)
        self.bNo.reparentTo(self.confirmBox)
        self.bNo.setPos(0.29999999999999999, 0, 0.050000000000000003)
    def createLevelUpAlert(self, duration, position, posChange):
        textGenerator = TextNode('textGenerator')
        textGenerator.setText(PLocalizer.LevelUp)
        textGenerator.setFont(PiratesGlobals.getPirateOutlineFont())
        textGenerator.clearShadow()
        textGenerator.setAlign(TextNode.ACenter)
        textGenerator.setTextColor(1.0, 1.0, 1.0, 1.0)
        textScale = 0.074999999999999997
        newTextNode = textGenerator.generate()
        newTextDummy = render2d.attachNewNode(newTextNode)
        newTextDummy.setPos(render2d, position)
        newTextDummy.setHpr(render2d, 0.0, 0.0, 0.0)
        newTextDummy.setScale(textScale)
        newTextDummy.setBin('gui-popup', 0)
        if hasattr(self, 'moveUpIval'):
            self.moveUpIval.finish()
            del self.moveUpIval

        if hasattr(self, 'scaleDown'):
            self.scaleDown.finish()
            del self.scaleDown

        if hasattr(self, 'fadeOut'):
            self.fadeOut.finish()
            del self.fadeOut

        if hasattr(self, 'track'):
            self.track.finish()
            del self.track

        self.moveUpIval = newTextDummy.posInterval(duration, position + posChange)
        self.scaleDown = newTextDummy.scaleInterval(duration * 0.75, textScale * 0.69999999999999996, blendType = 'easeInOut')
        self.fadeOut = newTextDummy.colorScaleInterval(duration * 0.25, Vec4(0, 0, 0, 0))
        self.track = Sequence(Parallel(self.moveUpIval, Sequence(Wait(0.25), self.scaleDown), Sequence(Wait(0.75), self.fadeOut)), Func(self.removeExpAlert, newTextDummy))
        self.track.start()
 def createDefenseCannonSkillsText(self):
     if self.levelUpCannonDefenseIval:
         return
     self.levelUpCannonDefenseText = NodePath('levelUpCannonDefenseText')
     self.levelUpCannonDefenseLabel = DirectLabel(
         parent=self.levelUpCannonDefenseText,
         relief=None,
         text='',
         text_font=PiratesGlobals.getPirateOutlineFont(),
         text_fg=(1.0, 1.0, 1.0, 1.0),
         scale=0.075,
         pos=(0, 0, -0.25))
     self.levelUpCannonDefenseIval = Sequence(
         Func(self.levelUpCannonDefenseText.reparentTo, aspect2d),
         Parallel(
             LerpPosInterval(self.levelUpCannonDefenseText,
                             5,
                             pos=Point3(0, 0, 0.3),
                             startPos=Point3(0, 0, -0.3)),
             Sequence(
                 LerpColorScaleInterval(self.levelUpCannonDefenseText,
                                        0.5,
                                        colorScale=VBase4(1, 1, 1, 1),
                                        startColorScale=VBase4(1, 1, 1, 0)),
                 Wait(4),
                 LerpColorScaleInterval(self.levelUpCannonDefenseText,
                                        0.5,
                                        colorScale=VBase4(1, 1, 1, 0),
                                        startColorScale=VBase4(1, 1, 1,
                                                               1)))),
         Func(self.levelUpCannonDefenseText.detachNode))
     return
Esempio n. 8
0
    def __init__(self,
                 showMinutes=0,
                 mode=None,
                 titleText='',
                 titleFg=None,
                 infoText='',
                 cancelText='',
                 cancelCallback=None,
                 alarmTime=0):
        self.showMinutes = showMinutes
        self.mode = mode
        OTPTimer.OTPTimer.__init__(self)
        self['text_pos'] = (0, 0)
        self['text_font'] = PiratesGlobals.getPirateOutlineFont()
        self['text'] = ''
        self.setFontColor(PiratesGuiGlobals.TextFG8)
        self.initialiseoptions(PiratesTimer)
        self.loadDials()
        self.setScale(1)
        self.alarmTime = alarmTime
        self.dialInterval = None
        self.alarmInterval = None
        self.alarmStarted = None
        if self.alarmTime > 0:
            self.alarmSfx = loadSfx(SoundGlobals.SFX_GUI_ALARM)
            self.outOfTimeSfx = loadSfx(SoundGlobals.SFX_GUI_OUT_OF_TIME)

        if titleText or infoText:
            self.createTimerText(titleText, titleFg, infoText)

        if cancelCallback:
            self.createCancelButton(cancelCallback, cancelText)

        self.slide = False
        self.end = False
    def createNoAmmoSlotText(self):
        if self.noAmmoSlotIval:
            return None

        self.noAmmoSlotText = NodePath('noAmmoSlotText')
        self.noAmmoSlotLabel = DirectLabel(
            parent=self.noAmmoSlotText,
            relief=None,
            text='',
            text_font=PiratesGlobals.getPirateOutlineFont(),
            text_fg=(0.10000000000000001, 0.69999999999999996,
                     0.10000000000000001, 1),
            scale=0.074999999999999997,
            pos=(0, 0, -0.25))
        self.noAmmoSlotIval = Sequence(
            Func(self.noAmmoSlotText.reparentTo, aspect2d),
            Parallel(
                LerpPosInterval(self.noAmmoSlotText,
                                5,
                                pos=Point3(0, 0, 0.29999999999999999),
                                startPos=Point3(0, 0, -0.29999999999999999)),
                Sequence(
                    LerpColorScaleInterval(self.noAmmoSlotText,
                                           0.5,
                                           colorScale=VBase4(1, 1, 1, 1),
                                           startColorScale=VBase4(1, 1, 1, 0)),
                    Wait(1),
                    LerpColorScaleInterval(self.noAmmoSlotText,
                                           0.5,
                                           colorScale=VBase4(1, 1, 1, 0),
                                           startColorScale=VBase4(1, 1, 1,
                                                                  1)))),
            Func(self.noAmmoSlotText.detachNode))
 def createNotEnoughBankNotesText(self):
     if self.notEnoughBankNotesIval:
         return
     self.notEnoughBankNotesText = NodePath('notEnoughBankNotesText')
     self.notEnoughBankNotesLabel = DirectLabel(
         parent=self.notEnoughBankNotesText,
         relief=None,
         text='',
         text_font=PiratesGlobals.getPirateOutlineFont(),
         text_fg=(0.1, 0.7, 0.1, 1),
         scale=0.075,
         pos=(0, 0, -0.25))
     self.notEnoughBankNotesIval = Sequence(
         Func(self.notEnoughBankNotesText.reparentTo, aspect2d),
         Parallel(
             LerpPosInterval(self.notEnoughBankNotesText,
                             5,
                             pos=Point3(0, 0, 0.3),
                             startPos=Point3(0, 0, -0.3)),
             Sequence(
                 LerpColorScaleInterval(self.notEnoughBankNotesText,
                                        0.5,
                                        colorScale=VBase4(1, 1, 1, 1),
                                        startColorScale=VBase4(1, 1, 1, 0)),
                 Wait(1),
                 LerpColorScaleInterval(self.notEnoughBankNotesText,
                                        0.5,
                                        colorScale=VBase4(1, 1, 1, 0),
                                        startColorScale=VBase4(1, 1, 1,
                                                               1)))),
         Func(self.notEnoughBankNotesText.detachNode))
     return
Esempio n. 11
0
 def createLevelUpAlert(self, duration, position, posChange):
     textGenerator = TextNode('textGenerator')
     textGenerator.setText(PLocalizer.LevelUp)
     textGenerator.setFont(PiratesGlobals.getPirateOutlineFont())
     textGenerator.clearShadow()
     textGenerator.setAlign(TextNode.ACenter)
     textGenerator.setTextColor(1.0, 1.0, 1.0, 1.0)
     textScale = 0.074999999999999997
     newTextNode = textGenerator.generate()
     newTextDummy = render2d.attachNewNode(newTextNode)
     newTextDummy.setPos(render2d, position)
     newTextDummy.setHpr(render2d, 0.0, 0.0, 0.0)
     newTextDummy.setScale(textScale)
     newTextDummy.setBin('gui-popup', 0)
     if hasattr(self, 'moveUpIval'):
         self.moveUpIval.finish()
         del self.moveUpIval
     
     if hasattr(self, 'scaleDown'):
         self.scaleDown.finish()
         del self.scaleDown
     
     if hasattr(self, 'fadeOut'):
         self.fadeOut.finish()
         del self.fadeOut
     
     if hasattr(self, 'track'):
         self.track.finish()
         del self.track
     
     self.moveUpIval = newTextDummy.posInterval(duration, position + posChange)
     self.scaleDown = newTextDummy.scaleInterval(duration * 0.75, textScale * 0.69999999999999996, blendType = 'easeInOut')
     self.fadeOut = newTextDummy.colorScaleInterval(duration * 0.25, Vec4(0, 0, 0, 0))
     self.track = Sequence(Parallel(self.moveUpIval, Sequence(Wait(0.25), self.scaleDown), Sequence(Wait(0.75), self.fadeOut)), Func(self.removeExpAlert, newTextDummy))
     self.track.start()
Esempio n. 12
0
 def __init__(self, faceId, *args, **kwargs):
     DirectFrame.__init__(self, *args, **args)
     self.initialiseoptions(FaceSpot)
     model = loader.loadModel('models/props/BH_images')
     self.back = DirectFrame(parent=self,
                             relief=None,
                             geom=model.find('**/*bevel'))
     self.dots = DirectFrame(parent=self,
                             relief=None,
                             geom=model.find('**/*dots'))
     spot = model.find('**/*dot')
     self.spots = [
         DirectFrame(parent=self,
                     relief=None,
                     geom=spot,
                     hpr=(0.0, 0.0, (360.0 / 24.0) * x))
         for x in range(self.NUMSTEPS)
     ]
     self.face = DirectFrame(parent=self,
                             relief=None,
                             geom=model.find('**/*face_' + ` faceId `))
     self.cross = DirectFrame(parent=self,
                              relief=None,
                              geom=model.find('**/*x'))
     self.statusLabel = DirectLabel(
         parent=self,
         relief=None,
         pos=(0, 0, 0.5),
         text_scale=0.25,
         text='0',
         text_fg=(1, 1, 1, 1),
         text_shadow=(0, 0, 0, 1),
         textMayChange=1,
         text_font=PiratesGlobals.getPirateOutlineFont())
     self.disable()
 def __init__(self, showMinutes = 0, mode = None, titleText = '', titleFg = None, infoText = '', cancelText = '', cancelCallback = None, alarmTime = 0):
     self.showMinutes = showMinutes
     self.mode = mode
     OTPTimer.OTPTimer.__init__(self)
     self['text_pos'] = (0, 0)
     self['text_font'] = PiratesGlobals.getPirateOutlineFont()
     self['text'] = ''
     self.setFontColor(PiratesGuiGlobals.TextFG8)
     self.initialiseoptions(PiratesTimer)
     self.loadDials()
     self.setScale(1)
     self.alarmTime = alarmTime
     self.dialInterval = None
     self.alarmInterval = None
     self.alarmStarted = None
     if self.alarmTime > 0:
         self.alarmSfx = loadSfx(SoundGlobals.SFX_GUI_ALARM)
         self.outOfTimeSfx = loadSfx(SoundGlobals.SFX_GUI_OUT_OF_TIME)
     
     if titleText or infoText:
         self.createTimerText(titleText, titleFg, infoText)
     
     if cancelCallback:
         self.createCancelButton(cancelCallback, cancelText)
     
     self.slide = False
     self.end = False
Esempio n. 14
0
 def __init__(self,
              parent=base.a2dRightCenter,
              command=None,
              draggable=0,
              **kw):
     optiondefs = (('relief', None, None), ('state', DGG.DISABLED, None),
                   ('frameSize', (0, self.WIDTH, 0, self.HEIGHT), None))
     self.defineoptions(kw, optiondefs)
     DirectFrame.__init__(self, parent, relief=None)
     self.initialiseoptions(AttuneMenu)
     titleFont = PiratesGuiGlobals.TextScaleMed
     textColor = PiratesGuiGlobals.TextFG1
     textShadow = PiratesGuiGlobals.TextShadow
     wordwrap = 13
     self.titleLabel = DirectLabel(
         parent=self,
         relief=None,
         pos=(0.05, 0, self.HEIGHT - PiratesGuiGlobals.TextScaleMed * 2.5),
         text=PLocalizer.UnattuneGui,
         text_align=TextNode.ALeft,
         text_scale=titleFont,
         text_pos=(0.015, 0.05),
         text_fg=textColor,
         text_shadow=textShadow,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         textMayChange=1,
         text_wordwrap=wordwrap,
         sortOrder=21)
     self.buttons = {}
     self.updateButton(0)
     self.hide()
     return
Esempio n. 15
0
    def __init__(self,
                 title,
                 message,
                 command,
                 avId=None,
                 tattoo=None,
                 barber=None,
                 titleScale=PiratesGuiGlobals.TextScaleExtraLarge):
        guiMain = loader.loadModel('models/gui/gui_main')
        DirectFrame.__init__(self,
                             relief=None,
                             pos=(-0.59999999999999998, 0,
                                  0.46999999999999997),
                             image=guiMain.find('**/general_frame_e'),
                             image_pos=(0.25, 0, 0.27500000000000002),
                             image_scale=0.25)
        self.initialiseoptions(PiratesConfirm)
        self.command = command
        self.avId = avId
        self.tattoo = tattoo
        self.barber = barber
        if avId is not None and base.cr.avatarFriendsManager.checkIgnored(
                self.avId):
            self._PiratesConfirm__handleNo()
            return None

        self.title = DirectLabel(
            parent=self,
            relief=None,
            text=title,
            text_scale=titleScale,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_font=PiratesGlobals.getPirateOutlineFont(),
            pos=(0.25, 0, 0.41999999999999998),
            image=None,
            image_scale=0.25)
        text = message
        self.message = DirectLabel(parent=self,
                                   relief=None,
                                   text=message,
                                   text_scale=PiratesGuiGlobals.TextScaleLarge,
                                   text_align=TextNode.ACenter,
                                   text_fg=PiratesGuiGlobals.TextFG2,
                                   text_shadow=PiratesGuiGlobals.TextShadow,
                                   text_wordwrap=11,
                                   pos=(0.25, 0, 0.32500000000000001),
                                   textMayChange=1)
        self.bOk = PiratesConfirmButton(text=PLocalizer.GenericConfirmOK,
                                        command=self._PiratesConfirm__handleOk)
        self.bOk.reparentTo(self)
        self.bOk.setPos(0.10000000000000001, 0, 0.050000000000000003)
        self.bNo = PiratesConfirmButton(text=PLocalizer.GenericConfirmNo,
                                        command=self._PiratesConfirm__handleNo)
        self.bNo.reparentTo(self)
        self.bNo.setPos(0.29999999999999999, 0, 0.050000000000000003)
        self.accept('clientLogout', self.destroy)
Esempio n. 16
0
    def createText(self):
        if self.levelUpIval:
            return None

        self.levelUpSfx = loadSfx(SoundGlobals.SFX_MINIGAME_LEVELUP)
        self.levelUpSfx.setVolume(0.5)
        self.levelUpText = NodePath('text')
        self.levelUpLabel = DirectLabel(
            parent=self.levelUpText,
            relief=None,
            text='',
            text_font=PiratesGlobals.getPirateOutlineFont(),
            text_fg=(0.10000000000000001, 0.69999999999999996,
                     0.10000000000000001, 1),
            text_shadow=(0, 0, 0, 1),
            scale=0.25)
        self.levelUpCategoryLabel = DirectLabel(
            parent=self.levelUpText,
            relief=None,
            text='',
            text_font=PiratesGlobals.getPirateOutlineFont(),
            text_fg=(0.10000000000000001, 0.69999999999999996,
                     0.10000000000000001, 1),
            text_shadow=(0, 0, 0, 1),
            scale=0.125,
            pos=(0, 0, -0.17499999999999999))
        self.levelUpIval = Sequence(
            Func(self.levelUpText.reparentTo, aspect2d),
            Parallel(
                LerpPosInterval(self.levelUpText,
                                5,
                                pos=Point3(0, 0, 0.29999999999999999),
                                startPos=Point3(0, 0, -0.29999999999999999)),
                Sequence(
                    LerpColorScaleInterval(self.levelUpText,
                                           0.5,
                                           colorScale=VBase4(1, 1, 1, 1),
                                           startColorScale=VBase4(1, 1, 1, 0)),
                    Wait(4),
                    LerpColorScaleInterval(self.levelUpText,
                                           0.5,
                                           colorScale=VBase4(1, 1, 1, 0),
                                           startColorScale=VBase4(1, 1, 1,
                                                                  1)))),
            Func(self.levelUpText.detachNode))
Esempio n. 17
0
 def __init__(self,
              name='',
              width=0.40000000000000002,
              height=0.025000000000000001,
              fadeOut=0,
              parent=None,
              originAtMidPt=False):
     DirectFrame.__init__(self, relief=None, parent=parent)
     self.initialiseoptions(HpMeter)
     self.fadeOut = fadeOut
     self.level = 0
     self.value = 0
     self.max = 0
     self.name = name
     self.doId = 0
     self.fader = None
     self.categoryLabel = DirectLabel(
         parent=self,
         relief=None,
         text=self.name,
         text_scale=height + 0.0050000000000000001,
         text_align=TextNode.ALeft,
         text_fg=PiratesGuiGlobals.TextFG1,
         text_shadow=PiratesGuiGlobals.TextShadow,
         pos=(0, 0, height + 0.014999999999999999),
         textMayChange=1,
         text_font=PiratesGlobals.getPirateOutlineFont())
     if originAtMidPt:
         meterPos = (-width / 2.0, 0, 0)
     else:
         meterPos = (0, 0, 0)
     self.meter = DirectWaitBar(parent=self,
                                relief=DGG.RAISED,
                                borderWidth=(0.0040000000000000001,
                                             0.0040000000000000001),
                                range=self.max,
                                value=self.value,
                                frameColor=(0, 0, 0, 1),
                                barColor=(0.10000000000000001,
                                          0.10000000000000001,
                                          0.69999999999999996, 1),
                                pos=meterPos,
                                frameSize=(0, width, 0, height))
     self.valueLabel = DirectLabel(
         parent=self.meter,
         relief=None,
         text='',
         text_scale=PiratesGuiGlobals.TextScaleTiny,
         text_align=TextNode.ACenter,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         pos=(0.20000000000000001, 0, 0.0050000000000000001),
         textMayChange=1)
     self.update(self.value, self.max)
     if not base.config.GetBool('display-enemyHp', 0):
         self.valueLabel.hide()
Esempio n. 18
0
 def __init__(self, avId, isManager, version):
     guiMain = loader.loadModel('models/gui/gui_main')
     DirectFrame.__init__(self,
                          relief=None,
                          pos=(-0.25, 0, -0.15),
                          image=guiMain.find('**/general_frame_e'),
                          image_pos=(0.25, 0, 0.275),
                          image_scale=0.25)
     self.initialiseoptions(CrewRejoin)
     self.avId = avId
     self.isManager = isManager
     self.version = version
     if base.cr.avatarFriendsManager.checkIgnored(self.avId):
         self.__handleNo()
         return
     titleUI = loader.loadModel('models/gui/ship_battle')
     guiMain = loader.loadModel('models/gui/gui_main')
     self.title = DirectLabel(
         parent=self,
         relief=None,
         text=PLocalizer.CrewRejoinTitle,
         text_scale=PiratesGuiGlobals.TextScaleExtraLarge,
         text_align=TextNode.ACenter,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         pos=(0.25, 0, 0.42),
         image_scale=0.25)
     if version == 2:
         text = PLocalizer.CrewRejoinParlorInvitation
     else:
         if version == 1:
             text = PLocalizer.CrewRejoinPVPInvitation
         else:
             text = PLocalizer.CrewRejoinInvitation
     self.message = DirectLabel(parent=self,
                                relief=None,
                                text=text,
                                text_scale=PiratesGuiGlobals.TextScaleLarge,
                                text_align=TextNode.ACenter,
                                text_fg=PiratesGuiGlobals.TextFG2,
                                text_shadow=PiratesGuiGlobals.TextShadow,
                                text_wordwrap=11,
                                pos=(0.25, 0, 0.325),
                                textMayChange=1)
     self.bOk = CrewRejoinButton(text=PLocalizer.CrewRejoinOK,
                                 command=self.__handleOk)
     self.bOk.reparentTo(self)
     self.bOk.setPos(0.1, 0, 0.05)
     self.bNo = CrewRejoinButton(text=PLocalizer.CrewRejoinNo,
                                 command=self.__handleNo)
     self.bNo.reparentTo(self)
     self.bNo.setPos(0.3, 0, 0.05)
     self.accept('BandRejoinCancel-%s' % (self.avId, ),
                 self.__handleCancelFromAbove)
     return
Esempio n. 19
0
def genTextEffect(targetObj, textGenerator, number, bonus, isNpc, cleanupCallback, startPos, destPos=None, scale=1.0, modifiers={}, effects=[]):
    textGenerator.setFont(PiratesGlobals.getPirateOutlineFont())
    text, baseVal, mods = genText(number, bonus, MOD_TYPE_MULTIPLE, modifiers, effects)
    duration = 2.0 + len(mods)
    textGenerator.setText(text % str(baseVal))
    textGenerator.clearShadow()
    textGenerator.setAlign(TextNode.ACenter)
    color = genColor(number, bonus, isNpc, effects)
    newEffect = TextEffect(textGenerator, bonus, targetObj, scale, startPos, duration, text, baseVal, mods, cleanupCallback, destPos, color)
    return newEffect
def genTextEffect(targetObj, textGenerator, number, bonus, isNpc, cleanupCallback, startPos, destPos = None, scale = 1.0, modifiers = { }, effects = []):
    textGenerator.setFont(PiratesGlobals.getPirateOutlineFont())
    (text, baseVal, mods) = genText(number, bonus, MOD_TYPE_MULTIPLE, modifiers, effects)
    duration = 2.0 + len(mods)
    textGenerator.setText(text % str(baseVal))
    textGenerator.clearShadow()
    textGenerator.setAlign(TextNode.ACenter)
    color = genColor(number, bonus, isNpc, effects)
    newEffect = TextEffect(textGenerator, bonus, targetObj, scale, startPos, duration, text, baseVal, mods, cleanupCallback, destPos, color)
    return newEffect
 def __init__(self,
              hotkeys=(),
              hotkeyLabel='J',
              helpText=None,
              parent=None,
              **kw):
     gui = loader.loadModel('models/gui/toplevel_gui')
     iconTexture = gui.find('**/topgui_icon_journal')
     gui.removeNode()
     del gui
     optiondefs = (('image', iconTexture, None), ('image_scale', 0.5, None),
                   ('sortOrder', 1, None), ('relief', None, None))
     self.defineoptions(kw, optiondefs)
     GuiButton.GuiButton.__init__(self,
                                  hotkeys=hotkeys,
                                  hotkeyLabel=hotkeyLabel,
                                  helpText=helpText,
                                  parent=parent)
     self.initialiseoptions(JournalButton)
     self.questCounter = 0
     self.infoText = DirectFrame(
         parent=self,
         relief=None,
         text=PLocalizer.JournalButtonInfo,
         text_align=TextNode.ACenter,
         text_scale=PiratesGuiGlobals.TextScaleLarge,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_font=PiratesGlobals.getPirateBoldOutlineFont(),
         textMayChange=1,
         pos=(0, 0, 0.1))
     self.numberText = DirectFrame(
         parent=self,
         relief=None,
         text=str(self.questCounter),
         text_align=TextNode.ACenter,
         text_scale=0.08,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         textMayChange=1,
         pos=(0, 0, -0.01))
     self.hotkeyLabel = DirectLabel(
         parent=self,
         relief=None,
         state=DGG.DISABLED,
         text=hotkeyLabel,
         text_font=PiratesGlobals.getPirateBoldOutlineFont(),
         text_align=TextNode.ARight,
         text_scale=PiratesGuiGlobals.TextScaleSmall,
         text_pos=(0.1, -0.04),
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         textMayChange=0)
     return
 def __createWaitingLabel(self):
     self.__destroyWaitingLabel()
     self.__lblwaitingFor = OnscreenText(
         parent=base.a2dTopCenter,
         pos=(0.0, -0.13),
         text=PLocalizer.CannonDefense['Waiting'],
         font=PiratesGlobals.getPirateOutlineFont(),
         scale=0.09,
         align=TextNode.ACenter,
         shadow=PiratesGuiGlobals.TextShadow,
         fg=PiratesGuiGlobals.TextFG1)
Esempio n. 23
0
 def __init__(self, parent, **kw):
     DirectFrame.__init__(self, parent, **None)
     self.initialiseoptions(VitaeMeter)
     toplevel_gui = loader.loadModel('models/gui/toplevel_gui')
     self.vitaeDial = DialMeter(parent=self,
                                meterColor=Vec4(0.80000000000000004,
                                                0.20000000000000001,
                                                0.20000000000000001, 1),
                                baseColor=Vec4(0, 0, 0, 1),
                                scale=0.28000000000000003)
     icon = toplevel_gui.find('**/morale_skull*')
     self.vitaeIcon = DirectFrame(parent=self,
                                  state=DGG.NORMAL,
                                  relief=None,
                                  image=icon,
                                  image_scale=0.625)
     detailLabel = DirectLabel(
         relief=None,
         state=DGG.DISABLED,
         text=PLocalizer.VitaeDesc,
         text_align=TextNode.ALeft,
         text_scale=PiratesGuiGlobals.TextScaleExtraLarge,
         text_fg=PiratesGuiGlobals.TextFG1,
         text_wordwrap=15,
         text_shadow=(0, 0, 0, 1),
         pos=(0.0, 0, -0.025000000000000001),
         textMayChange=0,
         sortOrder=91)
     height = -(detailLabel.getHeight() + 0.01)
     width = max(0.25, detailLabel.getWidth() + 0.040000000000000001)
     self.helpBox = BorderFrame(parent=self,
                                state=DGG.DISABLED,
                                modelName='general_frame_f',
                                frameSize=(-0.040000000000000001, width,
                                           height, 0.050000000000000003),
                                pos=(0.050000000000000003, 0,
                                     -0.050000000000000003),
                                sortOrder=90)
     detailLabel.reparentTo(self.helpBox)
     self.helpBox.hide()
     self.helpBox.setClipPlaneOff()
     self.meterLabel = DirectLabel(
         parent=self.vitaeDial,
         relief=None,
         pos=(0, 0, -0.45000000000000001),
         text=PLocalizer.Vitae,
         text_scale=0.20000000000000001,
         text_align=TextNode.ACenter,
         text_fg=PiratesGuiGlobals.TextFG1,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         textMayChange=1)
     self.vitaeIcon.bind(DGG.WITHIN, self.showDetails)
     self.vitaeIcon.bind(DGG.WITHOUT, self.hideDetails)
Esempio n. 24
0
 def __init__(self, panelNumber, numOfPanels, **kw):
     DirectFrame.__init__(self, **kw)
     self.hide()
     self.panelNumber = panelNumber
     self.numOfPanels = numOfPanels
     self.playerLbls = []
     self.shipsSunkTotalslbl = []
     self.damageTotalslbl = []
     self.accuracyTotalslbl = []
     self.shotsFiredTotalslbl = []
     self.headingfont = PiratesGlobals.getPirateOutlineFont()
     self.bodyfont = PiratesGlobals.getPirateFont()
     self.highlightPlayerColor = PiratesGuiGlobals.TextFG4
 def __init__(self, panelNumber, numOfPanels, **kw):
     DirectFrame.__init__(self)
     self.hide()
     self.panelNumber = panelNumber
     self.numOfPanels = numOfPanels
     self.playerLbls = []
     self.shipsSunkTotalslbl = []
     self.damageTotalslbl = []
     self.accuracyTotalslbl = []
     self.shotsFiredTotalslbl = []
     self.headingfont = PiratesGlobals.getPirateOutlineFont()
     self.bodyfont = PiratesGlobals.getPirateFont()
     self.highlightPlayerColor = PiratesGuiGlobals.TextFG4
Esempio n. 26
0
 def announceGenerate(self):
     DistributedGameTable.DistributedGameTable.announceGenerate(self)
     self.timerLabel = DirectLabel(
         relief=None,
         text='',
         text_fg=(1, 1, 1, 1),
         text_shadow=(0, 0, 0, 1),
         textMayChange=1,
         text_font=PiratesGlobals.getPirateOutlineFont())
     self.timerLabel.setZ(5)
     self.timerLabel.setBillboardPointEye()
     self.timerLabel.reparentTo(self)
     self.resultsFrame = ResultsFrame()
Esempio n. 27
0
 def __init__(self,
              title,
              message,
              commandOkay,
              commandCancel,
              titleScale=PiratesGuiGlobals.TextScaleExtraLarge):
     guiMain = loader.loadModel('models/gui/gui_main')
     DirectFrame.__init__(self,
                          relief=None,
                          pos=(-0.59999999999999998, 0,
                               0.46999999999999997),
                          image=guiMain.find('**/general_frame_e'),
                          image_pos=(0.25, 0, 0.27500000000000002),
                          image_scale=0.25)
     self.initialiseoptions(ShipUpgradeConfirm)
     self.setBin('gui-fixed', 0)
     self.commandOkay = commandOkay
     self.commandCancel = commandCancel
     self.title = DirectLabel(
         parent=self,
         relief=None,
         text=title,
         text_scale=titleScale,
         text_align=TextNode.ACenter,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         pos=(0.25, 0, 0.41999999999999998),
         image=None,
         image_scale=0.25)
     text = message
     self.message = DirectLabel(parent=self,
                                relief=None,
                                text=message,
                                text_scale=PiratesGuiGlobals.TextScaleLarge,
                                text_align=TextNode.ACenter,
                                text_fg=PiratesGuiGlobals.TextFG2,
                                text_shadow=PiratesGuiGlobals.TextShadow,
                                text_wordwrap=11,
                                pos=(0.25, 0, 0.32500000000000001),
                                textMayChange=1)
     self.bOk = PiratesConfirmButton(
         text=PLocalizer.GenericConfirmOK,
         command=self._ShipUpgradeConfirm__handleOk)
     self.bOk.reparentTo(self)
     self.bOk.setPos(0.10000000000000001, 0, 0.050000000000000003)
     self.bNo = PiratesConfirmButton(
         text=PLocalizer.GenericConfirmNo,
         command=self._ShipUpgradeConfirm__handleNo)
     self.bNo.reparentTo(self)
     self.bNo.setPos(0.29999999999999999, 0, 0.050000000000000003)
 def announceGenerate(self):
     DistributedGameTable.DistributedGameTable.announceGenerate(self)
     self.timerLabel = DirectLabel(
         relief=None,
         text="",
         text_fg=(1, 1, 1, 1),
         text_shadow=(0, 0, 0, 1),
         textMayChange=1,
         text_font=PiratesGlobals.getPirateOutlineFont(),
     )
     self.timerLabel.setZ(5)
     self.timerLabel.setBillboardPointEye()
     self.timerLabel.reparentTo(self)
     self.resultsFrame = ResultsFrame()
Esempio n. 29
0
    def __init__(self, avId, avName):
        SocialPage.SocialPage.__init__(self, 'TeleportConfirm')
        self.initialiseoptions(TeleportConfirm)
        self.setPos(-0.25, 0, -0.14999999999999999)
        self.avId = avId
        self.avName = avName
        if base.cr.avatarFriendsManager.checkIgnored(self.avId):
            self._TeleportConfirm__handleNo()
            return None

        guiMain = loader.loadModel('models/gui/gui_main')
        self.box = OnscreenImage(parent=self,
                                 pos=(0.25, 0, 0.27500000000000002),
                                 image=guiMain.find('**/general_frame_e'),
                                 scale=0.25)
        self.title = DirectLabel(
            parent=self,
            relief=None,
            text=PLocalizer.TeleportConfirmTitle,
            text_scale=PiratesGuiGlobals.TextScaleExtraLarge,
            text_align=TextNode.ACenter,
            text_fg=PiratesGuiGlobals.TextFG2,
            text_shadow=PiratesGuiGlobals.TextShadow,
            text_font=PiratesGlobals.getPirateOutlineFont(),
            pos=(0.25, 0, 0.41999999999999998))
        text = PLocalizer.TeleportConfirmMessage % self.avName
        self.message = DirectLabel(parent=self,
                                   relief=None,
                                   text=text,
                                   text_scale=PiratesGuiGlobals.TextScaleLarge,
                                   text_align=TextNode.ACenter,
                                   text_fg=PiratesGuiGlobals.TextFG2,
                                   text_shadow=PiratesGuiGlobals.TextShadow,
                                   text_wordwrap=11,
                                   pos=(0.25, 0, 0.32500000000000001),
                                   textMayChange=1)
        self.bOk = TeleportConfirmButton(
            text=PLocalizer.TeleportConfirmOK,
            command=self._TeleportConfirm__handleOk)
        self.bOk.reparentTo(self)
        self.bOk.setPos(0.10000000000000001, 0, 0.050000000000000003)
        self.bNo = TeleportConfirmButton(
            text=PLocalizer.TeleportConfirmNo,
            command=self._TeleportConfirm__handleNo)
        self.bNo.reparentTo(self)
        self.bNo.setPos(0.29999999999999999, 0, 0.050000000000000003)
        av = base.cr.getDo(avId)
        if av:
            self.accept(av.getDisableEvent(),
                        self._TeleportConfirm__handleAvatarLeft)
Esempio n. 30
0
 def __init__(self, showMinutes = 0, mode = None, titleText = '', titleFg = None, infoText = '', cancelText = '', cancelCallback = None):
     self.showMinutes = showMinutes
     self.mode = mode
     OTPTimer.OTPTimer.__init__(self)
     self.initialiseoptions(PiratesTimerHourglass)
     self['text_font'] = PiratesGlobals.getPirateOutlineFont()
     self.setFontColor(Vec4(1, 1, 1, 1))
     if titleText or infoText:
         self.createTimerText(titleText, titleFg, infoText)
     
     if cancelCallback:
         self.createCancelButton(cancelCallback, cancelText)
     
     self.getImage()
     self.slide = False
Esempio n. 31
0
 def loadUseLabel(self):
     self.useLabel = DirectLabel(
         parent=aspect2d,
         frameColor=(0.1, 0.1, 0.25, 0.2),
         text='',
         text_align=TextNode.ACenter,
         text_scale=0.06,
         text_pos=(0.02, 0.02),
         text_fg=(1, 1, 1, 1),
         text_shadow=(0, 0, 0, 1),
         textMayChange=1,
         text_font=PiratesGlobals.getPirateOutlineFont())
     self.useLabel.setPos(0, 0, -0.7)
     self.useLabel.setAlphaScale(0)
     self.useLabel.hide()
Esempio n. 32
0
 def __init__(self, shardId):
     guiMain = loader.loadModel('models/gui/gui_main')
     DirectFrame.__init__(self,
                          relief=None,
                          pos=(-0.25, 0, -0.14999999999999999),
                          image=guiMain.find('**/general_frame_e'),
                          image_pos=(0.25, 0, 0.27500000000000002),
                          image_scale=0.25)
     self.initialiseoptions(LeaveCrewWarning)
     self.setBin('gui-fixed', 1)
     self.shardId = shardId
     guiMain = loader.loadModel('models/gui/gui_main')
     self.box = OnscreenImage(parent=self,
                              pos=(0.25, 0, 0.27500000000000002),
                              image=guiMain.find('**/general_frame_e'),
                              scale=0.25)
     self.title = DirectLabel(
         parent=self,
         relief=None,
         text=PLocalizer.LeaveCrewWarningTitle,
         text_scale=PiratesGuiGlobals.TextScaleExtraLarge,
         text_align=TextNode.ACenter,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         pos=(0.25, 0, 0.41999999999999998))
     text = PLocalizer.LeaveCrewWarningMessage
     self.message = DirectLabel(parent=self,
                                relief=None,
                                text=text,
                                text_scale=PiratesGuiGlobals.TextScaleLarge,
                                text_align=TextNode.ACenter,
                                text_fg=PiratesGuiGlobals.TextFG2,
                                text_shadow=PiratesGuiGlobals.TextShadow,
                                text_wordwrap=11,
                                pos=(0.25, 0, 0.32500000000000001),
                                textMayChange=1)
     self.bOk = LeaveCrewWarningButton(
         text=PLocalizer.LeaveCrewWarningOK,
         command=self._LeaveCrewWarning__handleOk)
     self.bOk.reparentTo(self)
     self.bOk.setPos(0.10000000000000001, 0, 0.050000000000000003)
     self.bNo = LeaveCrewWarningButton(
         text=PLocalizer.LeaveCrewWarningNo,
         command=self._LeaveCrewWarning__handleNo)
     self.bNo.reparentTo(self)
     self.bNo.setPos(0.29999999999999999, 0, 0.050000000000000003)
Esempio n. 33
0
 def __init__(self, avId, avName):
     SocialPage.SocialPage.__init__(self, 'PVPInvitee')
     self.initialiseoptions(PVPInvitee)
     self.setPos(-0.59999999999999998, 0, 0.46999999999999997)
     self.avId = avId
     self.avName = avName
     guiMain = loader.loadModel('models/gui/gui_main')
     self.box = OnscreenImage(parent=self,
                              pos=(0.25, 0, 0.27500000000000002),
                              image=guiMain.find('**/general_frame_e'),
                              scale=0.25)
     self.title = DirectLabel(
         parent=self,
         relief=None,
         text=PLocalizer.PVPInviteeTitle,
         text_scale=PiratesGuiGlobals.TextScaleExtraLarge,
         text_align=TextNode.ACenter,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         pos=(0.25, 0, 0.41999999999999998),
         image=None,
         image_scale=0.25)
     text = PLocalizer.PVPInviteeInvitation % self.avName
     self.message = DirectLabel(parent=self,
                                relief=None,
                                text=text,
                                text_scale=PiratesGuiGlobals.TextScaleLarge,
                                text_align=TextNode.ACenter,
                                text_fg=PiratesGuiGlobals.TextFG2,
                                text_shadow=PiratesGuiGlobals.TextShadow,
                                text_wordwrap=11,
                                pos=(0.25, 0, 0.32500000000000001),
                                textMayChange=1)
     self.bOk = PVPInviteeButton(text=OTPLocalizer.DialogOK,
                                 command=self._PVPInvitee__handleOk)
     self.bOk.reparentTo(self)
     self.bOk.setPos(0.10000000000000001, 0, 0.10000000000000001)
     self.bNo = PVPInviteeButton(text=OTPLocalizer.DialogNo,
                                 command=self._PVPInvitee__handleNo)
     self.bNo.reparentTo(self)
     self.bNo.setPos(0.29999999999999999, 0, 0.10000000000000001)
     self.accept('cancelChallengeInvitation',
                 self._PVPInvitee__handleCancelFromAbove)
 def updateBrigadeText(self):
     if self.brigadeText and self.parentObj.minimapArea:
         self.brigadeText.destroy()
         self.brigadeText = None
     elif not (self.brigadeText) and not (self.parentObj.minimapArea) and self.parentObj.minimap:
         self.brigadeText = DirectLabel(
             parent=self.parentObj.minimap.getOverlayNode(),
             relief=None,
             text=PLocalizer.InvasionJollyRogerBrigadeUpdate
             % (self.currentPhase, self.totalPhases - self.currentPhase),
             text_align=TextNode.ALeft,
             text_fg=PiratesGuiGlobals.TextFG2,
             text_font=PiratesGlobals.getPirateOutlineFont(),
             text_shadow=PiratesGuiGlobals.TextShadow,
             textMayChange=1,
             scale=40,
             pos=(-800, -600, 0),
             hpr=(0, -90, 0),
         )
Esempio n. 35
0
 def updateBrigadeText(self):
     if self.brigadeText and self.parentObj.minimapArea:
         self.brigadeText.destroy()
         self.brigadeText = None
     elif not self.brigadeText and not self.parentObj.minimapArea and self.parentObj.minimap:
         self.brigadeText = DirectLabel(
             parent=self.parentObj.minimap.getOverlayNode(),
             relief=None,
             text=PLocalizer.InvasionJollyRogerBrigadeUpdate %
             (self.currentPhase, self.totalPhases - self.currentPhase),
             text_align=TextNode.ALeft,
             text_fg=PiratesGuiGlobals.TextFG2,
             text_font=PiratesGlobals.getPirateOutlineFont(),
             text_shadow=PiratesGuiGlobals.TextShadow,
             textMayChange=1,
             scale=60,
             pos=(-800, -200, 0),
             hpr=(0, -90, 0))
     return
Esempio n. 36
0
 def __init__(self, avId, avName):
     guiMain = loader.loadModel('models/gui/gui_main')
     DirectFrame.__init__(self,
                          relief=None,
                          pos=(-0.6, 0, 0.47),
                          image=guiMain.find('**/general_frame_e'),
                          image_pos=(0.25, 0, 0.275),
                          image_scale=0.25)
     self.initialiseoptions(CrewBoot)
     self.avId = avId
     self.avName = avName
     self.title = DirectLabel(
         parent=self,
         relief=None,
         text=PLocalizer.CrewBootTitle,
         text_scale=PiratesGuiGlobals.TextScaleExtraLarge,
         text_align=TextNode.ACenter,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         text_font=PiratesGlobals.getPirateOutlineFont(),
         pos=(0.25, 0, 0.42))
     text = PLocalizer.CrewBootMessage % self.avName
     self.message = DirectLabel(parent=self,
                                relief=None,
                                text=text,
                                text_scale=PiratesGuiGlobals.TextScaleLarge,
                                text_align=TextNode.ACenter,
                                text_fg=PiratesGuiGlobals.TextFG2,
                                text_shadow=PiratesGuiGlobals.TextShadow,
                                text_wordwrap=11,
                                pos=(0.25, 0, 0.325),
                                textMayChange=1)
     self.bOk = CrewBootButton(text=PLocalizer.CrewBootOK,
                               command=self.__handleOk)
     self.bOk.reparentTo(self)
     self.bOk.setPos(0.1, 0, 0.05)
     self.bNo = CrewBootButton(text=PLocalizer.CrewBootNo,
                               command=self.__handleNo)
     self.bNo.reparentTo(self)
     self.bNo.setPos(0.3, 0, 0.05)
     return
Esempio n. 37
0
 def __init__(self):
     DirectObject.DirectObject.__init__(self)
     self.event = None
     self.sfx = None
     self.text = DirectLabel(
         parent=aspect2d,
         relief=None,
         text='',
         text_align=TextNode.ACenter,
         text_scale=0.059999999999999998,
         text_fg=PiratesGuiGlobals.TextFG2,
         text_shadow=PiratesGuiGlobals.TextShadow,
         textMayChange=1,
         pos=(0, 0, -0.90000000000000002),
         text_font=PiratesGlobals.getPirateOutlineFont(),
         sortOrder=80,
         state=DGG.DISABLED)
     self.text.hide()
     self.fader = None
     self.subtitleParent = render2d.attachNewNode(PGTop('subtitleParent'))
     self.subtitleParent.node().setMouseWatcher(base.mouseWatcherNode)
 def __init__(self, parent = base.a2dRightCenter, command = None, draggable = 0, **kw):
     optiondefs = (('relief', None, None), ('state', DGG.DISABLED, None), ('frameSize', (0, self.WIDTH, 0, self.HEIGHT), None))
     self.defineoptions(kw, optiondefs)
     DirectFrame.__init__(self, parent, relief = None)
     self.initialiseoptions(AttuneMenu)
     titleFont = PiratesGuiGlobals.TextScaleMed
     textColor = PiratesGuiGlobals.TextFG1
     textShadow = PiratesGuiGlobals.TextShadow
     wordwrap = 13
     self.titleLabel = DirectLabel(parent = self, relief = None, pos = (0.050000000000000003, 0, self.HEIGHT - PiratesGuiGlobals.TextScaleMed * 2.5), text = PLocalizer.UnattuneGui, text_align = TextNode.ALeft, text_scale = titleFont, text_pos = (0.014999999999999999, 0.050000000000000003), text_fg = textColor, text_shadow = textShadow, text_font = PiratesGlobals.getPirateOutlineFont(), textMayChange = 1, text_wordwrap = wordwrap, sortOrder = 21)
     self.buttons = { }
     self.updateButton(0)
     self.hide()
    def setPanel(self, contextId, number, type, part):
        oldData = "%s%s%s" % (self.contextId, self.number, self.part)
        newData = "%s%s%s" % (contextId, number, part)
        if oldData == newData:
            return None

        if self.titleLabels.has_key(oldData):
            self.titleLabels[oldData].hide()
            self.messageLabels[oldData].hide()

        self.contextId = contextId
        self.number = number
        self.part = part
        if self.titleLabels.has_key(newData):
            self.titleLabels[newData].show()
            self.messageLabels[newData].show()
            self.contextId = contextId
        else:
            title = ""
            message = ""
            if contextId == InventoryType.BuyNewShip:
                if number == 0:
                    title = (
                        PLocalizer.ContextPanelTitles.get(contextId) % PLocalizer.ShipClassNames[ShipGlobals.MERCHANTL1]
                    )
                    message = (
                        PLocalizer.ContextPanelMessages.get(contextId)
                        % PLocalizer.ShipClassNames[ShipGlobals.MERCHANTL1]
                    )
                elif number == 1:
                    title = (
                        PLocalizer.ContextPanelTitles.get(contextId) % PLocalizer.ShipClassNames[ShipGlobals.WARSHIPL1]
                    )
                    message = (
                        PLocalizer.ContextPanelMessages.get(contextId)
                        % PLocalizer.ShipClassNames[ShipGlobals.WARSHIPL1]
                    )
                elif number == 2:
                    title = (
                        PLocalizer.ContextPanelTitles.get(contextId)
                        % PLocalizer.ShipClassNames[ShipGlobals.INTERCEPTORL2]
                    )
                    message = (
                        PLocalizer.ContextPanelMessages.get(contextId)
                        % PLocalizer.ShipClassNames[ShipGlobals.INTERCEPTORL2]
                    )
                elif number == 3:
                    title = (
                        PLocalizer.ContextPanelTitles.get(contextId) % PLocalizer.ShipClassNames[ShipGlobals.MERCHANTL2]
                    )
                    message = (
                        PLocalizer.ContextPanelMessages.get(contextId)
                        % PLocalizer.ShipClassNames[ShipGlobals.MERCHANTL2]
                    )
                elif number == 4:
                    title = (
                        PLocalizer.ContextPanelTitles.get(contextId) % PLocalizer.ShipClassNames[ShipGlobals.WARSHIPL2]
                    )
                    message = (
                        PLocalizer.ContextPanelMessages.get(contextId)
                        % PLocalizer.ShipClassNames[ShipGlobals.WARSHIPL2]
                    )
                elif number == 5:
                    title = (
                        PLocalizer.ContextPanelTitles.get(contextId)
                        % PLocalizer.ShipClassNames[ShipGlobals.INTERCEPTORL3]
                    )
                    message = (
                        PLocalizer.ContextPanelMessages.get(contextId)
                        % PLocalizer.ShipClassNames[ShipGlobals.INTERCEPTORL3]
                    )
                elif number == 6:
                    title = (
                        PLocalizer.ContextPanelTitles.get(contextId) % PLocalizer.ShipClassNames[ShipGlobals.MERCHANTL3]
                    )
                    message = (
                        PLocalizer.ContextPanelMessages.get(contextId)
                        % PLocalizer.ShipClassNames[ShipGlobals.MERCHANTL3]
                    )
                elif number == 7:
                    title = (
                        PLocalizer.ContextPanelTitles.get(contextId) % PLocalizer.ShipClassNames[ShipGlobals.WARSHIPL3]
                    )
                    message = (
                        PLocalizer.ContextPanelMessages.get(contextId)
                        % PLocalizer.ShipClassNames[ShipGlobals.WARSHIPL3]
                    )

            elif number:
                title = PLocalizer.ContextPanelTitles.get(contextId).get(number)
                message = PLocalizer.ContextPanelMessages.get(contextId).get(number)
            else:
                title = PLocalizer.ContextPanelTitles.get(contextId)
                message = PLocalizer.ContextPanelMessages.get(contextId)
            if contextId == InventoryType.BrokenHull:
                if part == 1:
                    title = title % PLocalizer.Left
                    message = message % PLocalizer.Left
                else:
                    title = title % PLocalizer.Right
                    message = message % PLocalizer.Right
            elif contextId == InventoryType.SearchableContainers:
                if part == 1:
                    title = title % PLocalizer.ContextTutBuriedTreasure
                else:
                    title = title % PLocalizer.ContextTutSearchableContainers
            elif contextId == InventoryType.NewSkillPoint:
                if part == 1:
                    title = title % PLocalizer.InventoryTypeNames[InventoryType.CutlassRep]
                    message = message % PLocalizer.InventoryTypeNames[InventoryType.CutlassRep]
                elif part == 2:
                    title = title % PLocalizer.InventoryTypeNames[InventoryType.PistolRep]
                    message = message % PLocalizer.InventoryTypeNames[InventoryType.PistolRep]
                elif part == 3:
                    title = title % PLocalizer.InventoryTypeNames[InventoryType.DaggerRep]
                    message = message % PLocalizer.InventoryTypeNames[InventoryType.DaggerRep]
                elif part == 4:
                    title = title % PLocalizer.InventoryTypeNames[InventoryType.GrenadeRep]
                    message = message % PLocalizer.InventoryTypeNames[InventoryType.GrenadeRep]
                elif part == 5:
                    title = title % PLocalizer.InventoryTypeNames[InventoryType.WandRep]
                    message = message % PLocalizer.InventoryTypeNames[InventoryType.WandRep]
                elif part == 6:
                    title = title % PLocalizer.InventoryTypeNames[InventoryType.DollRep]
                    message = message % PLocalizer.InventoryTypeNames[InventoryType.DollRep]
                elif part == 7:
                    title = title % PLocalizer.InventoryTypeNames[InventoryType.CannonRep]
                    message = message % PLocalizer.InventoryTypeNames[InventoryType.CannonRep]
                elif part == 8:
                    title = title % PLocalizer.InventoryTypeNames[InventoryType.SailingRep]
                    message = message % PLocalizer.InventoryTypeNames[InventoryType.SailingRep]

            elif contextId == InventoryType.DockCommands and number == 4:
                self.accept("space", self.closePanel)
            elif contextId == InventoryType.ChatPreferences:
                if part == 1:
                    message = message % PLocalizer.SpeedChatPlusPreferences
                else:
                    message = message % PLocalizer.SpeedChatPreferences
            elif contextId == InventoryType.FishingTutorial:
                pass

            if not title:
                return False

            titleLabel = DirectLabel(
                parent=self,
                relief=None,
                text=title,
                text_align=TextNode.ACenter,
                text_scale=PiratesGuiGlobals.TextScaleExtraLarge,
                text_fg=(0.59999999999999998, 0.0, 0.0, 1.0),
                text_font=PiratesGlobals.getPirateOutlineFont(),
                text_wordwrap=8,
                textMayChange=1,
                pos=(0.0, 0, 0.13),
            )
            messageLabel = DirectLabel(
                parent=self,
                relief=None,
                text=message,
                text_align=TextNode.ALeft,
                text_scale=PiratesGuiGlobals.TextScaleMed,
                text_fg=PiratesGuiGlobals.TextFG0,
                text_font=PiratesGlobals.getPirateFont(),
                text_shadow=PiratesGuiGlobals.TextShadow,
                text_wordwrap=14,
                textMayChange=1,
                pos=(-0.20000000000000001, 0, 0.070000000000000007),
            )
            titleBounds = titleLabel.getBounds()
            messageBounds = messageLabel.getBounds()
            messageLabel.setZ(0.040000000000000001 + titleBounds[2] - (messageBounds[3] + messageBounds[2]) * 0.5)
            if titleBounds[3] - titleBounds[2] > 0.089999999999999997:
                messageLabel.setZ(messageLabel.getZ() + 0.012500000000000001)

            self.filled = True
            self.titleLabels[newData] = titleLabel
            self.messageLabels[newData] = messageLabel
        if self.noHintsLabels.has_key(self.type):
            self.noHintsLabels[self.type].hide()

        if self.noHintsLabels.has_key(type):
            if contextId in (InventoryType.ChatPreferences, InventoryType.CursedBlades):
                self.noHintsLabels[type].hide()
                self.noHintsCheck.hide()
            else:
                self.noHintsLabels[type].show()
                self.noHintsCheck.show()
        elif self.noHintsLabels.has_key(self.type):
            self.noHintsLabels[self.type].hide()

        if contextId in (InventoryType.ChatPreferences, InventoryType.CursedBlades):
            text = ""
        else:
            text = PLocalizer.ContextPanelNoMoreHints % PLocalizer.ContextPanelTypes[type]
        noHintsLabel = DirectLabel(
            parent=self,
            relief=None,
            text=text,
            text_align=TextNode.ALeft,
            text_scale=PiratesGuiGlobals.TextScaleSmall,
            text_fg=PiratesGuiGlobals.TextFG0,
            textMayChange=1,
            pos=(-0.14000000000000001, 0, -0.12),
        )
        if contextId in (InventoryType.ChatPreferences, InventoryType.CursedBlades):
            self.noHintsCheck.hide()
            noHintsLabel.hide()
        else:
            self.noHintsCheck.show()
            noHintsLabel.show()
        self.noHintsLabels[type] = noHintsLabel
        self.type = type
        return True
 def __init__(self, avId, avName, guildId, canpromote, candemote, cankick):
     guiMain = loader.loadModel('models/gui/gui_main')
     DirectFrame.__init__(self, relief = None, pos = (-0.59999999999999998, 0, 0.41999999999999998), image = guiMain.find('**/general_frame_e'), image_pos = (0.25, 0, 0.23999999999999999), image_scale = (0.29999999999999999, 0.0, 0.34000000000000002))
     self.initialiseoptions(GuildMember)
     self.avId = avId
     self.avName = avName
     self.guildId = guildId
     self.canpromote = canpromote
     self.candemote = candemote
     self.cankick = cankick
     rank = base.cr.guildManager.getRank(avId)
     self.title = None
     self.message = None
     self.avocateMessage = None
     self.bTopEditButton = None
     self.bBottomEditButton = None
     self.bKick = None
     self.bAvocateConfrim = None
     self.bAvocateCancel = None
     self.bAvocate = None
     guiMain = loader.loadModel('models/gui/gui_main')
     self.title = DirectLabel(parent = self, relief = None, text = OTPLocalizer.GuildMemberTitle, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), pos = (0.25, 0, 0.44))
     self.message = DirectLabel(parent = self, relief = None, text = avName, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = (0.90000000000000002, 1, 0.90000000000000002, 1), text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.25, 0, 0.34499999999999997), textMayChange = 1)
     self.avocateMessage = DirectLabel(parent = self, relief = None, text = OTPLocalizer.GuildMemberGMMessage % avName, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ALeft, text_fg = (0.90000000000000002, 1, 0.90000000000000002, 1), text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.050000000000000003, 0, 0.34499999999999997), textMayChange = 1)
     self.avocateMessage.hide()
     if rank in (GUILDRANK_MEMBER, GUILDRANK_VETERAN):
         topButtonText = OTPLocalizer.GuildMemberPromote
         topButtonCommand = self._GuildMember__handleMakeOfficer
     else:
         topButtonText = OTPLocalizer.GuildMemberDemoteInvite
         topButtonCommand = self._GuildMember__handleMakeVeteran
     if rank in (GUILDRANK_OFFICER, GUILDRANK_VETERAN):
         bottomButtonText = OTPLocalizer.GuildMemberDemote
         bottomButtonCommand = self._GuildMember__handleMakeMember
     else:
         bottomButtonText = OTPLocalizer.GuildMemberPromoteInvite
         bottomButtonCommand = self._GuildMember__handleMakeVeteran
     self.bTopEditButton = GuildMemberButton(text = topButtonText, command = topButtonCommand)
     self.bTopEditButton.reparentTo(self)
     self.bTopEditButton.setPos(0.20000000000000001, 0, 0.26000000000000001)
     self.bBottomEditButton = GuildMemberButton(text = bottomButtonText, command = bottomButtonCommand)
     self.bBottomEditButton.reparentTo(self)
     self.bBottomEditButton.setPos(0.20000000000000001, 0, 0.19)
     if self.canpromote:
         self.bTopEditButton.show()
         self.bBottomEditButton.show()
     else:
         self.bTopEditButton.hide()
         self.bBottomEditButton.hide()
     self.bKick = GuildMemberButton(text = OTPLocalizer.GuildMemberKick, command = self._GuildMember__handleKick)
     self.bKick.reparentTo(self)
     self.bKick.setPos(0.20000000000000001, 0, 0.12)
     if not self.cankick:
         self.bKick.hide()
     
     self.bCancel = GuildMemberButton(text = OTPLocalizer.GuildMemberCancel, command = self._GuildMember__handleCancel)
     self.bCancel.reparentTo(self)
     self.bCancel.setPos(0.20000000000000001, 0, -0.080000000000000002)
     self.bAvocate = GuildMemberButton(text = OTPLocalizer.GuildMemberGM, command = self._GuildMember__handleAvocatePopup)
     self.bAvocate.reparentTo(self)
     self.bAvocate.setPos(0.20000000000000001, 0, 0.02)
     if localAvatar.getGuildRank() == GUILDRANK_GM:
         self.bAvocate.show()
     else:
         self.bAvocate.hide()
     self.bAvocateConfrim = GuildMemberButtonYesNo(text = OTPLocalizer.GuildMemberGMConfirm, command = self._GuildMember__handleAvocate)
     self.bAvocateConfrim.reparentTo(self)
     self.bAvocateConfrim.setPos(0.050000000000000003, 0, -0.080000000000000002)
     self.bAvocateConfrim.hide()
     self.bAvocateCancel = GuildMemberButtonYesNo(text = OTPLocalizer.GuildMemberCancel, command = self._GuildMember__handleAvocateCancel)
     self.bAvocateCancel.reparentTo(self)
     self.bAvocateCancel.setPos(0.34999999999999998, 0, -0.080000000000000002)
     self.bAvocateCancel.hide()
     self.accept('guildMemberUpdated', self.determineOptions)
 def __init__(self):
     guiMain = loader.loadModel('models/gui/gui_main')
     DirectFrame.__init__(self, relief = None, pos = (-0.59999999999999998, 0, 0.46999999999999997), image = guiMain.find('**/general_frame_e'), image_pos = (0.25, 0, 0.27500000000000002), image_scale = 0.25)
     self.initialiseoptions(CrewInviter)
     self.avDisableName = ''
     self.fsm = ClassicFSM.ClassicFSM('CrewInviter', [
         State.State('off', self.enterOff, self.exitOff),
         State.State('begin', self.enterBegin, self.exitBegin),
         State.State('tooMany', self.enterTooMany, self.exitTooMany),
         State.State('notYet', self.enterNotYet, self.exitNotYet),
         State.State('checkAvailability', self.enterCheckAvailability, self.exitCheckAvailability),
         State.State('notAvailable', self.enterNotAvailable, self.exitNotAvailable),
         State.State('notAcceptingCrews', self.enterNotAcceptingCrews, self.exitNotAcceptingCrews),
         State.State('wentAway', self.enterWentAway, self.exitWentAway),
         State.State('alreadyCrewed', self.enterAlreadyCrewed, self.exitAlreadyCrewed),
         State.State('alreadyInvited', self.enterAlreadyInvited, self.exitAlreadyInvited),
         State.State('recentlyInvited', self.enterRecentlyInvited, self.exitRecentlyInvited),
         State.State('askingNPC', self.enterAskingNPC, self.exitAskingNPC),
         State.State('endCrewship', self.enterEndCrewship, self.exitEndCrewship),
         State.State('crewedNoMore', self.enterCrewedNoMore, self.exitCrewedNoMore),
         State.State('leaveCrew', self.enterLeaveCrew, self.exitLeaveCrew),
         State.State('leftCrew', self.enterLeftCrew, self.exitLeftCrew),
         State.State('notCaption', self.enterNotCaption, self.exitNotCaption),
         State.State('inOtherCrew', self.enterInOtherCrew, self.exitInOtherCrew),
         State.State('self', self.enterSelf, self.exitSelf),
         State.State('ignored', self.enterIgnored, self.exitIgnored),
         State.State('asking', self.enterAsking, self.exitAsking),
         State.State('yes', self.enterYes, self.exitYes),
         State.State('no', self.enterNo, self.exitNo),
         State.State('otherTooMany', self.enterOtherTooMany, self.exitOtherTooMany),
         State.State('maybe', self.enterMaybe, self.exitMaybe),
         State.State('down', self.enterDown, self.exitDown),
         State.State('cancel', self.enterCancel, self.exitCancel)], 'off', 'off')
     self.title = DirectLabel(parent = self, relief = None, text = PLocalizer.CrewInviterTitle, text_scale = PiratesGuiGlobals.TextScaleExtraLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), pos = (0.25, 0, 0.41999999999999998), image = None, image_scale = 0.25)
     self.message = DirectLabel(parent = self, relief = None, text = '', text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.25, 0, 0.32500000000000001), textMayChange = 1)
     self.context = None
     self.bOk = CrewInviterButton(text = PLocalizer.CrewInviterOK, command = self._CrewInviter__handleOk)
     self.bOk.reparentTo(self)
     self.bOk.setPos(0.20000000000000001, 0, 0.050000000000000003)
     self.bOk.hide()
     self.bCancel = CrewInviterButton(text = PLocalizer.CrewInviterCancel, command = self._CrewInviter__handleCancel)
     self.bCancel.reparentTo(self)
     self.bCancel.setPos(0.20000000000000001, 0, 0.050000000000000003)
     self.bCancel.hide()
     self.bStop = CrewInviterButton(text = PLocalizer.CrewInviterStopBeingCrewed, command = self._CrewInviter__handleStop)
     self.bStop.reparentTo(self)
     self.bStop.setPos(0.20000000000000001, 0, 0.14999999999999999)
     self.bStop.hide()
     self.bYes = CrewInviterButton(text = PLocalizer.CrewInviterYes, command = self._CrewInviter__handleYes)
     self.bYes.reparentTo(self)
     self.bYes.setPos(0.10000000000000001, 0, 0.050000000000000003)
     self.bYes.hide()
     self.bNo = CrewInviterButton(text = PLocalizer.CrewInviterNo, command = self._CrewInviter__handleNo)
     self.bNo.reparentTo(self)
     self.bNo.setPos(0.29999999999999999, 0, 0.050000000000000003)
     self.bNo.hide()
MSG_CAT_DEFAULT = 0
MSG_CAT_THREAT_LEVEL = 1
MSG_CAT_NO_PORT = 2
MSG_CAT_TELL_PORT = 3
MSG_CAT_ANNOUNCE_ATTACK = 4
MSG_CAT_SUNK_SHIP = 5
MSG_CAT_SHORE_CLOSE = 6
MMH_QUEUE = 0
MMH_FIRST = 1
MMH_LAST = 2
MMH_COMBINE = 3
MessageOptions = {
    MSG_CAT_DEFAULT: {
        'text_fg': PiratesGuiGlobals.TextFG1,
        'text_shadow': (0, 0, 0, 1),
        'text_font': PiratesGlobals.getPirateOutlineFont(),
        'text_scale': 0.050000000000000003,
        'showBorder?': True,
        'messageTime': 7.0,
        'multiMessageHandling': MMH_FIRST,
        'messagePrefix': '',
        'priority': 0 },
    MSG_CAT_THREAT_LEVEL: {
        'text_fg': PiratesGuiGlobals.TextFG1,
        'text_shadow': (0, 0, 0, 1),
        'text_font': PiratesGlobals.getPirateOutlineFont(),
        'text_scale': 0.050000000000000003,
        'showBorder?': True,
        'messageTime': 7.0,
        'multiMessageHandling': MMH_FIRST,
        'messagePrefix': '',
 def __init__(self, title, message, command, avId = None, tattoo = None, barber = None, titleScale = PiratesGuiGlobals.TextScaleExtraLarge):
     guiMain = loader.loadModel('models/gui/gui_main')
     DirectFrame.__init__(self, relief = None, pos = (-0.59999999999999998, 0, 0.46999999999999997), image = guiMain.find('**/general_frame_e'), image_pos = (0.25, 0, 0.27500000000000002), image_scale = 0.25)
     self.initialiseoptions(PiratesConfirm)
     self.command = command
     self.avId = avId
     self.tattoo = tattoo
     self.barber = barber
     if avId is not None and base.cr.avatarFriendsManager.checkIgnored(self.avId):
         self._PiratesConfirm__handleNo()
         return None
     
     self.title = DirectLabel(parent = self, relief = None, text = title, text_scale = titleScale, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), pos = (0.25, 0, 0.41999999999999998), image = None, image_scale = 0.25)
     text = message
     self.message = DirectLabel(parent = self, relief = None, text = message, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.25, 0, 0.32500000000000001), textMayChange = 1)
     self.bOk = PiratesConfirmButton(text = PLocalizer.GenericConfirmOK, command = self._PiratesConfirm__handleOk)
     self.bOk.reparentTo(self)
     self.bOk.setPos(0.10000000000000001, 0, 0.050000000000000003)
     self.bNo = PiratesConfirmButton(text = PLocalizer.GenericConfirmNo, command = self._PiratesConfirm__handleNo)
     self.bNo.reparentTo(self)
     self.bNo.setPos(0.29999999999999999, 0, 0.050000000000000003)
     self.accept('clientLogout', self.destroy)
 def __init__(self, avId, avName):
     SocialPage.SocialPage.__init__(self, 'PVPInvitee')
     self.initialiseoptions(PVPInvitee)
     self.setPos(-0.59999999999999998, 0, 0.46999999999999997)
     self.avId = avId
     self.avName = avName
     guiMain = loader.loadModel('models/gui/gui_main')
     self.box = OnscreenImage(parent = self, pos = (0.25, 0, 0.27500000000000002), image = guiMain.find('**/general_frame_e'), scale = 0.25)
     self.title = DirectLabel(parent = self, relief = None, text = PLocalizer.PVPInviteeTitle, text_scale = PiratesGuiGlobals.TextScaleExtraLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), pos = (0.25, 0, 0.41999999999999998), image = None, image_scale = 0.25)
     text = PLocalizer.PVPInviteeInvitation % self.avName
     self.message = DirectLabel(parent = self, relief = None, text = text, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.25, 0, 0.32500000000000001), textMayChange = 1)
     self.bOk = PVPInviteeButton(text = OTPLocalizer.DialogOK, command = self._PVPInvitee__handleOk)
     self.bOk.reparentTo(self)
     self.bOk.setPos(0.10000000000000001, 0, 0.10000000000000001)
     self.bNo = PVPInviteeButton(text = OTPLocalizer.DialogNo, command = self._PVPInvitee__handleNo)
     self.bNo.reparentTo(self)
     self.bNo.setPos(0.29999999999999999, 0, 0.10000000000000001)
     self.accept('cancelChallengeInvitation', self._PVPInvitee__handleCancelFromAbove)
 def __init__(self, parent, av, radius = 200.0, **kw):
     GuiTray.__init__(self, parent, 0.40000000000000002, 0.40000000000000002)
     FSM.__init__(self, 'RadarGui')
     self.initialiseoptions(RadarGui)
     self.av = av
     self.radius = radius
     self.battleAvatarTubeRadius = 2.0
     self.demoTunnel = None
     self.demoQuest = None
     self.demoNpc = { }
     guiScale = 0.14999999999999999
     self.rWidth = (self.width - 0.10000000000000001) / guiScale
     self.rHeight = (self.height - 0.10000000000000001) / guiScale
     self._RadarGui__normalizeWithRadius()
     self.camToAvAngle = 0.0
     self.relNode = render.attachNewNode('radarGuiRelNode')
     self.model = loader.loadModel('models/gui/compass_main')
     self.guiTop = self.attachNewNode('compassGuiTop')
     self.guiTop.setScale(guiScale)
     self.guiTop.setPos(self._RadarGui__dX, 0, self._RadarGui__dZ)
     self.background = self.model.find('**/background')
     self.background.setColorScale(1, 1, 1, 0.59999999999999998)
     self.mapRoot = self.background.attachNewNode('minimap-root')
     self.mapRoot.setScissor(Point3(-1, 1, 0), Point3(1, -1, 0))
     self.mapRoot.setP(90)
     self.mapRoot.setAlphaScale(1, 1)
     self.mapScale = self.mapRoot.attachNewNode('minimap-scale')
     self.minimapSentry = None
     self.frame = self.model.find('**/frame')
     self.frame.flattenStrong()
     self.avArrow = loader.loadModel('models/gui/toplevel_gui').find('**/generic_arrow')
     self.avArrow.setScale(2)
     self.avArrow.setR(90)
     self.dial = self.model.find('**/dial')
     self.dial.flattenStrong()
     self.ring = loader.loadModel('models/gui/gui_main').find('**/compass_radar_in')
     self.ring.hide()
     self.ringIval = None
     self.north = loader.loadModel('models/gui/compass_north')
     self.north.setScale(0.75)
     self.north.setZ(1)
     self.north.reparentTo(self.dial)
     self.arrow = loader.loadModel('models/gui/compass_arrow')
     self.arrow.getChild(0).getChild(0).setHpr(90, 0, 90)
     self.arrow.getChild(0).getChild(0).setY(0.20000000000000001)
     objectiveGrey = self.model.find('**/icon_objective_grey')
     objectiveGrey.copyTo(self.arrow)
     objectiveGrey.setScale(0.5)
     self.arrow.find('**/icon_objective_grey').setScale(0.80000000000000004)
     self.rectangle = NodePath('rectangle')
     rectangleGeom = self.model.find('**/icon_rectangle_hollow')
     rectangleGeom.setHpr(90, 0, 0)
     rectangleGeom.reparentTo(self.rectangle)
     self.background.reparentTo(self.guiTop)
     self.frame.reparentTo(self.guiTop)
     self.ring.reparentTo(self.guiTop)
     self.dial.reparentTo(self.guiTop)
     self.edge = self.guiTop.attachNewNode('edge')
     self.objTop = self.guiTop.attachNewNode('compassObjTop')
     self.zoomInButton = DirectButton(parent = self, relief = None, scale = 0.20000000000000001, pos = (0.25, 0, 0.25), image = (self.model.find('**/zoomin_button'), self.model.find('**/zoomin_button'), self.model.find('**/zoomin_button_over')), command = self.zoomIn)
     self.zoomOutButton = DirectButton(parent = self, relief = None, scale = 0.20000000000000001, pos = (0.25, 0, 0.25), image = (self.model.find('**/zoomout_button'), self.model.find('**/zoomout_button'), self.model.find('**/zoomout_button_over')), command = self.zoomOut)
     self.zoomInButton.flattenStrong()
     self.zoomOutButton.flattenStrong()
     guiMain = loader.loadModel('models/gui/gui_main')
     self.minimapButton = DirectButton(parent = self, relief = None, scale = 0.25, pos = (0.11, 0, 0.28999999999999998), image = (guiMain.find('**/minimap_button'), guiMain.find('**/minimap_button'), guiMain.find('**/minimap_button_over')), command = self.handleMinimapButton)
     self.minimapButton.hide()
     self.modelDict = {
         RADAR_OBJ_TYPE_DEFAULT: [
             self.model.find('**/icon_sphere'),
             None],
         RADAR_OBJ_TYPE_LANDMARK: [
             self.model.find('**/icon_square'),
             self.model.find('**/icon_square_hollow')],
         RADAR_OBJ_TYPE_QUEST: [
             self.model.find('**/icon_objective_grey'),
             self.arrow],
         RADAR_OBJ_TYPE_SHIP: [
             self.model.find('**/icon_ship'),
             None],
         RADAR_OBJ_TYPE_EXIT: [
             self.rectangle,
             self.rectangle] }
     self._RadarGui__radarObjects = { }
     self._RadarGui__cachedRadarObjects = { }
     self.collSphereNodePath = None
     self.setupCollisions()
     self.detachNode()
     self.enterSphereEvent = 'enterradarSphere'
     self.exitSphereEvent = 'exitradarSphere'
     self.zoomFSM = RadarZoomFSM(self)
     self.effectIvals = []
     self.locationLabel = DirectLabel(parent = self, relief = None, text = '', text_font = PiratesGlobals.getPirateOutlineFont(), text_fg = (1.0, 1.0, 1.0, 1.0), text_shadow = (0, 0, 0, 1), text_scale = 0.040000000000000001, text_pos = (0.20000000000000001, -0.025000000000000001), text_wordwrap = 7)
     self.locationLabel.hide()
     self.flashCleanupTasks = { }
     self.minimapObjects = []
     self.toggle()
    def __init__(self, avId, avName):
        guiMain = loader.loadModel('models/gui/gui_main')
        DirectFrame.__init__(self, relief = None, pos = (-0.59999999999999998, 0, 0.46999999999999997), image = guiMain.find('**/general_frame_e'), image_pos = (0.25, 0, 0.27500000000000002), image_scale = 0.25)
        guiMain.removeNode()
        self.initialiseoptions(CrewInvitee)
        self.avId = avId
        self.avName = avName
        if base.cr.avatarFriendsManager.checkIgnored(self.avId):
            self._CrewInvitee__handleNo()
            return None

        self.title = DirectLabel(parent = self, relief = None, text = PLocalizer.CrewInviteeTitle, text_scale = PiratesGuiGlobals.TextScaleExtraLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), pos = (0.25, 0, 0.41999999999999998), image = None, image_scale = 0.25)
        nameArray = ('CPOrangeHEAD' + self.avName + '', 'CPOrangeHEAD' + self.avName + '', 'CPOrangeOVER' + self.avName + '', 'CPOrangeHEAD' + self.avName + '')
        nameButton = DirectButton(parent = NodePath(), relief = None, text = nameArray, text_align = TextNode.ALeft, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 0, command = self.handleAvatarPress, extraArgs = [
            avId,
            avName])
        (left, right, bottom, top) = nameButton.getBounds()
        nameGFX = TextGraphic(nameButton, left, right, 0, 1)
        buttonName = '' + self.avName + ''
        buttonText = PLocalizer.CrewInviteeInvitation % buttonName
        tpMgr = TextPropertiesManager.getGlobalPtr()
        tpMgr.setGraphic(self.avName, nameGFX)
        del tpMgr
        textRender = TextNode('textRender')
        textRender.setFont(PiratesGlobals.getInterfaceFont())
        textRender.setTextColor(PiratesGuiGlobals.TextFG2)
        textRender.setAlign(TextNode.ACenter)
        textRender.setShadowColor(PiratesGuiGlobals.TextShadow)
        textRender.setWordwrap(11)
        textRender.setTabWidth(1.0)
        textRender.setShadow(0.080000000000000002, 0.080000000000000002)
        textRender.setText(buttonText)
        textNode = self.attachNewNode(textRender.generate())
        textNode.setScale(PiratesGuiGlobals.TextScaleLarge)
        textNode.setPos(0.25, 0, 0.32500000000000001)
        self.bOk = CrewInviteeButton(text = PLocalizer.CrewInviteeOK, command = self._CrewInvitee__handleOk)
        self.bOk.reparentTo(self)
        self.bOk.setPos(0.10000000000000001, 0, 0.050000000000000003)
        self.bNo = CrewInviteeButton(text = PLocalizer.CrewInviteeNo, command = self._CrewInvitee__handleNo)
        self.bNo.reparentTo(self)
        self.bNo.setPos(0.29999999999999999, 0, 0.050000000000000003)
        self.accept('BandRequestCancel-%s' % (self.avId,), self._CrewInvitee__handleCancelFromAbove)
    def __init__(self, parent, gear, **kw):
        gui = loader.loadModel('models/gui/gui_map_window_drawer')
        dotcard = loader.loadModel('models/gui/toplevel_gui')
        self.dot = dotcard.find('**/topgui_icon_ship_hulldot_on')
        self.shards = { }
        optiondefs = (('image', gui.find('**/drawer'), None), ('image_scale', 0.32000000000000001, None), ('pos', ShardPanel.UPPOS, None), ('uppos', ShardPanel.UPPOS, None), ('downpos', ShardPanel.DOWNPOS, None), ('showtime', ShardPanel.SHOWTIME, None), ('shardSelected', self.shardSelected, None), ('inverted', False, None), ('buttonFont', PiratesGlobals.getPirateFont(), None), ('preferredShard', 0, self.setPreferredShard))
        self.defineoptions(kw, optiondefs)
        DirectFrame.__init__(self, parent)
        self.initialiseoptions(ShardPanel)
        bounds = self.getBounds()
        self['frameSize'] = Vec4(bounds[0], bounds[1], bounds[2], bounds[3]) * 1.25
        self.shards = { }
        self.popTrackerHandle = None
        self.stopLightButtons = { }
        self.textRolloverColor = Vec4(0.40000000000000002, 0.40000000000000002, 0, 1)
        self.textDownColor = Vec4(0.5, 0.90000000000000002, 1, 1)
        self.textDisabledColor = Vec4(0.80000000000000004, 0.40000000000000002, 0.40000000000000002, 1)
        self.textSelectedColor = Vec4(0.40000000000000002, 0.80000000000000004, 0.40000000000000002, 1)
        self.gear = gear
        self.up = True
        self.showIval = None
        self.hideIval = None
        self.showPop = config.GetBool('show-total-population', 0)
        self.teleportAll = config.GetBool('teleport-all', 0)
        if config.GetBool('shard-page-disable', 0):
            pass
        self.noTeleport = not (self.teleportAll)
        self.rotationFrame = DirectFrame(parent = self, relief = None, state = DGG.DISABLED)
        if self['inverted']:
            self.rotationFrame.setR(180)
            self.rotationFrame.setPos(-0.02, 0, 0.41999999999999998)

        self.titleLabel = DirectLabel(parent = self.rotationFrame, relief = None, text = PLocalizer.ShardActiveWorlds, text_font = PiratesGlobals.getPirateOutlineFont(), text_scale = 0.080000000000000002, text_fg = PiratesGuiGlobals.TextFG2, textMayChange = 0, pos = (0, 0, 0.54500000000000004))
        if self['inverted']:
            self.titleLabel.hide()

        self.button = DirectButton(parent = self, relief = None, geom = gui.find('**/drawer_button_over'), geom_scale = 0.32000000000000001, command = self.handleButtonPressed)
        if self['inverted']:
            self.button['frameSize'] = (-0.37, 0.34999999999999998, -0.32000000000000001, -0.11)

        self.currentShardLabel = DirectLabel(parent = self.rotationFrame, text = '', text_font = self['buttonFont'], text_scale = 0.050000000000000003, text_fg = PiratesGuiGlobals.TextFG2, textMayChange = 1, pos = (0, 0, -0.23300000000000001))
        if self['inverted']:
            self.currentShardLabel.setZ(0.60499999999999998)
            self.currentShardLabel.setAlphaScale(0.90000000000000002)

        self.shardScrolledFrame = DirectScrolledFrame(parent = self.rotationFrame, relief = 1, state = DGG.NORMAL, frameColor = (1, 1, 1, 0), borderWidth = PiratesGuiGlobals.BorderWidth, frameSize = (0, 0.68500000000000005, -0.82999999999999996, -0.125), canvasSize = (0, 0, 0, 0), verticalScroll_frameColor = PiratesGuiGlobals.ScrollbarColor, verticalScroll_borderWidth = (0.0050000000000000001, 0.0050000000000000001), verticalScroll_frameSize = (0, PiratesGuiGlobals.ScrollbarSize, 0, 0), verticalScroll_thumb_frameColor = PiratesGuiGlobals.ButtonColor2, verticalScroll_incButton_frameColor = PiratesGuiGlobals.ButtonColor2, verticalScroll_decButton_frameColor = PiratesGuiGlobals.ButtonColor2, verticalScroll_scrollSize = 0.096000000000000002, horizontalScroll_frameColor = PiratesGuiGlobals.ScrollbarColor, horizontalScroll_borderWidth = (0.0050000000000000001, 0.0050000000000000001), horizontalScroll_frameSize = (0, 0, 0, PiratesGuiGlobals.ScrollbarSize), horizontalScroll_thumb_frameColor = PiratesGuiGlobals.ButtonColor2, horizontalScroll_incButton_frameColor = PiratesGuiGlobals.ButtonColor2, horizontalScroll_decButton_frameColor = PiratesGuiGlobals.ButtonColor2, pos = (-0.35199999999999998, 0, 0.65600000000000003))
        self.shardScrolledFrame.accept('press-wheel_up-%s' % self.shardScrolledFrame.guiId, self.mouseWheelUp)
        self.shardScrolledFrame.accept('press-wheel_down-%s' % self.shardScrolledFrame.guiId, self.mouseWheelDown)
        self.refreshShardLabels()
        self.accept('shardSwitchComplete', self.refreshCurrentShard)
Esempio n. 48
0
 def __init__(self, title, message, commandOkay, commandCancel, titleScale = PiratesGuiGlobals.TextScaleExtraLarge):
     guiMain = loader.loadModel('models/gui/gui_main')
     DirectFrame.__init__(self, relief = None, pos = (-0.59999999999999998, 0, 0.46999999999999997), image = guiMain.find('**/general_frame_e'), image_pos = (0.25, 0, 0.27500000000000002), image_scale = 0.25)
     self.initialiseoptions(ShipUpgradeConfirm)
     self.setBin('gui-fixed', 0)
     self.commandOkay = commandOkay
     self.commandCancel = commandCancel
     self.title = DirectLabel(parent = self, relief = None, text = title, text_scale = titleScale, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), pos = (0.25, 0, 0.41999999999999998), image = None, image_scale = 0.25)
     text = message
     self.message = DirectLabel(parent = self, relief = None, text = message, text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.25, 0, 0.32500000000000001), textMayChange = 1)
     self.bOk = PiratesConfirmButton(text = PLocalizer.GenericConfirmOK, command = self._ShipUpgradeConfirm__handleOk)
     self.bOk.reparentTo(self)
     self.bOk.setPos(0.10000000000000001, 0, 0.050000000000000003)
     self.bNo = PiratesConfirmButton(text = PLocalizer.GenericConfirmNo, command = self._ShipUpgradeConfirm__handleNo)
     self.bNo.reparentTo(self)
     self.bNo.setPos(0.29999999999999999, 0, 0.050000000000000003)
Esempio n. 49
0
 def show(self, waitForLocation = False, disableSfx = True, expectedLoadScale = 1.0):
     if self.state or base.config.GetBool('no-loading-screen', 0):
         return None
     
     self.startLoading()
     render.hide()
     self.state = True
     gsg = base.win.getGsg()
     if gsg:
         gsg.setIncompleteRender(False)
     
     base.setTaskChainNetNonthreaded()
     self.allowLiveFlatten.setValue(1)
     if self.parent and base.cr.isPaid() == OTPGlobals.AccessVelvetRope and base.config.GetBool('loading-screen-interstitial', 0):
         self.model = loader.loadModel('models/gui/loading_screen_interstitial')
         if self.model is not None:
             loadimage = self.model.find('**/loadimage')
             if loadimage is not None:
                 loadimage.hide()
             
         
     else:
         self.model = loader.loadModel('models/gui/loading_screen')
     self.locationLabel = DirectLabel(parent = aspect2dp, relief = None, text = '', text_font = PiratesGlobals.getPirateOutlineFont(), text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_scale = PiratesGuiGlobals.TextScaleTitleJumbo * 0.69999999999999996, text_align = TextNode.ACenter, pos = (0.0, 0.0, -0.52000000000000002), textMayChange = 1)
     self.hintLabel = DirectLabel(parent = aspect2dp, relief = None, text = '', text_font = PiratesGlobals.getPirateOutlineFont(), text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_scale = PiratesGuiGlobals.TextScaleTitleJumbo * 0.5, text_align = TextNode.ACenter, pos = (0.0, 0.0, -0.80000000000000004), text_wordwrap = 30, textMayChange = 1)
     self.wheel = self.model.find('**/red_wheel')
     title_bg = self.model.find('**/title_bg')
     title_frame = self.model.find('**/title_frame')
     if self.parent and base.cr.isPaid() == OTPGlobals.AccessVelvetRope and base.config.GetBool('loading-screen-interstitial', 0):
         self.hintLabel.setPos(0.68999999999999995, 0, -0.63)
         self.hintLabel['text_wordwrap'] = 12
         self.locationLabel.setPos(-0.11, 0.0, -0.65000000000000002)
         root = self.model.find('**/loading_screen_top')
         timer = self.model.find('**/timer')
         gear = self.model.find('**/gear')
         shell = self.model.find('**/shell')
         frame_little = self.model.find('**/frame_little')
         self.wheel.reparentTo(timer, 0)
         gear.reparentTo(timer, 1)
         shell.reparentTo(timer, 2)
         title_bg.reparentTo(root)
         title_frame.reparentTo(root)
         self.snapshotFrameBasic = DirectFrame(parent = aspect2dp, relief = DGG.FLAT, frameColor = (0.0, 0.0, 0.0, 1.0), frameSize = (-4.9500000000000002, -2.5, -1.1000000000000001, -2.6000000000000001))
         self.snapshotFrameBasic.reparentTo(root)
         frame_little.reparentTo(root)
     
     self.title_art.append(title_bg)
     self.title_art.append(title_frame)
     self.hideTitleFrame()
     if not waitForLocation:
         if self.snapshot is None:
             screenshot = random.choice(tutorialShots_MoveAim)
             self._LoadingScreen__setLoadingArt(screenshot)
         
         if self.snapshot:
             self.snapshot.show()
         
     elif self.snapshot:
         self.snapshot.show()
     
     if self.parent and self.snapshot and base.cr.isPaid() == OTPGlobals.AccessVelvetRope and base.config.GetBool('loading-screen-interstitial', 0):
         root = self.model.find('**/loading_screen_top')
         frame_little = self.model.find('**/frame_little')
         self.snapshot.reparentTo(root, 0)
         frame_little.reparentTo(root, 1)
     
     self.snapshotFrame = DirectFrame(parent = aspect2dp, relief = DGG.FLAT, frameColor = (0.0, 0.0, 0.0, 1.0), frameSize = (-2.0, 2.0, 2.0, -2.0))
     self.snapshotFrame.setBin('fixed', 0)
     self.model.reparentTo(aspect2dp, NO_FADE_SORT_INDEX)
     self.locationLabel.reparentTo(aspect2dp, NO_FADE_SORT_INDEX)
     self.hintLabel.reparentTo(aspect2dp, NO_FADE_SORT_INDEX)
     if self.parent and base.cr.isPaid() == OTPGlobals.AccessVelvetRope and base.config.GetBool('loading-screen-interstitial', 0):
         self.model.setScale(0.22, 0.22, 0.22)
         self.model.setPos(0.0, 0.0, -0.29999999999999999)
     else:
         self.model.setScale(0.25, 0.25, 0.25)
         self.model.setPos(0.0, 0.0, -0.14999999999999999)
     if self.locationText and len(self.locationText):
         self._LoadingScreen__setLocationText(self.locationText)
     
     if self.hintText is not None:
         if len(self.hintText):
             self._LoadingScreen__setHintText(self.hintText)
         
     
     if self.parent and base.cr.isPaid() == OTPGlobals.AccessVelvetRope and base.config.GetBool('want-ad-reporting', 0) and base.config.GetBool('loading-screen-interstitial', 0):
         self._LoadingScreen__setAdArt()
     
     base.graphicsEngine.renderFrame()
     base.graphicsEngine.renderFrame()
     base.refreshAds()
     taskMgr.add(self.update, 'updateLoadingScreen', priority = -100)
     if base.sfxManagerList and disableSfx:
         index = 0
         while index < len(base.sfxManagerList):
             sfx_manager = base.sfxManagerList[index]
             sfx_manager.setVolume(0.0)
             index += 1
     
     if base.appRunner:
         base.appRunner.notifyRequest('onLoadingMessagesStart')
Esempio n. 50
0
 def __init__(self):
     DirectObject.DirectObject.__init__(self)
     self.combo = 0
     self.totalDamage = 0
     self.text = DirectLabel(parent = base.a2dTopLeft, relief = None, text = PLocalizer.HitCombo, text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleTitleLarge, text_fg = self.TEXT_COLOR, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (0.5, 0, -0.5), text_font = PiratesGlobals.getPirateOutlineFont())
     self.text.setTransparency(1)
     self.subText = DirectLabel(parent = self.text, relief = None, text = PLocalizer.Damage, text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_fg = self.SUB_TEXT_COLOR, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (0.089999999999999997, 0, -0.070000000000000007), text_font = PiratesGlobals.getPirateOutlineFont())
     self.comboCounter = DirectLabel(parent = self.text, relief = None, text = '', text_align = TextNode.ARight, text_scale = self.COMBO_NUM_SCALE, text_fg = self.NUMBER_COLOR, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (-0.025999999999999999, 0, -0.01), text_font = PiratesGlobals.getPirateOutlineFont())
     self.backstabText = DirectLabel(parent = base.a2dTopLeft, relief = None, text = 'Backstab!', text_align = TextNode.ALeft, text_scale = self.BACKSTAB_SCALE, text_fg = self.BACKSTAB_COLOR, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (1.165, 0, -0.96999999999999997), text_font = PiratesGlobals.getPirateOutlineFont())
     self.text.hide()
     self.backstabText.hide()
     self.faderIn = None
     self.faderOut = None
     self.animIval = None
     self.backstabFaderIn = None
     self.backstabFaderOut = None
     self.backstabAnimIval = None
     self.accept('trackCombo', self.newHit)
 def __init__(self, parent, **kw):
     DirectFrame.__init__(self, parent)
     self.initialiseoptions(VitaeMeter)
     toplevel_gui = loader.loadModel('models/gui/toplevel_gui')
     self.vitaeDial = DialMeter(parent = self, meterColor = Vec4(0.80000000000000004, 0.20000000000000001, 0.20000000000000001, 1), baseColor = Vec4(0, 0, 0, 1), scale = 0.28000000000000003)
     icon = toplevel_gui.find('**/morale_skull*')
     self.vitaeIcon = DirectFrame(parent = self, state = DGG.NORMAL, relief = None, image = icon, image_scale = 0.625)
     detailLabel = DirectLabel(relief = None, state = DGG.DISABLED, text = PLocalizer.VitaeDesc, text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleExtraLarge, text_fg = PiratesGuiGlobals.TextFG1, text_wordwrap = 15, text_shadow = (0, 0, 0, 1), pos = (0.0, 0, -0.025000000000000001), textMayChange = 0, sortOrder = 91)
     height = -(detailLabel.getHeight() + 0.01)
     width = max(0.25, detailLabel.getWidth() + 0.040000000000000001)
     self.helpBox = BorderFrame(parent = self, state = DGG.DISABLED, modelName = 'general_frame_f', frameSize = (-0.040000000000000001, width, height, 0.050000000000000003), pos = (0.050000000000000003, 0, -0.050000000000000003), sortOrder = 90)
     detailLabel.reparentTo(self.helpBox)
     self.helpBox.hide()
     self.helpBox.setClipPlaneOff()
     self.meterLabel = DirectLabel(parent = self.vitaeDial, relief = None, pos = (0, 0, -0.45000000000000001), text = PLocalizer.Vitae, text_scale = 0.20000000000000001, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), textMayChange = 1)
     self.vitaeIcon.bind(DGG.WITHIN, self.showDetails)
     self.vitaeIcon.bind(DGG.WITHOUT, self.hideDetails)
Esempio n. 52
0
 def __init__(self, hotkeys = (), hotkeyLabel = 'J', helpText = None, parent = None, **kw):
     gui = loader.loadModel('models/gui/toplevel_gui')
     iconTexture = gui.find('**/topgui_icon_journal')
     gui.removeNode()
     del gui
     optiondefs = (('image', iconTexture, None), ('image_scale', 0.5, None), ('sortOrder', 1, None), ('relief', None, None))
     self.defineoptions(kw, optiondefs)
     GuiButton.GuiButton.__init__(self, hotkeys = hotkeys, hotkeyLabel = hotkeyLabel, helpText = helpText, parent = parent)
     self.initialiseoptions(JournalButton)
     self.questCounter = 0
     self.infoText = DirectFrame(parent = self, relief = None, text = PLocalizer.JournalButtonInfo, text_align = TextNode.ACenter, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateBoldOutlineFont(), textMayChange = 1, pos = (0, 0, 0.10000000000000001))
     self.numberText = DirectFrame(parent = self, relief = None, text = str(self.questCounter), text_align = TextNode.ACenter, text_scale = 0.080000000000000002, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), textMayChange = 1, pos = (0, 0, -0.01))
     self.hotkeyLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = hotkeyLabel, text_font = PiratesGlobals.getPirateBoldOutlineFont(), text_align = TextNode.ARight, text_scale = PiratesGuiGlobals.TextScaleSmall, text_pos = (0.10000000000000001, -0.040000000000000001), text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 0)
    def setOffers(self, offer):
        offers = offer.getQuestDNA().getContainers()
        z = 1.0
        self.destroyQuestButtons()
        self.title = DirectLabel(
            parent=self,
            relief=None,
            text=PLocalizer.InteractChooseBranch,
            text_align=TextNode.ACenter,
            text_scale=0.070000000000000007,
            text_fg=PiratesGuiGlobals.TextFG1,
            text_shadow=PiratesGuiGlobals.TextShadow,
            textMayChange=1,
            pos=(0, 0, z - 0.080000000000000002),
            text_font=PiratesGlobals.getPirateOutlineFont(),
        )
        gui = loader.loadModel("models/gui/avatar_chooser_rope")
        topPanel = gui.find("**/avatar_c_A_top")
        topPanelOver = gui.find("**/avatar_c_A_top_over")
        middlePanel = gui.find("**/avatar_c_A_middle")
        middlePanelOver = gui.find("**/avatar_c_A_middle_over")
        bottomPanel = gui.find("**/avatar_c_A_bottom")
        bottomPanelOver = gui.find("**/avatar_c_A_bottom_over")
        for (i, offer) in zip(range(len(offers)), offers):
            if i == 0:
                image = (topPanel, topPanel, topPanelOver, topPanel)
                textPos = (0, -0.02)
                z -= 0.19
            else:
                image = (middlePanel, middlePanel, middlePanelOver, middlePanel)
                textPos = (0, -0.014999999999999999)
                if i == 1:
                    z -= 0.11
                else:
                    z -= 0.105
            offerName = offer.getName()
            if PLocalizer.QuestStrings.has_key(offerName) and "title" in PLocalizer.QuestStrings[offerName].keys():
                questTitle = PLocalizer.QuestStrings[offerName]["title"]
            elif (
                PLocalizer.QuestStrings.has_key(offer.questId)
                and "title" in PLocalizer.QuestStrings[offer.questId].keys()
            ):
                questTitle = PLocalizer.QuestStrings[offer.questId]["title"]
            else:
                questTitle = offer.getTitle()
            questButton = DirectButton(
                parent=self,
                relief=None,
                pressEffect=0,
                text=questTitle,
                text_fg=PiratesGuiGlobals.TextFG1,
                text_shadow=PiratesGuiGlobals.TextShadow,
                text_align=TextNode.ACenter,
                text_scale=PiratesGuiGlobals.TextScaleLarge,
                text_pos=textPos,
                textMayChange=0,
                image=image,
                image_scale=0.40000000000000002,
                pos=(0, 0, z),
                command=self.seeQuestDetails,
                extraArgs=[offer],
            )
            self.questButtons.append(questButton)

        z -= 0.155
        if self.callback:
            questButton = DirectButton(
                parent=self,
                relief=None,
                pressEffect=0,
                text=PLocalizer.lBack,
                text_fg=PiratesGuiGlobals.TextFG1,
                text_shadow=PiratesGuiGlobals.TextShadow,
                text_align=TextNode.ACenter,
                text_scale=PiratesGuiGlobals.TextScaleLarge,
                text_pos=(0, 0.033000000000000002),
                textMayChange=0,
                image=(bottomPanel, bottomPanel, bottomPanelOver, bottomPanel),
                image_scale=0.40000000000000002,
                pos=(0, 0, z),
                command=self.callback,
                extraArgs=[QuestConstants.CANCEL_QUEST],
            )
            self.questButtons.append(questButton)

        gui.removeNode()
 def loadDials(self):
     model = loader.loadModel('models/gui/gui_timer')
     model.setScale(0.20000000000000001)
     model.flattenLight()
     PiratesTimer.ClockImage = model.find('**/timer_front')
     PiratesTimer.BGImage = model.find('**/timer_back')
     model.removeNode()
     self.bgDial = DirectFrame(parent = self, state = DGG.DISABLED, relief = None, image = self.BGImage)
     self.fgLabel = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, image = self.ClockImage, image_pos = (-0.01, 0, 0.035000000000000003), image_scale = (1.1000000000000001, 1, 0.80000000000000004), text_scale = 0.070000000000000007, text_align = TextNode.ACenter, text_font = PiratesGlobals.getPirateOutlineFont())
 def __init__(self, callback):
     base.cr.skipTutFrame = self
     topGui = loader.loadModel('models/gui/toplevel_gui')
     lookoutGui = loader.loadModel('models/gui/lookout_gui')
     DirectFrame.__init__(self, relief = None, image = topGui.find('**/pir_t_gui_gen_parchment'), image_scale = (0.33000000000000002, 0, 0.44))
     self.initialiseoptions(SkipTutorialFrame)
     self.title = DirectLabel(parent = self, relief = None, text = PLocalizer.SkipTutorialTitle, text_scale = PiratesGuiGlobals.TextScaleTitleSmall, text_fg = (0.59999999999999998, 0.0, 0.0, 1.0), text_font = PiratesGlobals.getPirateOutlineFont(), text_align = TextNode.ACenter, pos = (0.02, 0, 0.13))
     self.message = DirectLabel(parent = self, relief = None, text = PLocalizer.SkipTutorialOffer, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = PiratesGuiGlobals.TextFG0, text_align = TextNode.ACenter, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 14, pos = (0.02, 0, 0.050000000000000003))
     self.callback = callback
     self.checkButton = GuiButton.GuiButton(parent = self, relief = None, text = PLocalizer.SkipTutorialYes, text_scale = PiratesGuiGlobals.TextScaleLarge, text_pos = (0.11, -0.01), text0_fg = PiratesGuiGlobals.TextFG0, text_shadow = PiratesGuiGlobals.TextShadow, image = (lookoutGui.find('**/lookout_submit'), lookoutGui.find('**/lookout_submit_down'), lookoutGui.find('**/lookout_submit_over'), lookoutGui.find('**/lookout_submit')), image_scale = 0.17000000000000001, image_color = (0.5, 0.0, 0.0, 1.0), pos = (-0.17000000000000001, 0, -0.10000000000000001), command = self._SkipTutorialFrame__handleYes)
     self.cancelButton = GuiButton.GuiButton(parent = self, relief = None, text = PLocalizer.SkipTutorialNo, text_scale = PiratesGuiGlobals.TextScaleLarge, text_pos = (0.089999999999999997, -0.01), text0_fg = PiratesGuiGlobals.TextFG0, text_shadow = PiratesGuiGlobals.TextShadow, image = (lookoutGui.find('**/lookout_close_window'), lookoutGui.find('**/lookout_close_window_down'), lookoutGui.find('**/lookout_close_window_over'), lookoutGui.find('**/lookout_close_window')), image_scale = 0.17000000000000001, image_color = (0.5, 0.0, 0.0, 1.0), pos = (0.070000000000000007, 0, -0.10000000000000001), command = self._SkipTutorialFrame__handleNo)
     topGui.removeNode()
     lookoutGui.removeNode()
 def createTimerText(self, titleText, titleFg, infoText):
     self.titleText = DirectFrame(parent = self, state = DGG.DISABLED, relief = None, text = titleText, text_align = TextNode.ACenter, text_scale = 0.050000000000000003, text_fg = titleFg, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), textMayChange = 1, text_wordwrap = 6, pos = (0, 0, 0.69999999999999996))
     self.infoText = DirectFrame(parent = self, state = DGG.DISABLED, relief = None, text = infoText, text_align = TextNode.ACenter, text_scale = 0.14000000000000001, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), textMayChange = 1, text_wordwrap = 6, pos = (0, 0, -0.75))
Esempio n. 57
0
 def __init__(self, w = 9.0, h = 6.0, lock = True):
     self.width = w
     self.height = h
     self.imageFocus = 0
     self.hasEmbedded = hasEmbedded
     self.questIdReporting = 'None_Provided'
     self._NonPayerPanel__fader = None
     DirectFrame.__init__(self, relief = DGG.RIDGE, state = DGG.NORMAL, frameColor = Vec4(0.0, 0.0, 0.0, 0.69999999999999996), borderWidth = PiratesGuiGlobals.BorderWidth, frameSize = (0, self.width, 0, self.height), pos = (-4.5, 0, -3.0), sortOrder = 999)
     self.initialiseoptions(NonPayerPanel)
     self.configurePanel()
     self.gamePic = [
         None,
         None]
     self.gamePic[0] = DirectFrame(parent = self, relief = None, image = self.gameImage[0][0], image_scale = (1.0, 0.75, 0.75), image_pos = (0, 0, 0), pos = (4.0, 0, 3.2799999999999998), text = self.gameCaption[0][0], text_align = TextNode.ACenter, text_scale = 0.055, text_pos = (0, -0.32000000000000001, 0), text_fg = PiratesGuiGlobals.TextFG1, text_font = PiratesGlobals.getPirateOutlineFont(), text_shadow = PiratesGuiGlobals.TextShadow, text_shadowOffset = (0.10000000000000001, 0.10000000000000001), textMayChange = 1)
     self.gamePic[1] = DirectFrame(parent = self, relief = None, image = self.gameImage[0][1], image_scale = (1.0, 0.75, 0.75), image_pos = (0, 0, 0), pos = (5.0, 0, 3.2799999999999998), text = self.gameCaption[0][1], text_align = TextNode.ACenter, text_scale = 0.055, text_pos = (0, -0.32000000000000001, 0), text_fg = PiratesGuiGlobals.TextFG1, text_font = PiratesGlobals.getPirateOutlineFont(), text_shadow = PiratesGuiGlobals.TextShadow, text_shadowOffset = (0.10000000000000001, 0.10000000000000001), textMayChange = 1)
     gui2 = loader.loadModel('models/gui/velvetrope')
     gui2.find('**/go_right').hide()
     gui2.find('**/go_left').hide()
     gui2.find('**/close_button').hide()
     gui2.find('**/upgrade_buttomn').hide()
     gui2.find('**/drop_shadow_buttons').hide()
     if not lock:
         gui2.find('**/lock').hide()
         gui2.find('**/lock_red_halo').hide()
         gui2.find('**/window_hoops').hide()
     
     root = gui2.find('**/velvetrope_top')
     titleBorder = gui2.find('**/title_bar_08')
     titleBorder.reparentTo(root)
     self.imageOne = DirectFrame(parent = self, relief = None, geom = gui2.find('**/velvetrope_top'), geom_scale = 0.40000000000000002, pos = (4.5, 0, 3.1499999999999999))
     self.titleText = DirectLabel(parent = self, relief = None, text = PLocalizer.VR_AuthAccess, text_align = TextNode.ACenter, text_scale = 0.074999999999999997, text_fg = PiratesGuiGlobals.TextFG1, text_font = PiratesGlobals.getPirateFont(), text_shadow = PiratesGuiGlobals.TextShadow, pos = (4.5, 0, 3.7999999999999998), textMayChange = 1)
     self.underText = DirectLabel(parent = self, relief = None, text = self.gameHeader[0], text_align = TextNode.ACenter, text_scale = 0.059999999999999998, text_wordwrap = 40, text_fg = PiratesGuiGlobals.TextFG15, text_font = PiratesGlobals.getInterfaceFont(), text_shadow = PiratesGuiGlobals.TextShadow, pos = (4.5, 0, 2.7999999999999998))
     self.fullText = DirectLabel(parent = self, relief = None, text = self.gameDescript[0], text_align = TextNode.ALeft, text_scale = 0.044999999999999998, text_wordwrap = 30, text_fg = PiratesGuiGlobals.TextFG0, text_font = PiratesGlobals.getInterfaceFont(), pos = (4.0499999999999998, 0, 2.7200000000000002))
     lookoutUI = loader.loadModel('models/gui/lookout_gui')
     basegeom = gui2.find('**/go_right')
     norm_geom = basegeom.find('**/normal')
     over_geom = basegeom.find('**/over')
     down_geom = basegeom.find('**/down')
     self.scrollRight = DirectButton(parent = self, relief = None, geom = (norm_geom, down_geom, over_geom), scale = 0.40000000000000002, pos = (4.5, 0, 3.1499999999999999), command = self.scrollPicsRight)
     basegeom = gui2.find('**/go_left')
     norm_geom = basegeom.find('**/normal')
     over_geom = basegeom.find('**/over')
     down_geom = basegeom.find('**/down')
     self.scrollLeft = DirectButton(parent = self, relief = None, geom = (norm_geom, down_geom, over_geom), scale = 0.40000000000000002, pos = (4.5, 0, 3.1499999999999999), command = self.scrollPicsLeft)
     basegeom = gui2.find('**/upgrade_buttomn')
     norm_geom = basegeom.find('**/normal')
     over_geom = basegeom.find('**/over')
     down_geom = basegeom.find('**/down')
     self.upgradeButton = DirectButton(parent = self, relief = None, geom = (norm_geom, down_geom, over_geom), geom0_color = (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1), geom1_color = (0.69999999999999996, 0.69999999999999996, 0.69999999999999996, 1), geom2_color = (1, 1, 1, 1), pos = (4.9000000000000004, 0, 3.1499999999999999), geom_scale = 0.40000000000000002, command = self.upgradeNow, text = PLocalizer.VR_UpgradeNow, text_fg = PiratesGuiGlobals.TextFG1, text_font = PiratesGlobals.getPirateOutlineFont(), text_shadow = PiratesGuiGlobals.TextShadow, text_scale = 0.059999999999999998, text_pos = (0, -0.76000000000000001))
     self.passButton = DirectButton(parent = self, relief = None, geom = (norm_geom, down_geom, over_geom), geom0_color = (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1), geom1_color = (0.69999999999999996, 0.69999999999999996, 0.69999999999999996, 1), geom2_color = (1, 1, 1, 1), pos = (4.0999999999999996, 0, 3.1499999999999999), geom_scale = 0.40000000000000002, command = self.continuePlayingNow, text = PLocalizer.VR_UpgradeLater, text_fg = PiratesGuiGlobals.TextFG1, text_font = PiratesGlobals.getPirateOutlineFont(), text_shadow = PiratesGuiGlobals.TextShadow, text_scale = 0.059999999999999998, text_pos = (0, -0.76000000000000001))
     basegeom = gui2.find('**/close_button')
     norm_geom = basegeom.find('**/normal')
     over_geom = basegeom.find('**/over')
     down_geom = basegeom.find('**/down')
     self.dismissButton = DirectButton(parent = self, relief = None, geom = (norm_geom, down_geom, over_geom), scale = 0.40000000000000002, pos = (4.5, 0, 3.1150000000000002), command = self.dismissNow)
     self.clickHereButton = DirectButton(parent = self, relief = None, pos = (4.5300000000000002, 0, 3.1499999999999999), command = self.moreInfo, text = PLocalizer.VR_Access, text0_fg = PiratesGuiGlobals.TextFG0, text1_fg = PiratesGuiGlobals.TextFG0, text2_fg = PiratesGuiGlobals.TextFG6, text_font = PiratesGlobals.getInterfaceFont(), text_shadow = PiratesGuiGlobals.TextShadow, text_scale = 0.044999999999999998, text_pos = (0, -0.63500000000000001))
     self.setBin('gui-popup', 0)
Esempio n. 58
0
 def __init__(self, avId, avName):
     guiMain = loader.loadModel('models/gui/gui_main')
     DirectFrame.__init__(self, relief = None, pos = (-0.59999999999999998, 0, 0.46999999999999997), image = guiMain.find('**/general_frame_e'), image_pos = (0.25, 0, 0.27500000000000002), image_scale = 0.25)
     self.initialiseoptions(IgnoreConfirm)
     self.avId = avId
     self.avName = avName
     self.fsm = ClassicFSM.ClassicFSM('IgnoreConfirm', [
         State.State('off', self.enterOff, self.exitOff),
         State.State('begin', self.enterBegin, self.exitBegin),
         State.State('notYet', self.enterNotYet, self.exitNotYet),
         State.State('alreadyIgnored', self.enterAlreadyIgnored, self.exitAlreadyIgnored),
         State.State('self', self.enterSelf, self.exitSelf),
         State.State('startIgnore', self.enterStartIgnore, self.exitStartIgnore),
         State.State('endIgnore', self.enterEndIgnore, self.exitEndIgnore),
         State.State('cancel', self.enterCancel, self.exitCancel)], 'off', 'off')
     self.title = DirectLabel(parent = self, relief = None, text = PLocalizer.IgnoreConfirmTitle, text_scale = PiratesGuiGlobals.TextScaleExtraLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont(), pos = (0.25, 0, 0.41999999999999998), image = None, image_scale = 0.25)
     self.message = DirectLabel(parent = self, relief = None, text = '', text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, text_wordwrap = 11, pos = (0.25, 0, 0.32500000000000001), textMayChange = 1)
     self.context = None
     self.bOk = IgnoreConfirmButton(text = OTPLocalizer.FriendInviterOK, command = self._IgnoreConfirm__handleOk)
     self.bOk.reparentTo(self)
     self.bOk.setPos(0.20000000000000001, 0, 0.050000000000000003)
     self.bOk.hide()
     self.bCancel = IgnoreConfirmButton(text = OTPLocalizer.FriendInviterCancel, command = self._IgnoreConfirm__handleCancel, width = 1.5)
     self.bCancel.reparentTo(self)
     self.bCancel.setPos(0.20000000000000001, 0, 0.050000000000000003)
     self.bCancel.hide()
     self.bStop = IgnoreConfirmButton(text = OTPLocalizer.AvatarPanelStopIgnore, command = self._IgnoreConfirm__handleStop, width = 1.5)
     self.bStop.reparentTo(self)
     self.bStop.setPos(0.20000000000000001, 0, 0.14999999999999999)
     self.bStop.hide()
     self.bYes = IgnoreConfirmButton(text = OTPLocalizer.FriendInviterYes, command = self._IgnoreConfirm__handleYes)
     self.bYes.reparentTo(self)
     self.bYes.setPos(0.10000000000000001, 0, 0.050000000000000003)
     self.bYes.hide()
     self.bNo = IgnoreConfirmButton(text = OTPLocalizer.FriendInviterNo, command = self._IgnoreConfirm__handleNo)
     self.bNo.reparentTo(self)
     self.bNo.setPos(0.29999999999999999, 0, 0.050000000000000003)
     self.bNo.hide()
     self.fsm.enterInitialState()
     if self.avId == None:
         self.fsm.request('getNewFriend')
     else:
         self.fsm.request('begin')
 def __init__(self):
     DirectObject.DirectObject.__init__(self)
     self.event = None
     self.sfx = None
     self.text = DirectLabel(parent = aspect2d, relief = None, text = '', text_align = TextNode.ACenter, text_scale = 0.059999999999999998, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (0, 0, -0.90000000000000002), text_font = PiratesGlobals.getPirateOutlineFont(), sortOrder = 80, state = DGG.DISABLED)
     self.text.hide()
     self.fader = None
     self.subtitleParent = render2d.attachNewNode(PGTop('subtitleParent'))
     self.subtitleParent.node().setMouseWatcher(base.mouseWatcherNode)