def __init__(self, mazeCollTable, maskResolution = None, radiusRatio = None, bgColor = (0.8, 0.8, 0.8), fgColor = (0.5, 0.5, 0.5, 1.0)):
        DirectFrame.__init__(self, relief=None, state=DGG.NORMAL, sortOrder=DGG.BACKGROUND_SORT_INDEX)
        self.hide()
        self._bgColor = bgColor
        self._fgColor = fgColor
        self._mazeCollTable = mazeCollTable
        self._mazeWidth = len(self._mazeCollTable[0])
        self._mazeHeight = len(self._mazeCollTable)
        self._maskResolution = maskResolution or DEFAULT_MASK_RESOLUTION
        if radiusRatio is None:
            self._radius = self._maskResolution * DEFAULT_RADIUS_RATIO
        else:
            self._radius = self._maskResolution * radiusRatio
        self._revealedCells = []
        for y in xrange(self._mazeHeight):
            self._revealedCells.append([])
            for u in xrange(self._mazeWidth):
                self._revealedCells[y].append(False)

        self._revealFunctions = {MazeRevealType.SmoothCircle: self._revealSmoothCircle,
         MazeRevealType.HardCircle: self._revealHardCircle,
         MazeRevealType.Square: self._revealSquare}
        self._revealFunction = MAZE_REVEAL_TYPE
        self.map = self._createMapTextureCard()
        self.map.reparentTo(self)
        self.maskedLayer = self.attachNewNode('maskedLayer')
        self.mask = self._createMaskTextureCard()
        self.mask.reparentTo(self)
        self.visibleLayer = self.attachNewNode('visibleLayer')
        self._laffMeterModel = loader.loadModel('phase_3/models/gui/laff_o_meter')
        self._toon2marker = {}
        return
 def __init__(self, parent, **kwargs):
     cm = CardMaker('Portrait')
     cm.setFrame(Vec4(-1, 1, -1, 1))
     b = SceneBuffer('worldmap-buffer', size = (512, 512), clearColor = Vec4(0.84999999999999998))
     b.camLens.setNear(0.001)
     b.camLens.setFar(5.0)
     b.camera.node().getDisplayRegion(0).setIncompleteRender(False)
     self.buffer = b
     shot = NodePath(cm.generate())
     shot.setTexture(b.getTexture(), 1)
     optiondefs = (('relief', None, None), ('geom', shot, None))
     self.defineoptions(kwargs, optiondefs)
     DirectFrame.__init__(self, parent)
     self.initialiseoptions(WorldMap)
     self.setTransparency(1)
     self.radius = 1.0
     self.camY = [
         -0.29999999999999999,
         0.25]
     self.tiltLimit = [ x * math.pi / 180 for x in (27, 33) ]
     self.mapBall = DecoratedMapBall('WorldMapArcBall', self, self.tiltLimit[1], mapSize = 242000, radius = self.radius, scrollFactor = 0.125, camera = b.camera, keepUpright = 1, mouseDownEvent = self.getMouseDownEvent(), mouseUpEvent = self.getMouseUpEvent())
     self.render = b.getSceneRoot()
     self.worldRoot = self.render.attachNewNode('world')
     self.worldRoot.setTransparency(1)
     self.ballRoot = self.worldRoot.attachNewNode('ballRoot')
     self.ballRoot.setY(self.radius / 2.0)
     self.mapBall.reparentTo(self.ballRoot)
     self.mapBall.setInternalHpr(Vec3(0, 90, 0))
     self.mapBall.setNorth(Vec3(0, 1, 0))
     self.mapBall.setY(self.radius)
     self.setZoom(0)
     self.addLocalAvDart()
     self._hasLocalShip = False
     self._fleets = []
     self._enabled = False
 def __init__(self, repairGame, name, startText):
     DirectFrame.__init__(self, parent = repairGame.gui, relief = None)
     FSM.FSM.__init__(self, '%sFSM' % name)
     self.defaultTransitions = {
         'Idle': [
             'Intro',
             'Final'],
         'Intro': [
             'Game',
             'Idle',
             'Final'],
         'Game': [
             'Outro',
             'Idle',
             'Final'],
         'Outro': [
             'Idle',
             'Final'],
         'Final': [] }
     self.name = name
     self.repairGame = repairGame
     self.startText = startText
     self._initVars()
     self._initAudio()
     self._initVisuals()
     self._initIntervals()
     self.request('Idle')
 def __init__(self, doneEvent):
     self.doneEvent = doneEvent
     DirectFrame.__init__(self)
     self.reparentTo(aspect2d)
     self.setPos(0.0, 0.0, 0.16)
     self.stash()
     publicPartyGui = loader.loadModel('phase_4/models/parties/publicPartyGUI')
     self.frame = DirectFrame(parent=self, geom=publicPartyGui.find('**/activities_background'), geom_pos=(-0.8, 0.0, 0.2), geom_scale=2.0, relief=None)
     self.earnedLabel = DirectLabel(parent=self, relief=None, text=str(0), text_align=TextNode.ACenter, text_pos=(0.0, -0.07), text_scale=0.2, text_fg=(0.95, 0.95, 0.0, 1.0), text_font=ToontownGlobals.getSignFont(), textMayChange=True, image=DirectGuiGlobals.getDefaultDialogGeom(), image_scale=(0.33, 1.0, 0.33), pos=(-0.3, 0.0, 0.2), scale=0.9)
     purchaseModels = loader.loadModel('phase_4/models/gui/purchase_gui')
     jarImage = purchaseModels.find('**/Jar')
     self.jarLabel = DirectLabel(parent=self, relief=None, text=str(0), text_align=TextNode.ACenter, text_pos=(0.0, -0.07), text_scale=0.2, text_fg=JellybeanRewardGui.JarLabelTextColor, text_font=ToontownGlobals.getSignFont(), textMayChange=True, image=jarImage, scale=0.7, pos=(0.3, 0.0, 0.17))
     purchaseModels.removeNode()
     del purchaseModels
     jarImage.removeNode()
     del jarImage
     self.messageLabel = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_wordwrap=16.0, text_scale=0.07, pos=(-0.52, 0.0, -0.1), textMayChange=True)
     self.doubledJellybeanLabel = DirectLabel(parent=self, relief=None, text=TTLocalizer.PartyRewardDoubledJellybean, text_align=TextNode.ACenter, text_wordwrap=12.0, text_scale=0.09, text_fg=(1.0, 0.125, 0.125, 1.0), pos=(0.0, 0.0, -0.465), textMayChange=False)
     self.doubledJellybeanLabel.hide()
     self.closeButton = DirectButton(parent=self, relief=None, text=TTLocalizer.PartyJellybeanRewardOK, text_align=TextNode.ACenter, text_scale=0.065, text_pos=(0.0, -0.625), geom=(publicPartyGui.find('**/startButton_up'),
      publicPartyGui.find('**/startButton_down'),
      publicPartyGui.find('**/startButton_rollover'),
      publicPartyGui.find('**/startButton_inactive')), geom_pos=(-0.39, 0.0, 0.125), command=self._close)
     publicPartyGui.removeNode()
     del publicPartyGui
     self.countSound = base.loadSfx('phase_13/audio/sfx/tick_counter_short.mp3')
     self.overMaxSound = base.loadSfx('phase_13/audio/sfx/tick_counter_overflow.mp3')
     return
 def __init__(self, doneEvent = None):
     FSM.__init__(self, 'PartyPlannerFSM')
     DirectFrame.__init__(self)
     self.doneEvent = doneEvent
     self.stateArray = ['Off',
      'Welcome',
      'PartyEditor',
      'Guests',
      'Date',
      'Time',
      'Invitation',
      'Farewell']
     self.partyTime = base.cr.toontownTimeManager.getCurServerDateTime()
     self.partyNowTime = base.cr.toontownTimeManager.getCurServerDateTime()
     minutesToNextFifteen = 15 - self.partyTime.minute % 15
     self.cleanPartyTime = self.partyTime + timedelta(minutes=minutesToNextFifteen, seconds=-self.partyTime.second)
     self.partyTime = self.cleanPartyTime
     self.guests = []
     self.isPrivate = False
     self.selectedCalendarGuiDay = None
     self.gui = loader.loadModel('phase_4/models/parties/partyPlannerGUI')
     self.partyDuration = timedelta(hours=PartyGlobals.DefaultPartyDuration)
     self.timeTypeToMaxValue = {'hour': 23,
      'minute': 59}
     self.timeTypeToChangeAmount = {'hour': (1, -1),
      'minute': (15, -15),
      'ampm': (1, -1)}
     self.partyInfo = None
     self.asapMinuteRounding = base.config.GetInt('party-asap-minute-rounding', PartyGlobals.PartyPlannerAsapMinuteRounding)
     self.load()
     self.request('Welcome')
     return
Beispiel #6
0
    def __init__(self, av, **kw):
        DirectFrame.__init__(self, relief=None, sortOrder=50)
        self.initialiseoptions(QuestMap)
        self.container = DirectFrame(parent=self, relief=None)
        self.marker = DirectFrame(parent=self.container, relief=None)
        self.cogInfoFrame = DirectFrame(parent=self.container, relief=None)
        cm = CardMaker('bg')
        cm.setFrame(-0.5, 0.5, -0.5, 0.5)
        bg = self.cogInfoFrame.attachNewNode(cm.generate())
        bg.setTransparency(1)
        bg.setColor(0.5, 0.5, 0.5, 0.5)
        bg.setBin('fixed', 0)
        self.cogInfoFrame['geom'] = bg
        self.cogInfoFrame['geom_pos'] = (0, 0, 0)
        self.cogInfoFrame['geom_scale'] = (6, 1, 2)
        self.cogInfoFrame.setScale(0.05)
        self.cogInfoFrame.setPos(0, 0, 0.6)
        self.buildingMarkers = []
        self.av = av
        self.wantToggle = base.config.GetBool('want-toggle-quest-map', True)
        self.updateMarker = True
        self.cornerPosInfo = None
        self.hqPosInfo = None
        self.fishingSpotInfo = None
        self.load()
        self.setScale(1.5)
        bg.removeNode()
        self.hoodId = None
        self.zoneId = None
        self.suitPercentage = {}
        for currHoodInfo in SuitPlannerBase.SuitPlannerBase.SuitHoodInfo:
            tracks = currHoodInfo[SuitPlannerBase.SuitPlannerBase.SUIT_HOOD_INFO_TRACK]
            self.suitPercentage[currHoodInfo[SuitPlannerBase.SuitPlannerBase.SUIT_HOOD_INFO_ZONE]] = tracks

        return
Beispiel #7
0
 def __init__(self):
     DirectFrame.__init__(self, parent=base.a2dTopRight, pos=(-0.25, 0.0, -0.46))
     gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui.bam')
     self['image'] = gui.find('**/FriendsBox_Open')
     self.headingText = OnscreenText(text='', parent=self, pos=(0.01, 0.2), fg=(0.1, 0.1, 0.4, 1.0), scale=0.04)
     self.frameForNames = DirectScrolledList(frameSize=(0.0, 0.35, 0, 0.35), incButton_geom=(gui.find('**/FndsLst_ScrollUp'),
      gui.find('**/FndsLst_ScrollDN'),
      gui.find('**/FndsLst_ScrollUp_Rllvr'),
      gui.find('**/FndsLst_ScrollUp')), incButton_relief=None, incButton_hpr=(0, 0, 180), incButton_pos=(0.17, 0, -0.04), decButton_geom=(gui.find('**/FndsLst_ScrollUp'),
      gui.find('**/FndsLst_ScrollDN'),
      gui.find('**/FndsLst_ScrollUp_Rllvr'),
      gui.find('**/FndsLst_ScrollUp')), decButton_relief=None, decButton_pos=(0.17, 0, 0.395), pos=(-0.1625, 0.0, -0.27), parent=self, numItemsVisible=9, forceHeight=0.04, itemFrame_frameSize=(-0.15, 0.15, 0, -0.35), itemFrame_pos=(0, 0, 0.3275), itemFrame_relief=None, relief=None)
     self.fwdBtn = DirectButton(geom=(gui.find('**/Horiz_Arrow_UP'),
      gui.find('**/Horiz_Arrow_DN'),
      gui.find('**/Horiz_Arrow_Rllvr'),
      gui.find('**/Horiz_Arrow_UP')), relief=None, parent=self, pos=(0.17, 0.0, -0.38), command=self.doState)
     self.backBtn = DirectButton(geom=(gui.find('**/Horiz_Arrow_UP'),
      gui.find('**/Horiz_Arrow_DN'),
      gui.find('**/Horiz_Arrow_Rllvr'),
      gui.find('**/Horiz_Arrow_UP')), relief=None, parent=self, pos=(-0.15, 0.0, -0.38), hpr=(180, 0, 0), command=self.doState)
     self.closeBtn = DirectButton(geom=CIGlobals.getCancelBtnGeom(), relief=None, parent=self, command=self.exitClicked)
     self.closeBtn.setPos(0.015, 0.0, -0.375)
     gui.removeNode()
     del gui
     self.hide()
     self.friends = {}
     self.onlineFriends = {}
     self.fsm = ClassicFSM.ClassicFSM('FriendsList', [State.State('off', self.enterOff, self.exitOff), State.State('onlineFriendsList', self.enterOnlineFriendsList, self.exitOnlineFriendsList), State.State('allFriendsList', self.enterAllFriendsList, self.exitAllFriendsList)], 'off', 'off')
     self.fsm.enterInitialState()
     self.accept('gotFriendsList', self.handleFriendsList)
     return
 def __init__(self, parent):
     DirectFrame.__init__(self, relief=None, state=DGG.NORMAL, sortOrder=DGG.BACKGROUND_SORT_INDEX)
     self.reparentTo(parent)
     self.active = 0
     self._initModel()
     self._initIntervals()
     return
 def __init__(self, name, barnacleGeom):
     self.config = RepairGlobals.Careening
     DirectFrame.__init__(self, parent = None, relief = None)
     self.barnacleGeom = barnacleGeom
     FSM.FSM.__init__(self, 'Barnacle_%sFSM' % name)
     self._initAudio()
     self._initVars()
     self._initGUI()
Beispiel #10
0
 def __init__(self, index):
     DirectFrame.__init__(self, scale=0.5)
     stickergui = loader.loadModel('phase_3.5/models/gui/stickerbook_gui.bam')
     self['image'] = stickergui.find('**/paper_note')
     self.setPos(self.spots[index])
     self.headingText = OnscreenText(parent=self, text='', font=CIGlobals.getToonFont(), pos=self.HeadingTextPos, scale=self.HeadingTextScale)
     self.taskInfoText = OnscreenText(parent=self, text='', font=CIGlobals.getToonFont(), pos=self.TaskInfoTextPos, scale=self.NonHeadingTextScale)
     self.progressText = OnscreenText(parent=self, text='', font=CIGlobals.getToonFont(), pos=self.ProgressTextPos, scale=self.ProgressTextScale)
     self.rewardText = OnscreenText(parent=self, text='', font=CIGlobals.getToonFont(), pos=self.RewardTextPos, scale=self.RewardTextScale)
     self.hide()
 def __init__(self, code):
     DirectFrame.__init__(self, relief=None, state=DGG.NORMAL, sortOrder=DGG.BACKGROUND_SORT_INDEX)
     self._code = str(code)
     self._codeLength = len(self._code)
     self._markersShown = 0
     self._markers = []
     self._initModel()
     self.setPos(*Globals.BossGuiPos)
     self.setScale(Globals.BossGuiScale)
     self.hide()
 def __init__(self, parent, useColor = 'blue', autoload = True):
     DirectFrame.__init__(self, parent)
     self.useColor = useColor
     self.endOffset = 1.5
     self.startOffset = 0.0
     self.shrinkRange = 7.0
     self.ratioDrawn = 0.0
     if autoload:
         self.load()
     self.stash()
 def __init__(
       self,
       parent=None,
       frameSize=(1, 1),
       dragbarSize=0.05,
       align=ALIGN_LEFT|ALIGN_TOP,
       orientation=HORIZONTAL,
       opendir=RIGHT_OR_DOWN,
       pos=Vec3(0,0,0),
       text='',
       toggleFunc=None,
       frameColor=(1,1,1,1),
     ):
   if parent is None:
     parent=aspect2d
   self.dragbarSize=dragbarSize
   self.align=align
   self.orientation=orientation
   self.opendir=opendir
   self.pos=pos
   self.frameSize=frameSize
   self.toggleFunc=toggleFunc
   
   self.collapsed=False
   
   DirectFrame.__init__(
       self, parent=parent,
       frameSize=(0,frameSize[0],0,frameSize[1]),
       frameColor=frameColor,
       suppressMouse=1,
     )
   self.initialiseoptions(DirectSidebar)
   self.resetFrameSize()
   
   self.collapseButton = DirectButton(
       parent=parent, 
       borderWidth=(0, 0),
       relief=DGG.FLAT,
       command=self.toggleCollapsed,
     )
   self.label = DirectLabel(
       parent=self.collapseButton,
       scale=0.04,
       text=text,
       text_align=TextNode.ACenter,
       frameColor=(0,0,0,0)
     )
   if self.orientation == HORIZONTAL:
     self.label.setPos(Vec3(frameSize[0]/2.,0,0.015))
   if self.orientation == VERTICAL:
     self.label.setPos(Vec3(0.035,0,frameSize[1]/2.))
     self.label.setR(-90)
   
   self.accept('window-event', self.update)
   self.update()
Beispiel #14
0
 def __init__(self):
     DirectFrame.__init__(self)
     self.trackByName = {}
     self.gagButtonByName = {}
     self.editButton = None
     self.fsm = ClassicFSM.ClassicFSM('BackpackGUI', [State.State('off', self.enterOff, self.exitOff), State.State('idle', self.enterIdle, self.exitIdle), State.State('edit', self.enterEditGags, self.exitEditGags)], 'off', 'off')
     self.fsm.enterInitialState()
     self.editFSM = ClassicFSM.ClassicFSM('BPGUIEdit', [State.State('off', self.enterOff, self.exitOff), State.State('add', self.enterAddGags, self.exitAddGags), State.State('remove', self.enterRemoveGags, self.exitRemoveGags)], 'off', 'off')
     self.editFSM.enterInitialState()
     self.gm = GagManager.GagManager()
     return
 def __init__(self, parent, level, pos2d = Globals.Gui.ProgressPos2D):
     DirectFrame.__init__(self, relief=None, state=DGG.NORMAL, sortOrder=DGG.BACKGROUND_SORT_INDEX)
     self._parent = parent
     self._level = level
     self.reparentTo(self._parent)
     self.setPos(pos2d[0], 0.0, pos2d[1])
     self._levelStartY = self._level.startPlatform.getModel().getY()
     self._levelEndY = self._level.endPlatform.getModel().getY()
     self._levelDistance = abs(self._levelEndY - self._levelStartY)
     self._toonMarkers = {}
     self._initModel()
 def __init__(self, parent, myDate, startDate, dayClickCallback=None, onlyFutureDaysClickable=False):
     self.origParent = parent
     self.startDate = startDate
     self.myDate = myDate
     self.dayClickCallback = dayClickCallback
     self.onlyFutureDaysClickable = onlyFutureDaysClickable
     DirectFrame.__init__(self, parent=parent)
     self.filter = ToontownGlobals.CalendarFilterShowAll
     self.load()
     self.createGuiObjects()
     self.update()
 def __init__(self, doneEvent):
     DirectFrame.__init__(self)
     self.doneEvent = doneEvent
     self.gui = loader.loadModel('phase_4/models/parties/publicPartyGUI')
     self.setPos(0.1, 0.0, 0.1)
     self.doneStatus = None
     self.activityIconsModel = loader.loadModel('phase_4/models/parties/eventSignIcons')
     self.normalFrameColor = Vec4(130 / 255.0, 174 / 255.0, 249 / 255.0, 1.0)
     self.selectedFrameColor = Vec4(1.0, 1.0, 0.0, 1.0)
     self.load()
     self.gui.removeNode()
     self.accept('stoppedAsleep', self._close)
Beispiel #18
0
 def __init__(self, avdna, hp, maxHp):
     DirectFrame.__init__(self, relief = None, sortOrder = 50)
     self.initialiseoptions(LaffMeter)
     self.container = DirectFrame(parent = self, relief = None)
     self.style = avdna
     self.av = None
     self.hp = hp
     self.maxHp = maxHp
     self._LaffMeter__obscured = 0
     if self.style.type == 't':
         self.isToon = 1
     else:
         self.isToon = 0
     self.load()
 def __init__(self, useImage = True, highlightNearEnd = True):
     if useImage:
         image = self.getImage()
     else:
         image = None
     DirectFrame.__init__(self, state = DGG.DISABLED, relief = None, scale = 0.45000000000000001, image = image, image_pos = (0, 0, 0), text = '0', text_fg = (0, 0, 0, 1), text_font = OTPGlobals.getInterfaceFont(), text_pos = (-0.01, -0.14999999999999999), text_scale = 0.34999999999999998)
     self.initialiseoptions(OTPTimer)
     self.timerId = OTPTimer.TimerId
     OTPTimer.TimerId += 1
     self.highlightNearEnd = highlightNearEnd
     self.countdownTask = None
     self.currentTime = 0
     self.taskTime = 0.0
     self.setFontColor(Vec4(0, 0, 0, 1))
 def __init__(self, id, code, modelToCopy):
     DirectFrame.__init__(self, relief=None, state=DGG.NORMAL, sortOrder=DGG.BACKGROUND_SORT_INDEX)
     self._id = id
     self._model = modelToCopy.copyTo(self)
     self._model.setPos(0, 0, 0)
     self._bg = self._model.find('**/bossBackground')
     self._bossIcon = self._model.find('**/bossIcon')
     self._bossIconX = self._model.find('**/bossIconX')
     self._bossIconX.reparentTo(self._bossIcon)
     self._bossIconX.hide()
     self._bg.hide()
     self._bossIcon.setBin('fixed', 2)
     self._bg.setBin('fixed', 3)
     self._label = DirectLabel(parent=self._bg, relief=None, scale=Globals.BossCodeFrameLabelScale, text=code, pos=(0, 0, -0.03), text_align=TextNode.ACenter, text_fg=Globals.BossCodeFrameLabelNormalColor, text_shadow=(0, 0, 0, 0), text_font=ToontownGlobals.getSuitFont())
 def __init__(self, parent, startingDateTime, scale = 1.0, pos = (0, 0, -0.1), dayClickCallback = None, onlyFutureDaysClickable = False, onlyFutureMonthsClickable = False):
     self.startDate = startingDateTime
     self.curDate = startingDateTime
     self.dayClickCallback = dayClickCallback
     self.onlyFutureDaysClickable = onlyFutureDaysClickable
     self.onlyFutureMonthsClickable = onlyFutureMonthsClickable
     if self.onlyFutureDaysClickable:
         self.onlyFutureMonthsClickable = True
     DirectFrame.__init__(self, parent=parent, scale=scale, pos=pos)
     self.showMarkers = config.GetBool('show-calendar-markers', 0)
     self.load()
     self.createGuiObjects()
     self.lastSelectedDate = None
     self.accept('clickedOnDay', self.clickedOnDay)
 def __init__(self, parent, repairGame, model):
     DirectFrame.__init__(self, parent = parent, relief = None, sortOrder = 40)
     self.repairGame = repairGame
     self.model = model
     self.gameIndicesToNames = { }
     self.staticElements = GUIFactory.generateStaticElements(self.model, self)
     self.buttons = GUIFactory.generateButtons(self.model, self, buttonClass = RepairGameButton, passNodePathToButton = True)
     self.staticElements['tab'].setBin('fixed', 31)
     self.staticElements['border1'].setBin('fixed', 33)
     self.staticElements['border2'].setBin('fixed', 33)
     self.staticElements['border3'].setBin('fixed', 33)
     self.staticElements['border4'].setBin('fixed', 33)
     self.staticElements['border5'].setBin('fixed', 33)
     self.stashTab()
     self.enabled = True
Beispiel #23
0
 def __init__(self, shop, image):
     DirectFrame.__init__(self)
     self.shop = shop
     self.bgImage = image
     self.title = None
     self.okBtn = None
     self.clBtn = None
     self.infoLbl = None
     self.nPage = -1
     self.nPages = 0
     self.nextPage = 0
     self.prevPage = -1
     self.pages = []
     self.isSetup = False
     return
 def __init__(self, parent):
     DirectFrame.__init__(self, parent=parent)
     self.gui = loader.loadModel('phase_5.5/models/parties/partyInviteGUI')
     self.inviteThemesIdToInfo = {PartyGlobals.InviteTheme.Birthday: (self.gui.find('**/birthdayPage'), TTLocalizer.PartyPlannerBirthdayTheme, (0.0, 0.0, 0.0, 1.0)),
      PartyGlobals.InviteTheme.GenericMale: (self.gui.find('**/genericMalePage'), TTLocalizer.PartyPlannerGenericMaleTheme, (0.7, 0.7, 0.0, 1.0)),
      PartyGlobals.InviteTheme.GenericFemale: (self.gui.find('**/genericFemalePage'), TTLocalizer.PartyPlannerGenericFemaleTheme, (0.0, 1.0, 0.5, 1.0)),
      PartyGlobals.InviteTheme.Racing: (self.gui.find('**/racingPage'), TTLocalizer.PartyPlannerRacingTheme, (0.0, 0.0, 0.0, 1.0)),
      PartyGlobals.InviteTheme.Valentoons: (self.gui.find('**/valentinePage1'), TTLocalizer.PartyPlannerValentoonsTheme, (0.0, 0.0, 0.0, 1.0)),
      PartyGlobals.InviteTheme.VictoryParty: (self.gui.find('**/victoryPartyPage'), TTLocalizer.PartyPlannerVictoryPartyTheme, (0.0, 0.0, 0.0, 1.0)),
      PartyGlobals.InviteTheme.Winter: (self.gui.find('**/winterPartyPage1'), TTLocalizer.PartyPlannerWinterPartyTheme, (1.0, 1.0, 1.0, 1.0))}
     self.inviteThemeBackground = DirectFrame(parent=self, image=self.inviteThemesIdToInfo[0][0], relief=None)
     self.whosePartyLabel = DirectLabel(parent=self, relief=None, pos=self.gui.find('**/who_locator').getPos(), text='.', text_scale=0.067, textMayChange=True)
     self.activityTextLabel = DirectLabel(parent=self, relief=None, text='.\n.\n.\n.', pos=self.gui.find('**/what_locator').getPos(), text_scale=TTLocalizer.IVactivityTextLabel, textMayChange=True)
     self.whenTextLabel = DirectLabel(parent=self, relief=None, text='.\n.\n.', pos=self.gui.find('**/when_locator').getPos(), text_scale=TTLocalizer.IVwhenTextLabel, textMayChange=True)
     self.noFriends = False
 def __init__(self, cannon):
     DirectFrame.__init__(self, parent = base.a2dLeftCenter, relief = None)
     self.msgMgr = AmmoPanelMessageManager()
     self.cannon = cannon
     self._bankNotes = 0
     self._initVars()
     self._initGUI()
     self._initSfx()
     self._createBankNoteText()
     self.currentLevel = 0
     self.levelUp(1)
     self.usedMagicWord = False
     self.flashIval = None
     for i in range(4):
         self.accept('%d' % (i + 1), self.triggerSkillWithHotkey, [
             i])
Beispiel #26
0
 def __init__(self):
     DirectFrame.__init__(self, parent=aspect2d, relief=None, geom=DGG.getDefaultDialogGeom(), geom_color=ToontownGlobals.GlobalDialogColor, geom_scale=(1.33, 1, 1.3), pos=(0, 0, 0), text='', text_scale=0.07, text_pos=(0, 0.475))
     self.initialiseoptions(LaffShopGui)
     
     self.additionalLaff = 0
     self.timer = ToontownTimer.ToontownTimer()
     self.timer.reparentTo(aspect2d)
     self.timer.posInTopRightCorner()
     self.timer.countdown(LaffRestockGlobals.TIMER_SECONDS, self.__cancel, [LaffRestockGlobals.TIMER_END])
     self.setupButtons()
     self.bindButtons()
     self.laffMeter = LaffMeter.LaffMeter(base.localAvatar.style, base.localAvatar.getHp(), base.localAvatar.getMaxHp())
     self.laffMeter.reparentTo(self)
     self.laffMeter.setPos(0, 0, 0.065)
     self.laffMeter.setScale(0.13)
     self.__updateLaffMeter(1)
Beispiel #27
0
 def __init__(self, parent, myDate, startDate, dayClickCallback = None, onlyFutureDaysClickable = False):
     self.origParent = parent
     self.startDate = startDate
     self.myDate = myDate
     self.dayClickCallback = dayClickCallback
     self.onlyFutureDaysClickable = onlyFutureDaysClickable
     DirectFrame.__init__(self, parent=parent)
     self.timedEvents = []
     self.partiesInvitedToToday = []
     self.hostedPartiesToday = []
     self.yearlyHolidaysToday = []
     self.showMarkers = base.config.GetBool('show-calendar-markers', 0)
     self.filter = ToontownGlobals.CalendarFilterShowAll
     self.load()
     self.createGuiObjects()
     self.update()
Beispiel #28
0
    def __init__(self, cannon):
        DirectFrame.__init__(self, parent=base.a2dLeftCenter, relief=None)
        self.msgMgr = AmmoPanelMessageManager()
        self.cannon = cannon
        self._bankNotes = 0
        self._initVars()
        self._initGUI()
        self._initSfx()
        self._createBankNoteText()
        self.currentLevel = 0
        self.levelUp(1)
        self.usedMagicWord = False
        self.flashIval = None
        for i in range(4):
            self.accept('%d' % (i + 1), self.triggerSkillWithHotkey, [i])

        return
Beispiel #29
0
 def __init__(self, parent, partyInfo):
     DirectFrame.__init__(self, parent, pos=(0.1, 0, -0.018))
     self.checkedHeight = True  # Hack... we don't have height
     self.partyInfo = partyInfo
     self.parent = parent
     self.inviteBackgrounds = loader.loadModel(
         "phase_4/models/parties/partyStickerbook")
     backgrounds = [
         "calendar_popup_birthday", "calendar_popup_fun",
         "calendar_popup_cupcake", "tt_t_gui_sbk_calendar_popup_racing",
         "tt_t_gui_sbk_calendar_popup_valentine1",
         "tt_t_gui_sbk_calendar_popup_victoryParty"
     ]
     self.background = DirectFrame(
         parent=self,
         relief=None,
         geom=self.inviteBackgrounds.find(
             "**/%s" % backgrounds[self.partyInfo.inviteTheme]),
         scale=(0.7, 1.0, 0.23),
         pos=(0.0, 0.0, -0.1),
     )
     self.whosePartyLabel = DirectLabel(
         parent=self,
         relief=None,
         pos=(0.07, 0.0, -0.04),
         text=" ",
         text_scale=0.04,
         text_wordwrap=8,
         textMayChange=True,
     )
     self.whenTextLabel = DirectLabel(
         parent=self,
         relief=None,
         text=" ",
         pos=(0.07, 0.0, -0.13),
         text_scale=0.04,
         textMayChange=True,
     )
     self.partyStatusLabel = DirectLabel(
         parent=self,
         relief=None,
         text=" ",
         pos=(0.07, 0.0, -0.175),
         text_scale=0.04,
         textMayChange=True,
     )
Beispiel #30
0
 def __init__(self, numPlayers, avIdList, votes, directions, namesList, disconnectedList, directionToGo, directionReason, directionTotals, *args, **kwargs):
     opts = {
         'relief': None,
         'geom': DGG.getDefaultDialogGeom(),
         'geom_color': ToontownGlobals.GlobalDialogColor[:3] + (0.80000000000000004,),
         'geom_scale': (1.75, 1, 0.75),
         'pos': (0, 0, 0.52500000000000002) }
     opts.update(kwargs)
     DirectFrame.__init__(self, *args, **args)
     self.initialiseoptions(VoteResultsPanel)
     listMultiplier = 1
     if TravelGameGlobals.SpoofFour:
         listMultiplier = 4
     
     self.avIdList = avIdList * listMultiplier
     self.numPlayers = numPlayers * listMultiplier
     self.votes = votes * listMultiplier
     self.directions = directions * listMultiplier
     self.namesList = namesList * listMultiplier
     self.disconnectedList = disconnectedList * listMultiplier
     self.directionToGo = directionToGo
     self.directionReason = directionReason
     self.directionTotals = directionTotals
     self.entryList = []
     self.rowFrame = []
     self.upDownFrame = DirectFrame(parent = self, relief = None, pos = self.getRowPos(-1))
     self.upLabel = DirectLabel(parent = self.upDownFrame, relief = None, pos = (1.2, 0, 0.0), text = TTLocalizer.TravelGameDirections[0], text_fg = (0.0, 0.0, 1.0, 1.0), text_scale = 0.050000000000000003, text_align = TextNode.ARight)
     self.downLabel = DirectLabel(parent = self.upDownFrame, relief = None, pos = (1.4299999999999999, 0, 0.0), text = TTLocalizer.TravelGameDirections[1], text_fg = (1.0, 0.0, 0.0, 1.0), text_scale = 0.050000000000000003, text_align = TextNode.ARight)
     self.totalFrame = DirectFrame(parent = self, relief = None, pos = self.getRowPos(self.numPlayers))
     self.totalText = DirectLabel(parent = self.totalFrame, relief = None, pos = (1.0, 0, 0.0), text = 'Total', text_fg = (0.0, 0.0, 0.0, 1.0), text_scale = 0.050000000000000003, text_align = TextNode.ARight)
     self.totalVotesUpLabel = DirectLabel(parent = self.totalFrame, relief = None, pos = (1.2, 0, 0.0), text = '', text_fg = (0.0, 0.0, 1.0, 1.0), text_scale = 0.050000000000000003, text_align = TextNode.ARight)
     self.totalVotesDownLabel = DirectLabel(parent = self.totalFrame, relief = None, pos = (1.4299999999999999, 0, 0.0), text = '', text_fg = (1.0, 0.0, 0.0, 1.0), text_scale = 0.050000000000000003, text_align = TextNode.ARight)
     self.totalVotesLabels = [
         self.totalVotesUpLabel,
         self.totalVotesDownLabel]
     self.resultFrame = DirectFrame(parent = self, relief = None, pos = self.getRowPos(5))
     self.resultLabel = DirectLabel(parent = self.resultFrame, text = '', text_scale = 0.059999999999999998, pos = (0.69999999999999996, 0, 0.0), text_align = TextNode.ACenter)
     self.setupResultLabel()
     for index in range(self.numPlayers):
         frame = DirectFrame(parent = self, relief = None, pos = self.getRowPos(index))
         self.rowFrame.append(frame)
         nameLabel = DirectFrame(parent = frame, relief = None, pos = (0.46000000000000002, 0.0, 0.0), text = self.namesList[index], text_fg = (0.0, 0.0, 0.0, 1.0), text_scale = 0.050000000000000003, text_align = TextNode.ACenter, text_font = DGG.getDefaultFont())
         votesUpLabel = DirectLabel(parent = frame, relief = None, pos = (1.2, 0.0, 0.0), text = '', text_fg = (0, 0, 1, 1), text_scale = 0.050000000000000003, text_align = TextNode.ARight, text_font = DGG.getDefaultFont())
         votesDownLabel = DirectLabel(parent = frame, relief = None, pos = (1.4299999999999999, 0.0, 0.0), text = '', text_fg = (1, 0, 0, 1), text_scale = 0.050000000000000003, text_align = TextNode.ARight, text_font = DGG.getDefaultFont())
         nameLabel.hide()
         self.entryList.append((nameLabel, votesUpLabel, votesDownLabel))
Beispiel #31
0
 def __init__(self, parent, **kwargs):
     cm = CardMaker('Portrait')
     cm.setFrame(Vec4(-1, 1, -1, 1))
     b = SceneBuffer('worldmap-buffer',
                     size=(512, 512),
                     clearColor=Vec4(0.84999999999999998))
     b.camLens.setNear(0.001)
     b.camLens.setFar(5.0)
     b.camera.node().getDisplayRegion(0).setIncompleteRender(False)
     self.buffer = b
     shot = NodePath(cm.generate())
     shot.setTexture(b.getTexture(), 1)
     optiondefs = (('relief', None, None), ('geom', shot, None))
     self.defineoptions(kwargs, optiondefs)
     DirectFrame.__init__(self, parent, **None)
     self.initialiseoptions(WorldMap)
     self.setTransparency(1)
     self.radius = 1.0
     self.camY = [-0.29999999999999999, 0.25]
     continue
     self.tiltLimit = [x * math.pi / 180 for x in (27, 33)]
     self.mapBall = DecoratedMapBall(
         'WorldMapArcBall',
         self,
         self.tiltLimit[1],
         mapSize=242000,
         radius=self.radius,
         scrollFactor=0.125,
         camera=b.camera,
         keepUpright=1,
         mouseDownEvent=self.getMouseDownEvent(),
         mouseUpEvent=self.getMouseUpEvent())
     self.render = b.getSceneRoot()
     self.worldRoot = self.render.attachNewNode('world')
     self.worldRoot.setTransparency(1)
     self.ballRoot = self.worldRoot.attachNewNode('ballRoot')
     self.ballRoot.setY(self.radius / 2.0)
     self.mapBall.reparentTo(self.ballRoot)
     self.mapBall.setInternalHpr(Vec3(0, 90, 0))
     self.mapBall.setNorth(Vec3(0, 1, 0))
     self.mapBall.setY(self.radius)
     self.setZoom(0)
     self.addLocalAvDart()
     self._hasLocalShip = False
     self._fleets = []
     self._enabled = False
 def __init__(self, parent, newsDir, dateStr, myIssueIndex, numIssues, strFilenames):
     DirectFrame.__init__(self, frameColor=(1, 1, 1, 0), frameSize=self.FrameDimensions, relief=DGG.FLAT, parent=parent)
     self.hide()
     self.accept('newsSnapshot', self.doSnapshot)
     self._parent = parent
     self.newsDir = newsDir
     self.dateStr = dateStr
     self.myIssueIndex = myIssueIndex
     self.numIssues = numIssues
     self.strFilenames = strFilenames
     self.sectionList = []
     self.sectionFrames = {}
     self.flatSubsectionList = []
     self.parseNewsContent()
     self.load()
     self.curSection = 0
     self.curSubsection = 0
	def __init__(self, parent, myDate, startDate, dayClickCallback = None, onlyFutureDaysClickable = False):
		self.origParent = parent
		self.startDate = startDate
		self.myDate = myDate
		
		self.dayClickCallback = dayClickCallback
		self.onlyFutureDaysClickable = onlyFutureDaysClickable
		DirectFrame.__init__(self, parent=parent)
		self.timedEvents = []
		self.partiesInvitedToToday = []
		self.hostedPartiesToday = []
		self.yearlyHolidaysToday = []
		self.showMarkers = config.GetBool('show-calendar-markers', 0)
		self.filter = ToontownGlobals.CalendarFilterShowAll
		self.load()
		self.createGuiObjects()
		self.update()
 def __init__(self, avdna, hp, maxHp, isLocalHealth = False):
     DirectFrame.__init__(self, relief=None, sortOrder=50)
     self.initialiseoptions(LaffMeter)
     self.style = avdna
     self.av = None
     self.hp = hp
     self.maxHp = maxHp
     self.__obscured = 0
     self.isLocalHealth = isLocalHealth
     self.container = DirectFrame(parent = self, relief = None)
     
     if self.style.type == 't':
         self.isToon = 1
     else:
         self.isToon = 0
     
     self.load()
	def __init__(self, parent, partyInfo):
		DirectFrame.__init__(self, parent, pos=(0.1, 0, -0.018))
		self.checkedHeight = True
		self.partyInfo = partyInfo
		self.parent = parent
		self.inviteBackgrounds = loader.loadModel('phase_4/models/parties/partyStickerbook')
		backgrounds = ['calendar_popup_birthday',
		 'calendar_popup_fun',
		 'calendar_popup_cupcake',
		 'tt_t_gui_sbk_calendar_popup_racing',
		 'tt_t_gui_sbk_calendar_popup_valentine1',
		 'tt_t_gui_sbk_calendar_popup_victoryParty',
		 'tt_t_gui_sbk_calendar_popup_winter1']
		self.background = DirectFrame(parent=self, relief=None, geom=self.inviteBackgrounds.find('**/%s' % backgrounds[self.partyInfo.inviteTheme]), scale=(0.7, 1.0, 0.23), pos=(0.0, 0.0, -0.1))
		self.whosePartyLabel = DirectLabel(parent=self, relief=None, pos=(0.07, 0.0, -0.04), text=' ', text_scale=0.04, text_wordwrap=8, textMayChange=True)
		self.whenTextLabel = DirectLabel(parent=self, relief=None, text=' ', pos=(0.07, 0.0, -0.13), text_scale=0.04, textMayChange=True)
		self.partyStatusLabel = DirectLabel(parent=self, relief=None, text=' ', pos=(0.07, 0.0, -0.175), text_scale=0.04, textMayChange=True)
    def __init__(self, forRender=False):
        DirectFrame.__init__(self,
                             relief=None,
                             sortOrder=50,
                             parent=base.a2dBottomLeft)
        self.initialiseoptions(LaffOMeter)
        self.container = DirectFrame(parent=self, relief=None)
        self.container.setBin('gui-popup', 60)

        if forRender:
            self.container.setY(0)
            self.setLightOff()
            self.setFogOff()
            self.setMaterialOff()
            self.setAttrib(BloomAttrib.make(False))
            self.hide(CIGlobals.ShadowCameraBitmask)
        self.forRender = forRender
 def __init__(self, parent, partyInfo):
     DirectFrame.__init__(self,
                          parent,
                          pos=(0.10000000000000001, 0,
                               -0.017999999999999999))
     self.checkedHeight = True
     self.partyInfo = partyInfo
     self.parent = parent
     self.inviteBackgrounds = loader.loadModel(
         'phase_4/models/parties/partyStickerbook')
     backgrounds = [
         'calendar_popup_birthday', 'calendar_popup_fun',
         'calendar_popup_cupcake', 'tt_t_gui_sbk_calendar_popup_racing',
         'tt_t_gui_sbk_calendar_popup_valentine1',
         'tt_t_gui_sbk_calendar_popup_victoryParty',
         'tt_t_gui_sbk_calendar_popup_winter1'
     ]
     self.background = DirectFrame(
         parent=self,
         relief=None,
         geom=self.inviteBackgrounds.find(
             '**/%s' % backgrounds[self.partyInfo.inviteTheme]),
         scale=(0.69999999999999996, 1.0, 0.23000000000000001),
         pos=(0.0, 0.0, -0.10000000000000001))
     self.whosePartyLabel = DirectLabel(parent=self,
                                        relief=None,
                                        pos=(0.070000000000000007, 0.0,
                                             -0.040000000000000001),
                                        text=' ',
                                        text_scale=0.040000000000000001,
                                        text_wordwrap=8,
                                        textMayChange=True)
     self.whenTextLabel = DirectLabel(parent=self,
                                      relief=None,
                                      text=' ',
                                      pos=(0.070000000000000007, 0.0,
                                           -0.13),
                                      text_scale=0.040000000000000001,
                                      textMayChange=True)
     self.partyStatusLabel = DirectLabel(parent=self,
                                         relief=None,
                                         text=' ',
                                         pos=(0.070000000000000007, 0.0,
                                              -0.17499999999999999),
                                         text_scale=0.040000000000000001,
                                         textMayChange=True)
Beispiel #38
0
 def __init__(self, parent, newsDir, dateStr, myIssueIndex, numIssues, strFilenames):
     DirectFrame.__init__(self, frameColor=(1, 1, 1, 0), frameSize=self.FrameDimensions, relief=DGG.FLAT, parent=parent)
     self.hide()
     self.accept('newsSnapshot', self.doSnapshot)
     self.parent = parent
     self.newsDir = newsDir
     self.dateStr = dateStr
     self.myIssueIndex = myIssueIndex
     self.numIssues = numIssues
     self.strFilenames = strFilenames
     self.sectionList = []
     self.sectionFrames = {}
     self.flatSubsectionList = []
     self.parseNewsContent()
     self.load()
     self.curSection = 0
     self.curSubsection = 0
Beispiel #39
0
    def __init__(self, doneEvent):
        DirectFrame.__init__(self)
        self.doneEvent = doneEvent

        # Public party gui
        self.gui = loader.loadModel("phase_4/models/parties/publicPartyGUI")
        self.setPos(0.1, 0.0, 0.1)
        self.doneStatus = None
        self.activityIconsModel = loader.loadModel(
            "phase_4/models/parties/eventSignIcons")

        self.normalFrameColor = Vec4(130 / 255.0, 174 / 255.0, 249 / 255.0,
                                     1.0)
        self.selectedFrameColor = Vec4(1.0, 1.0, 0.0, 1.0)
        self.load()
        self.gui.removeNode()
        self.accept("stoppedAsleep", self._close)
 def __init__(self, index):
     DirectFrame.__init__(self, scale=0.5)
     stickergui = loader.loadModel(
         'phase_3.5/models/gui/stickerbook_gui.bam')
     self['image'] = stickergui.find('**/paper_note')
     self['image_scale'] = (1.3, 1, 1)
     self.setPos(self.spots[index])
     self.useProgressBar = False
     self.headingText = OnscreenText(parent=self,
                                     text="",
                                     font=CIGlobals.getToonFont(),
                                     pos=self.HeadingTextPos,
                                     scale=self.HeadingTextScale)
     self.taskInfoText = OnscreenText(parent=self,
                                      text="",
                                      font=CIGlobals.getToonFont(),
                                      pos=self.TaskInfoTextPos,
                                      scale=self.NonHeadingTextScale)
     self.progressText = OnscreenText(parent=self,
                                      text="",
                                      font=CIGlobals.getToonFont(),
                                      pos=self.ProgressTextPos,
                                      scale=self.ProgressTextScale)
     self.progressBar = DirectWaitBar(
         parent=self,
         relief=DGG.SUNKEN,
         frameSize=(-0.95, 0.95, -0.1, 0.12),
         borderWidth=(0.025, 0.025),
         scale=0.4,
         frameColor=(251.0 / 255, 252.0 / 255, 176.0 / 255, 1.0),
         barColor=(0.5, 0.7, 0.5, 1),
         text='0/0',
         text_font=CIGlobals.getToonFont(),
         text_scale=0.19,
         text_fg=(0.05, 0.14, 0.4, 1),
         text_align=TextNode.ACenter,
         text_pos=(0, -0.05),  #-0.02
         pos=self.ProgressBarPos)
     self.progressBar.hide()
     self.rewardText = OnscreenText(parent=self,
                                    text="",
                                    font=CIGlobals.getToonFont(),
                                    pos=self.RewardTextPos,
                                    scale=self.RewardTextScale,
                                    fg=(1, 0.1, 0.1, 1.0))
     self.hide()
Beispiel #41
0
    def __init__(self,
                 mazeCollTable,
                 maskResolution=None,
                 radiusRatio=None,
                 bgColor=(0.80000000000000004, 0.80000000000000004,
                          0.80000000000000004),
                 fgColor=(0.5, 0.5, 0.5, 1.0)):
        DirectFrame.__init__(self,
                             relief=None,
                             state=DGG.NORMAL,
                             sortOrder=DGG.BACKGROUND_SORT_INDEX)
        self.hide()
        self._bgColor = bgColor
        self._fgColor = fgColor
        self._mazeCollTable = mazeCollTable
        self._mazeWidth = len(self._mazeCollTable[0])
        self._mazeHeight = len(self._mazeCollTable)
        if not maskResolution:
            pass
        self._maskResolution = DEFAULT_MASK_RESOLUTION
        if radiusRatio is None:
            self._radius = self._maskResolution * DEFAULT_RADIUS_RATIO
        else:
            self._radius = self._maskResolution * radiusRatio
        self._revealedCells = []
        for y in range(self._mazeHeight):
            self._revealedCells.append([])
            for u in range(self._mazeWidth):
                self._revealedCells[y].append(False)

        self._revealFunctions = {
            MazeRevealType.SmoothCircle: self._revealSmoothCircle,
            MazeRevealType.HardCircle: self._revealHardCircle,
            MazeRevealType.Square: self._revealSquare
        }
        self._revealFunction = MAZE_REVEAL_TYPE
        self.map = self._createMapTextureCard()
        self.map.reparentTo(self)
        self.maskedLayer = self.attachNewNode('maskedLayer')
        self.mask = self._createMaskTextureCard()
        self.mask.reparentTo(self)
        self.visibleLayer = self.attachNewNode('visibleLayer')
        self._laffMeterModel = loader.loadModel(
            'phase_3/models/gui/laff_o_meter')
        self._toon2marker = {}
Beispiel #42
0
 def __init__(self, ug):
     DirectFrame.__init__(self,
                          relief=None,
                          sortOrder=50,
                          parent=base.a2dBottomCenter)
     self.initialiseoptions(UnoGameCardDeck)
     self.container = DirectFrame(parent=self, relief=None)
     self.title = None
     self.cards = []
     self.cardBtns = []
     self.numCards = 0
     self.unoGame = ug
     self.deck = None
     self.cardToFollowGui = None
     self.holiday = base.cr.holidayManager.getHoliday()
     self.gui = None
     self.loadCards()
     return
Beispiel #43
0
 def __init__(self, parent = None, **kwargs):
     optiondefs = (('relief', None, None), ('state', DGG.DISABLED, None), ('maxMessages', 3, self.setMaxMessages), ('messageBorder', 0.0050000000000000001, self.setMessageBorder), ('posLerpTime', 0.25, self.setPosLerpTime), ('fadeLerpTime', 0.25, self.setFadeLerpTime))
     self.defineoptions(kwargs, optiondefs, dynamicGroups = ('posLerpTime', 'fadeLerpTime', 'messageBorder'))
     DirectFrame.__init__(self, parent, **None)
     self.initialiseoptions(MessageStackPanel)
     if not MessageStackPanel.popupSfx:
         MessageStackPanel.popupSfx = loadSfx(SoundGlobals.SFX_GUI_STACK_POPUP)
     
     self.setTransparency(True)
     self.msgStack = []
     self.msgIvals = { }
     self.slideIval = None
     self.task = None
     self.lastMessage = None
     self.shipMessage = None
     self.startPos = self.getPos()
     self.setPos(self._getSlidePos())
     self.hide()
 def __init__(self, shop, image, wantTurretCount):
     DirectFrame.__init__(self)
     self.shop = shop
     self.wantTurretCount = wantTurretCount
     self.bgImage = image
     self.title = None
     self.okBtn = None
     self.clBtn = None
     self.infoLbl = None
     self.turretLabel = None
     self.turretImg = None
     self.nPage = -1
     self.nPages = 0
     self.nextPage = 0
     self.prevPage = -1
     self.pages = []
     self.isSetup = False
     self.turretCount = 0
 def __init__(self):
     DirectFrame.__init__(self)
     self.trackByName = {}
     self.gagButtonByName = {}
     self.editButton = None
     self.fsm = ClassicFSM.ClassicFSM('BackpackGUI', [
         State.State('off', self.enterOff, self.exitOff),
         State.State('idle', self.enterIdle, self.exitIdle),
         State.State('edit', self.enterEditGags, self.exitEditGags)
     ], 'off', 'off')
     self.fsm.enterInitialState()
     self.editFSM = ClassicFSM.ClassicFSM('BPGUIEdit', [
         State.State('off', self.enterOff, self.exitOff),
         State.State('add', self.enterAddGags, self.exitAddGags),
         State.State('remove', self.enterRemoveGags, self.exitRemoveGags)
     ], 'off', 'off')
     self.editFSM.enterInitialState()
     self.gm = GagManager.GagManager()
 def __init__(self):
     try:
         self.Timer_initialized
         return
     except:
         self.Timer_initialized = 1
     DirectFrame.__init__(self,
                          pos=(-0.15, 0, -0.15),
                          scale=0.4,
                          parent=base.a2dTopRight)
     self.setBin('gui-popup', 60)
     self.timer = None
     self.timeLbl = None
     self.initTime = 0
     self.zeroCommand = None
     self.time = 0
     self.timerSeq = None
     return
Beispiel #47
0
 def __init__(self, exp, level, avdna):
     DirectFrame.__init__(self, relief=None, sortOrder=50)
     self.av = None
     self.style = avdna
     if self.style.type == 't':
         self.isToon = 1
     else:
         self.isToon = 0
     
     self.exp = exp
     self.level = level
     self.maxExp = ToonExperience.ToonExperience().getLevelMaxExp(self.level)
     self.expBar = None
     self.__obscured = 0
     self.bgBar = None
     self.levelLabel = None
     self.visToggle = None
     self.levelUpSfx = loader.loadSfx('phase_3.5/audio/sfx/AV_levelup.ogg')
     self.load()
Beispiel #48
0
 def __init__(self, parent, repairGame, model):
     DirectFrame.__init__(self, parent=parent, relief=None, sortOrder=40)
     self.repairGame = repairGame
     self.model = model
     self.gameIndicesToNames = {}
     self.staticElements = GUIFactory.generateStaticElements(
         self.model, self)
     self.buttons = GUIFactory.generateButtons(self.model,
                                               self,
                                               buttonClass=RepairGameButton,
                                               passNodePathToButton=True)
     self.staticElements['tab'].setBin('fixed', 31)
     self.staticElements['border1'].setBin('fixed', 33)
     self.staticElements['border2'].setBin('fixed', 33)
     self.staticElements['border3'].setBin('fixed', 33)
     self.staticElements['border4'].setBin('fixed', 33)
     self.staticElements['border5'].setBin('fixed', 33)
     self.stashTab()
     self.enabled = True
 def __init__(self, repairGame, name, startText):
     DirectFrame.__init__(self, parent=repairGame.gui, relief=None)
     FSM.FSM.__init__(self, '%sFSM' % name)
     self.defaultTransitions = {
         'Idle': ['Intro', 'Final'],
         'Intro': ['Game', 'Idle', 'Final'],
         'Game': ['Outro', 'Idle', 'Final'],
         'Outro': ['Idle', 'Final'],
         'Final': []
     }
     self.name = name
     self.repairGame = repairGame
     self.startText = startText
     self._initVars()
     self._initAudio()
     self._initVisuals()
     self._initIntervals()
     self.request('Idle')
     return
Beispiel #50
0
    def __init__(self, size):
        DirectFrame.__init__(self,
                             parent=aspect2d,
                             pos=(0, -1.0, 0),
                             relief=None)
        image = loader.loadModel(
            "phase_4/models/minigames/photo_game_viewfinder.bam")
        self['image'] = image
        self['image_scale'] = (size, 1.0, size)

        self.screenSizeMult = size * Viewfinder.Ratio

        self.setTransparency(True)
        self.setDepthWrite(1)
        self.setDepthTest(1)

        self.initialiseoptions(Viewfinder)

        self.captureCam = NodePath(Camera("CaptureCamera"))
        self.captureCam.reparentTo(base.camera)
        self.captureLens = PerspectiveLens()
        self.captureCam.node().setLens(self.captureLens)

        self.focusTrav = CollisionTraverser('focusTrav')
        ray = CollisionRay()
        rayNode = CollisionNode('rayNode')
        rayNode.addSolid(ray)
        rayNode.setCollideMask(BitMask32(0))
        rayNode.setFromCollideMask(CIGlobals.WallBitmask)
        self.focusRay = ray
        self.focusRayNode = self.captureCam.attachNewNode(rayNode)
        self.focusHandler = CollisionHandlerQueue()
        self.focusTrav.addCollider(self.focusRayNode, self.focusHandler)

        self.textureBuffer = base.win.makeTextureBuffer(
            "ViewFinderCapture", int(128 * 1.33), 128)
        self.displayRegion = self.textureBuffer.makeDisplayRegion()
        self.displayRegion.setCamera(self.captureCam)

        self.__updateRegions()

        taskMgr.add(self.__update, "viewfinderUpdate")
    def __init__(self, dept, maxHp, **kw):
        DirectFrame.__init__(self, parent=render2d, relief=None, **kw)
        self.dept = dept
        self.filePrefix = ModelDict[dept]
        self.maxHp = float(maxHp)
        self.hp = self.maxHp

        self.head = None
        self.headActor = None
        self.animDict = {}

        self.healthBar = None
        self.healthCondition = None
        self.hitInterval = None
        self.blinkTask = None

        self.dizzy = False
        self.helmet = False

        self.healthColors = Suit.Suit.healthColors
 def __init__(self,
              parent,
              startingDateTime,
              scale=1.0,
              pos=(0, 0, -0.1),
              dayClickCallback=None,
              onlyFutureDaysClickable=False,
              onlyFutureMonthsClickable=False):
     self.startDate = startingDateTime
     self.curDate = startingDateTime
     self.dayClickCallback = dayClickCallback
     self.onlyFutureDaysClickable = onlyFutureDaysClickable
     self.onlyFutureMonthsClickable = onlyFutureMonthsClickable
     if self.onlyFutureDaysClickable:
         self.onlyFutureMonthsClickable = True
     DirectFrame.__init__(self, parent=parent, scale=scale, pos=pos)
     self.load()
     self.createGuiObjects()
     self.lastSelectedDate = None
     self.accept('clickedOnDay', self.clickedOnDay)
Beispiel #53
0
 def __init__(self, useImage=True, highlightNearEnd=True):
     if useImage:
         image = self.getImage()
     else:
         image = None
     DirectFrame.__init__(self, state=DGG.DISABLED, relief=None, scale=0.45, image=image, image_pos=(0,
                                                                                                     0,
                                                                                                     0), text='0', text_fg=(0,
                                                                                                                            0,
                                                                                                                            0,
                                                                                                                            1), text_font=OTPGlobals.getInterfaceFont(), text_pos=(-0.01, -0.15), text_scale=0.35)
     self.initialiseoptions(OTPTimer)
     self.timerId = OTPTimer.TimerId
     OTPTimer.TimerId += 1
     self.highlightNearEnd = highlightNearEnd
     self.countdownTask = None
     self.currentTime = 0
     self.taskTime = 0.0
     self.setFontColor(Vec4(0, 0, 0, 1))
     return
Beispiel #54
0
 def __init__(self, font):
     image = self.getImage()
     DirectFrame.__init__(self,
                          state=DGG.DISABLED,
                          relief=None,
                          scale=0.45,
                          image=image,
                          image_pos=(0, 0, 0),
                          text='0',
                          text_fg=(0, 0, 0, 1),
                          text_font=font,
                          text_pos=(-0.01, -0.15),
                          text_scale=0.35)
     self.initialiseoptions(Timer)
     self.timerId = Timer.TimerId
     Timer.TimerId += 1
     self.countdownTask = None
     self.currentTime = 0
     self.taskTime = 0.0
     self.vFontColor = Vec4(0, 0, 0, 1)
Beispiel #55
0
    def __init__(self, avdna, hp, maxHp):
        """__init(self, AvatarDNA, int, int)
        LaffMeter constructor: create a laff-o-meter for a given DA
        """
        DirectFrame.__init__(self, relief=None, sortOrder=50)
        self.initialiseoptions(LaffMeter)

        # This is to contain the scale for the animated effect
        self.container = DirectFrame(parent=self, relief=None)

        self.style = avdna
        self.av = None
        self.hp = hp
        self.maxHp = maxHp
        self.__obscured = 0
        if (self.style.type == 't'):
            self.isToon = 1
        else:
            self.isToon = 0
        self.load()
Beispiel #56
0
    def __init__(self, gsg, trackId):
        DirectFrame.__init__(self)
        self.gsg = gsg
        self.trackId = trackId
        self.trackName = GagGlobals.TrackNameById[trackId]
        self['image'] = 'phase_14/maps/track_bar.png'
        self['image_scale'] = (1.119, 0, 0.152)
        self['relief'] = None
        color = GagGlobals.TrackColorByName[self.trackName]
        self['image_color'] = (color[0], color[1], color[2], 1)

        self.trackText = OnscreenText(text=self.trackName.upper(),
                                      fg=(0, 0, 0, 0.65),
                                      shadow=(0, 0, 0, 0),
                                      pos=(-0.825, -0.022),
                                      scale=0.12 * (3.0 / 4.0),
                                      align=TextNode.ACenter,
                                      parent=self)
        self.gagBtns = []

        self.currentGag = 0
Beispiel #57
0
    def __init__(self, av, **kw):
        DirectFrame.__init__(self, relief=None, sortOrder=50)
        self.initialiseoptions(QuestMap)
        self.container = DirectFrame(parent=self, relief=None)
        self.marker = DirectFrame(parent=self.container, relief=None)
        self.cogInfoFrame = DirectFrame(parent=self.container, relief=None)
        cm = CardMaker('bg')
        cm.setFrame(-0.5, 0.5, -0.5, 0.5)
        bg = self.cogInfoFrame.attachNewNode(cm.generate())
        bg.setTransparency(1)
        bg.setColor(0.5, 0.5, 0.5, 0.5)
        bg.setBin('fixed', 0)
        self.cogInfoFrame['geom'] = bg
        self.cogInfoFrame['geom_pos'] = (0, 0, 0)
        self.cogInfoFrame['geom_scale'] = (6, 1, 2)
        self.cogInfoFrame.setScale(0.05)
        self.cogInfoFrame.setPos(0, 0, 0.6)
        self.buildingMarkers = []
        self.av = av
        self.wantToggle = False
        if base.config.GetBool('want-toggle-quest-map', True):
            self.wantToggle = True
        self.updateMarker = True
        self.cornerPosInfo = None
        self.hqPosInfo = None
        self.fishingSpotInfo = None
        self.load()
        self.setScale(1.5)
        bg.removeNode()
        self.hoodId = None
        self.zoneId = None
        self.suitPercentage = {}
        for currHoodInfo in SuitPlannerBase.SuitPlannerBase.SuitHoodInfo:
            tracks = currHoodInfo[
                SuitPlannerBase.SuitPlannerBase.SUIT_HOOD_INFO_TRACK]
            self.suitPercentage[currHoodInfo[
                SuitPlannerBase.SuitPlannerBase.SUIT_HOOD_INFO_ZONE]] = tracks

        return
Beispiel #58
0
 def __init__(self, doneEvent=None):
     FSM.__init__(self, 'PartyPlannerFSM')
     DirectFrame.__init__(self)
     self.doneEvent = doneEvent
     self.stateArray = [
         'Off',
         'Welcome',
         'PartyEditor',
         #'Guests',  jjkoletar: this should mean that it skips over the guests state
         'Date',
         'Time',
         'Invitation',
         'Farewell'
     ]
     self.partyTime = base.cr.toontownTimeManager.getCurServerDateTime()
     self.partyNowTime = base.cr.toontownTimeManager.getCurServerDateTime()
     minutesToNextFifteen = 15 - self.partyTime.minute % 15
     self.cleanPartyTime = self.partyTime + timedelta(
         minutes=minutesToNextFifteen, seconds=-self.partyTime.second)
     self.partyTime = self.cleanPartyTime
     self.guests = []
     self.isPrivate = False
     self.selectedCalendarGuiDay = None
     self.gui = loader.loadModel('phase_4/models/parties/partyPlannerGUI')
     self.partyDuration = timedelta(hours=PartyGlobals.DefaultPartyDuration)
     self.timeTypeToMaxValue = {'hour': 23, 'minute': 59}
     self.timeTypeToChangeAmount = {
         'hour': (1, -1),
         'minute': (15, -15),
         'ampm': (1, -1)
     }
     self.partyInfo = None
     self.asapMinuteRounding = base.config.GetInt(
         'party-asap-minute-rounding',
         PartyGlobals.PartyPlannerAsapMinuteRounding)
     self.load()
     self.request('Welcome')
     return
Beispiel #59
0
 def __init__(self, repairGame):
     DirectFrame.__init__(self, parent=base.a2dBackground, relief=None)
     self.repairGame = repairGame
     base.loadingScreen.beginStep('Sound', 1, 10)
     self._initSound()
     base.loadingScreen.endStep('Sound')
     base.loadingScreen.beginStep('GUI', 1, 43)
     self._initGUI()
     base.loadingScreen.endStep('GUI')
     self.accept('clientLogout', self.handleExitGame)
     if base.localAvatar.guiMgr.seaChestActive:
         base.localAvatar.guiMgr.hideSeaChest()
     if base.localAvatar.guiMgr.minimap:
         base.localAvatar.guiMgr.hideMinimap()
     self.accept('seachestOpened', self.handleExitGame)
     self.accept('avatarDetailsOpened', self.handleExitGame)
     self.accept('minimapOpened', self.handleExitGame)
     self.setBin('fixed', 30)
     self.setZ(-0.2)
     base.loadingScreen.beginStep('Intervals')
     self._initIntervals()
     base.loadingScreen.endStep('Intervals')
     return