• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python parties.PartyUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中toontown.parties.PartyUtils的典型用法代码示例。如果您正苦于以下问题:Python PartyUtils类的具体用法?Python PartyUtils怎么用?Python PartyUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了PartyUtils类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: loadInvitations

    def loadInvitations(self):
        EventsPage.notify.debug('loadInvitations')
        self.selectedInvitationItem = None
        self.invitationPartyList.removeAndDestroyAllItems()
        self.invitationActivityList.removeAndDestroyAllItems()
        self.invitePartyGoButton['state'] = DirectGuiGlobals.DISABLED
        for partyInfo in base.localAvatar.partiesInvitedTo:
            if partyInfo.status == PartyGlobals.PartyStatus.Cancelled or partyInfo.status == PartyGlobals.PartyStatus.Finished:
                continue
            inviteInfo = None
            for inviteInfo in base.localAvatar.invites:
                if partyInfo.partyId == inviteInfo.partyId:
                    break

            if inviteInfo is None:
                EventsPage.notify.error('No invitation info for party id %d' % partyInfo.partyId)
                return
            if inviteInfo.status == PartyGlobals.InviteStatus.NotRead:
                continue
            hostName = self.getToonNameFromAvId(partyInfo.hostId)
            item = DirectButton(relief=None, text=hostName, text_align=TextNode.ALeft, text_bg=Vec4(0.0, 0.0, 0.0, 0.0), text_scale=0.045, textMayChange=True, command=self.invitePartyClicked)
            PartyUtils.truncateTextOfLabelBasedOnWidth(item, hostName, PartyGlobals.EventsPageHostNameMaxWidth)
            item['extraArgs'] = [item]
            item.setPythonTag('activityIds', partyInfo.getActivityIds())
            item.setPythonTag('partyStatus', partyInfo.status)
            item.setPythonTag('hostId', partyInfo.hostId)
            item.setPythonTag('startTime', partyInfo.startTime)
            self.invitationPartyList.addItem(item)

        return
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:30,代码来源:EventsPage.py


示例2: __init__

 def __init__(self, air, parent, activityTuple):
     DistributedObjectAI.__init__(self, air)
     self.parent = parent
     x, y, h = activityTuple[1:] # ignore activity ID
     self.x = PartyUtils.convertDistanceFromPartyGrid(x, 0)
     self.y = PartyUtils.convertDistanceFromPartyGrid(y, 1)
     self.h = h * PartyGlobals.PartyGridHeadingConverter
     self.toonsPlaying = []
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:8,代码来源:DistributedPartyActivityAI.py


示例3: getCorrectRotation

 def getCorrectRotation(self):
     r = self.getR()
     if r == 90.0:
         r = 270.0
     elif r == 270.0:
         r = 90.0
     if self.id == PartyGlobals.ActivityIds.PartyCannon:
         return PartyUtils.convertDegreesToPartyGrid(r + 180.0)
     return PartyUtils.convertDegreesToPartyGrid(r)
开发者ID:MasterLoopyBM,项目名称:c0d3,代码行数:9,代码来源:PartyEditorGridElement.py


示例4: getGuestItem

 def getGuestItem(self, name, inviteStatus):
     label = DirectLabel(relief=None, text=name, text_scale=0.045, text_align=TextNode.ALeft, textMayChange=True)
     dot = DirectFrame(relief=None, geom=self.hostingGui.find('**/questionMark'), pos=(0.5, 0.0, 0.01))
     if inviteStatus == PartyGlobals.InviteStatus.Accepted:
         dot['geom'] = (self.hostingGui.find('**/checkmark'),)
     elif inviteStatus == PartyGlobals.InviteStatus.Rejected:
         dot['geom'] = (self.hostingGui.find('**/x'),)
     PartyUtils.truncateTextOfLabelBasedOnWidth(label, name, PartyGlobals.EventsPageGuestNameMaxWidth)
     dot.reparentTo(label)
     return label
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:10,代码来源:EventsPage.py


示例5: enterTime

 def enterTime(self, *args):
     self.prevButton.show()
     self.prevButton['state'] = DirectGuiGlobals.NORMAL
     self.nextButton.show()
     self.timePage.show()
     self.timePageRecapToontownTimeLabel2['text'] = '%s' % PartyUtils.formatDateTime(self.partyTime)
     self.timePageRecapLocalTimeLabel['text'] = '%s%s' % (TTLocalizer.PartyPlannerTimeLocalTime, PartyUtils.formatDateTime(self.partyTime, inLocalTime=True))
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:7,代码来源:PartyPlanner.py


示例6: changeValue

 def changeValue(self, amount):
     if type == 'ampm':
         self.alterPartyTime(hour=(self.partyTime.hour + 12) % 24)
         newAmount = self.getCurrentAmPm()
         label['text'] = newAmount
     else:
         if type == 'hour':
             newAmount = getattr(self.partyTime, type) + amount
             newAmount = newAmount % 12
             if self.timeInputAmPmLabel['text'] == TTLocalizer.PartyTimeFormatMeridiemPM:
                 newAmount = newAmount % 12 + 12
             self.alterPartyTime(hour=newAmount)
         elif type == 'minute':
             newAmount = getattr(self.partyTime, type) + amount
             self.alterPartyTime(minute=newAmount)
         else:
             PartyPlanner.notify.error('Invalid type for changeValue in PartyPlanner: %s' % type)
         newAmount = getattr(self.partyTime, type)
         if newAmount < 10 and type == 'minute':
             label['text'] = '0%d' % newAmount
         else:
             if type == 'hour':
                 newAmount = newAmount % 12
                 if newAmount == 0:
                     newAmount = 12
             label['text'] = '%d' % newAmount
     self.timePageRecapToontownTimeLabel2['text'] = '%s' % PartyUtils.formatDateTime(self.partyTime)
     self.timePageRecapLocalTimeLabel['text'] = '%s%s' % (TTLocalizer.PartyPlannerTimeLocalTime, PartyUtils.formatDateTime(self.partyTime, inLocalTime=True))
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:28,代码来源:PartyPlanner.py


示例7: load

    def load(self):
        if self.__loaded:
            return
        self.__timerPad = PartyUtils.getNewToontownTimer()
        guiModel = 'phase_4/models/gui/cannon_game_gui'
        guiNode = loader.loadModel(guiModel)
        self.__aimPad = DirectFrame(image=guiNode.find('**/CannonFire_PAD'), relief=None, pos=(0.7, 0, -0.553333), scale=0.8)
        guiNode.removeNode()
        self.fireButton = DirectButton(parent=self.__aimPad, image=((guiModel, '**/Fire_Btn_UP'), (guiModel, '**/Fire_Btn_DN'), (guiModel, '**/Fire_Btn_RLVR')), relief=None, pos=(0.0115741, 0, 0.00505051), scale=1.0, command=self.__firePressed)
        self.upButton = DirectButton(parent=self.__aimPad, image=((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief=None, pos=(0.0115741, 0, 0.221717))
        self.downButton = DirectButton(parent=self.__aimPad, image=((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief=None, pos=(0.0136112, 0, -0.210101), image_hpr=(0, 0, 180))
        self.leftButton = DirectButton(parent=self.__aimPad, image=((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief=None, pos=(-0.199352, 0, -0.000505269), image_hpr=(0, 0, -90))
        self.rightButton = DirectButton(parent=self.__aimPad, image=((guiModel, '**/Cannon_Arrow_UP'), (guiModel, '**/Cannon_Arrow_DN'), (guiModel, '**/Cannon_Arrow_RLVR')), relief=None, pos=(0.219167, 0, -0.00101024), image_hpr=(0, 0, 90))
        self.__aimPad.setColor(1, 1, 1, 0.9)

        def bindButton(button, upHandler, downHandler):
            button.bind(DGG.B1PRESS, lambda x, handler = upHandler: handler())
            button.bind(DGG.B1RELEASE, lambda x, handler = downHandler: handler())

        bindButton(self.upButton, self.__upPressed, self.__upReleased)
        bindButton(self.downButton, self.__downPressed, self.__downReleased)
        bindButton(self.leftButton, self.__leftPressed, self.__leftReleased)
        bindButton(self.rightButton, self.__rightPressed, self.__rightReleased)
        self.__loaded = True
        return
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:25,代码来源:CannonGui.py


示例8: loadGUI

 def loadGUI(self):
     self.gui = loader.loadModel('phase_13/models/parties/trampolineGUI')
     self.gui.reparentTo(base.a2dTopLeft)
     self.gui.setPos(0.115, 0, -1)
     self.gui.hide()
     self.toonIndicator = self.gui.find('**/trampolineGUI_MovingBar')
     jumpLineLocator = self.gui.find('**/jumpLine_locator')
     guiBean = self.gui.find('**/trampolineGUI_GreenJellyBean')
     self.gui.find('**/trampolineGUI_GreenJellyBean').stash()
     self.guiBeans = [ guiBean.instanceUnderNode(jumpLineLocator, self.uniqueName('guiBean%d' % i)) for i in xrange(self.numJellyBeans) ]
     self.guiBeans[-1].setScale(1.5)
     heightTextNode = TextNode(self.uniqueName('TrampolineActivity.heightTextNode'))
     heightTextNode.setFont(ToontownGlobals.getSignFont())
     heightTextNode.setAlign(TextNode.ALeft)
     heightTextNode.setText('0.0')
     heightTextNode.setShadow(0.05, 0.05)
     heightTextNode.setShadowColor(0.0, 0.0, 0.0, 1.0)
     heightTextNode.setTextColor(1.0, 1.0, 1.0, 1.0)
     self.heightText = jumpLineLocator.attachNewNode(heightTextNode)
     self.heightText.setX(0.15)
     self.heightText.setScale(0.1)
     self.heightText.setAlphaScale(0.0)
     self.quitEarlyButtonModels = loader.loadModel('phase_3.5/models/gui/inventory_gui')
     quitEarlyUp = self.quitEarlyButtonModels.find('**//InventoryButtonUp')
     quitEarlyDown = self.quitEarlyButtonModels.find('**/InventoryButtonDown')
     quitEarlyRollover = self.quitEarlyButtonModels.find('**/InventoryButtonRollover')
     self.quitEarlyButton = DirectButton(parent=base.a2dTopRight, relief=None, text=TTLocalizer.PartyTrampolineQuitEarlyButton, text_fg=(1, 1, 0.65, 1), text_pos=(0, -0.23), text_scale=0.7, image=(quitEarlyUp, quitEarlyDown, quitEarlyRollover), image_color=(1, 0, 0, 1), image_scale=(20, 1, 11), pos=(-0.183, 0, -0.4), scale=0.09, command=self.leaveTrampoline)
     self.quitEarlyButton.stash()
     self.flashText = OnscreenText(text='', pos=(0.0, -0.45), scale=0.2, fg=(1.0, 1.0, 0.65, 1.0), align=TextNode.ACenter, font=ToontownGlobals.getSignFont(), mayChange=True)
     self.timer = PartyUtils.getNewToontownTimer()
     self.timer.posInTopRightCorner()
     return
开发者ID:CalebSmith376,项目名称:src,代码行数:32,代码来源:DistributedPartyTrampolineActivity.py


示例9: releaseToon

 def releaseToon(self):
     self._hideFlashMessage()
     self.ignore("arrow_left")
     self.ignore("arrow_left-up")
     self.ignore("arrow_right")
     self.ignore("arrow_right-up")
     taskMgr.remove(self.uniqueName("TrampolineActivity.updateTask"))
     self.hopOffAnim = Sequence(
         self.toon.hprInterval(0.5, VBase3(-90.0, 0.0, 0.0), other=self.tramp),
         Func(self.toon.b_setAnimState, "jump", 1.0),
         Func(self.toon.dropShadow.reparentTo, hidden),
         Wait(0.4),
         PartyUtils.arcPosInterval(0.75, self.toon, self.hopOffPos, 5.0, self.tramp),
         Func(self.postHopOff),
     )
     self.hopOffAnim.start()
开发者ID:OldToontown,项目名称:OldToontown,代码行数:16,代码来源:DistributedPartyTrampolineActivity.py


示例10: acquireToon

 def acquireToon(self):
     self.toon.disableSmartCameraViews()
     self.toon.stopUpdateSmartCamera()
     camera.wrtReparentTo(render)
     self.toon.dropShadow.reparentTo(hidden)
     self.toon.startPosHprBroadcast(period=0.2)
     self.toonAcceleration = 0.0
     self.toonVelocity = 0.0
     self.topHeight = 0.0
     self.trampB = self.normalTrampB
     self.leavingTrampoline = False
     self.hopOnAnim = Sequence(
         Func(self.toon.b_setAnimState, "jump", 1.0),
         Wait(0.4),
         PartyUtils.arcPosInterval(0.75, self.toon, Point3(0.0, 0.0, self.trampHeight), 5.0, self.tramp),
         Func(self.postHopOn),
     )
     self.hopOnAnim.start()
开发者ID:OldToontown,项目名称:OldToontown,代码行数:18,代码来源:DistributedPartyTrampolineActivity.py


示例11: load

 def load(self):
     if self.isLoaded():
         return
     guiNode = loader.loadModel('phase_13/models/parties/jukeboxGUI')
     self._timerGui = PartyUtils.getNewToontownTimer()
     self._windowFrame = DirectFrame(image=guiNode.find('**/background'), relief=None, pos=(0, 0, 0), scale=0.7)
     self._songFrame = DirectFrame(image=guiNode.find('**/songTitle_background'), parent=self._windowFrame, relief=None)
     self._currentlyPlayingLabel = self.__createLabel(guiNode, 'currentlyPlaying', parent=self._windowFrame, text=TTLocalizer.JukeboxCurrentlyPlayingNothing, scale=TTLocalizer.JGcurrentlyPlayingLabel)
     self._songNameLabel = self.__createLabel(guiNode, 'songName', parent=self._windowFrame, text=TTLocalizer.JukeboxCurrentSongNothing, scale=TTLocalizer.JGsongNameLabel)
     self._queueList, self._queueLabel = self.__createLabeledScrolledList(guiNode, 'queue', label=TTLocalizer.JukeboxQueueLabel, parent=self._windowFrame)
     self._songsList, self._songsLabel = self.__createLabeledScrolledList(guiNode, 'songs', label=TTLocalizer.JukeboxSongsLabel, parent=self._windowFrame)
     pos = guiNode.find('**/addButton_text_locator').getPos()
     self._addSongButton = self.__createButton(guiNode, 'addSongButton', parent=self._windowFrame, command=self.__handleAddSongButtonClick, image3_color=Vec4(0.6, 0.6, 0.6, 0.6), text=TTLocalizer.JukeboxAddSong, text_align=TextNode.ACenter, text_pos=(pos[0], pos[2]), text_scale=TTLocalizer.JGaddSongButton)
     self._closeButton = self.__createButton(guiNode, 'can_cancelButton', parent=self._windowFrame, command=self.__handleCloseButtonClick)
     pos = guiNode.find('**/close_text_locator').getPos()
     self._closeButton = self.__createButton(guiNode, 'close', parent=self._windowFrame, command=self.__handleCloseButtonClick, text=TTLocalizer.JukeboxClose, text_align=TextNode.ACenter, text_pos=(pos[0], pos[2]), text_scale=0.08)
     self._moveToTopButton = self.__createButton(guiNode, 'moveToTop', command=self.__handleMoveToTopButtonClick)
     guiNode.removeNode()
     self._loaded = True
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:19,代码来源:JukeboxGui.py


示例12: load

 def load(self):
     buttonModels = loader.loadModel('phase_3.5/models/gui/inventory_gui')
     upButton = buttonModels.find('**//InventoryButtonUp')
     downButton = buttonModels.find('**/InventoryButtonDown')
     rolloverButton = buttonModels.find('**/InventoryButtonRollover')
     self.exitButton = DirectButton(relief=None, text=TTLocalizer.PartyTeamActivityExitButton, text_fg=(1, 1, 0.65, 1), text_pos=(0, -0.15), text_scale=0.5, image=(upButton, downButton, rolloverButton), image_color=(1, 0, 0, 1), image_scale=(14.5, 1, 9), pos=(0, 0, 0.8), scale=0.15, command=self.handleExitButtonClick)
     self.exitButton.hide()
     if self.activity.toonsCanSwitchTeams():
         self.switchButton = DirectButton(relief=None, text=TTLocalizer.PartyTeamActivitySwitchTeamsButton, text_fg=(1, 1, 1, 1), text_pos=(0, 0.1), text_scale=0.5, image=(upButton, downButton, rolloverButton), image_color=(0, 1, 0, 1), image_scale=(15, 1, 15), pos=(0, 0, 0.5), scale=0.15, command=self.handleSwitchButtonClick)
         self.switchButton.hide()
     else:
         self.switchButton = None
     buttonModels.removeNode()
     self.countdownText = OnscreenText(text='', pos=(0.0, -0.2), scale=PartyGlobals.TeamActivityTextScale * 1.2, fg=(1.0, 1.0, 0.65, 1.0), align=TextNode.ACenter, font=ToontownGlobals.getSignFont(), mayChange=True)
     self.countdownText.hide()
     self.statusText = OnscreenText(text='', pos=(0.0, 0.0), scale=PartyGlobals.TeamActivityTextScale, fg=PartyGlobals.TeamActivityStatusColor, align=TextNode.ACenter, font=ToontownGlobals.getSignFont(), mayChange=True)
     self.statusText.hide()
     self.timer = PartyUtils.getNewToontownTimer()
     self.timer.hide()
     return
开发者ID:nate97,项目名称:src,代码行数:20,代码来源:TeamActivityGui.py


示例13: releaseToon

 def releaseToon(self):
     self._hideFlashMessage()
     self.ignore(base.Move_Left)
     self.ignore(base.Move_Left + '-up')
     self.ignore(base.Move_Right)
     self.ignore(base.Move_Right + '-up')
     taskMgr.remove(self.uniqueName('TrampolineActivity.updateTask'))
     self.hopOffAnim = Sequence(self.toon.hprInterval(0.5, VBase3(-90.0, 0.0, 0.0), other=self.tramp), Func(self.toon.b_setAnimState, 'jump', 1.0), Func(self.toon.dropShadow.reparentTo, hidden), Wait(0.4), PartyUtils.arcPosInterval(0.75, self.toon, self.hopOffPos, 5.0, self.tramp), Func(self.postHopOff))
     self.hopOffAnim.start()
开发者ID:ponyboy837,项目名称:SecretGitLolYoloSweg2015,代码行数:9,代码来源:DistributedPartyTrampolineActivity.py


示例14: updateInvitation

 def updateInvitation(self, hostsName, partyInfo):
     self.partyInfo = partyInfo
     hostsName = TTLocalizer.GetPossesive(hostsName)
     self.whosePartyLabel['text'] = TTLocalizer.PartyPlannerInvitationWhoseSentence % hostsName
     if self.partyInfo.isPrivate:
         publicPrivateText = TTLocalizer.PartyPlannerPrivate.lower()
     else:
         publicPrivateText = TTLocalizer.PartyPlannerPublic.lower()
     activities = self.getActivitiesFormattedCorrectly()
     if self.noFriends:
         self.activityTextLabel['text'] = TTLocalizer.PartyPlannerInvitationThemeWhatSentenceNoFriends % (publicPrivateText, activities)
     else:
         self.activityTextLabel['text'] = TTLocalizer.PartyPlannerInvitationThemeWhatSentence % (publicPrivateText, activities)
     if self.noFriends:
         self.whenTextLabel['text'] = TTLocalizer.PartyPlannerInvitationWhenSentenceNoFriends % (PartyUtils.formatDate(self.partyInfo.startTime.year, self.partyInfo.startTime.month, self.partyInfo.startTime.day), PartyUtils.formatTime(self.partyInfo.startTime.hour, self.partyInfo.startTime.minute))
     else:
         self.whenTextLabel['text'] = TTLocalizer.PartyPlannerInvitationWhenSentence % (PartyUtils.formatDate(self.partyInfo.startTime.year, self.partyInfo.startTime.month, self.partyInfo.startTime.day), PartyUtils.formatTime(self.partyInfo.startTime.hour, self.partyInfo.startTime.minute))
     self.changeTheme(partyInfo.inviteTheme)
开发者ID:CalebSmith376,项目名称:src,代码行数:18,代码来源:InviteVisual.py


示例15: invitePartyClicked

 def invitePartyClicked(self, item):
     if item.getPythonTag('partyStatus') == PartyGlobals.PartyStatus.Started:
         self.invitePartyGoButton['state'] = DirectGuiGlobals.NORMAL
     else:
         self.invitePartyGoButton['state'] = DirectGuiGlobals.DISABLED
     if self.selectedInvitationItem is not None:
         self.selectedInvitationItem['state'] = DirectGuiGlobals.NORMAL
         self.selectedInvitationItem['text_bg'] = Vec4(0.0, 0.0, 0.0, 0.0)
     self.selectedInvitationItem = item
     self.selectedInvitationItem['state'] = DirectGuiGlobals.DISABLED
     self.selectedInvitationItem['text_bg'] = Vec4(1.0, 1.0, 0.0, 1.0)
     self.fillInviteActivityList(item.getPythonTag('activityIds'))
     startTime = item.getPythonTag('startTime')
     self.invitationDateTimeLabel['text'] = TTLocalizer.EventsPageInvitedTabTime % (PartyUtils.formatDate(startTime.year, startTime.month, startTime.day), PartyUtils.formatTime(startTime.hour, startTime.minute))
     return
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:15,代码来源:EventsPage.py


示例16: _createTimePage

 def _createTimePage(self):
     page = DirectFrame(self.frame)
     page.setName('PartyPlannerTimePage')
     self.createTimeTitleLabel = DirectLabel(parent=page, relief=None, text=TTLocalizer.PartyPlannerTimeTitle, pos=self.gui.find('**/title_locator').getPos(), scale=self.titleScale)
     self.clockImage = DirectFrame(parent=page, relief=None, geom=self.gui.find('**/toontownTime_background'))
     self.timePageToontownLabel = DirectLabel(parent=page, relief=None, text=TTLocalizer.PartyPlannerTimeToontown, pos=self.gui.find('**/step_03_toontown_locator').getPos(), scale=0.15, text_fg=(1.0, 0.0, 0.0, 1.0), text_font=ToontownGlobals.getSignFont())
     self.timePageTimeLabel = DirectLabel(parent=page, relief=None, text=TTLocalizer.PartyPlannerTimeTime, pos=self.gui.find('**/step_03_time_locator').getPos(), scale=0.15, text_fg=(1.0, 0.0, 0.0, 1.0), text_font=ToontownGlobals.getSignFont())
     self.timePageRecapLabel = DirectLabel(parent=page, relief=None, text=TTLocalizer.PartyPlannerTimeRecap, pos=self.gui.find('**/step_03_partyDateAndTime_locator').getPos(), scale=0.09)
     self.timePageRecapToontownTimeLabel1 = DirectLabel(parent=page, relief=None, text=TTLocalizer.PartyPlannerTimeToontownTime, pos=self.gui.find('**/step_03_toontownTime_locator').getPos(), scale=0.06)
     self.timePageRecapToontownTimeLabel2 = DirectLabel(parent=page, relief=None, text='%s' % PartyUtils.formatDateTime(self.partyTime), pos=self.gui.find('**/step_03_toontownDateAndTime_loactor').getPos(), textMayChange=True, scale=0.06)
     self.timePageRecapLocalTimeLabel = DirectLabel(parent=page, relief=None, text='%s%s' % (TTLocalizer.PartyPlannerTimeLocalTime, PartyUtils.formatDateTime(self.partyTime, inLocalTime=True)), pos=self.gui.find('**/step_03_localDateAndTime_loactor').getPos(), textMayChange=True, scale=0.06, text_fg=(1.0, 0.0, 0.0, 1.0))
     self.timeInputHourLabel, self.timeInputHourUpButton, self.timeInputHourDownButton = self.getTimeWidgets(page, 'hour')
     self.timeInputMinuteLabel, self.timeInputMinuteUpButton, self.timeInputMinuteDownButton = self.getTimeWidgets(page, 'minute')
     self.timeInputAmPmLabel, self.timeInputAmPmUpButton, self.timeInputAmPmDownButton = self.getTimeWidgets(page, 'ampm')
     self.timePagecolonLabel = DirectLabel(parent=page, relief=None, text=':', pos=self.gui.find('**/step_03_colon_locator').getPos(), scale=0.15)
     return page
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:16,代码来源:PartyPlanner.py


示例17: loadHostedPartyInfo

    def loadHostedPartyInfo(self):
        self.unloadGuests()
        self.unloadActivities()
        self.unloadDecorations()
        self.hostedPartyInfo = None
        self.confirmCancelPartyGui.doneStatus = ''
        self.confirmCancelPartyGui.hide()
        self.cancelPartyResultGui.doneStatus = ''
        self.cancelPartyResultGui.hide()
        if base.localAvatar.hostedParties is not None and len(base.localAvatar.hostedParties) > 0:
            for partyInfo in base.localAvatar.hostedParties:
                if partyInfo.status == PartyGlobals.PartyStatus.Pending or partyInfo.status == PartyGlobals.PartyStatus.CanStart or partyInfo.status == PartyGlobals.PartyStatus.NeverStarted or partyInfo.status == PartyGlobals.PartyStatus.Started:
                    self.hostedPartyInfo = partyInfo
                    self.loadGuests()
                    self.loadActivities()
                    self.loadDecorations()
                    self.hostingDateLabel['text'] = TTLocalizer.EventsPageHostTabDateTimeLabel % (PartyUtils.formatDate(partyInfo.startTime.year, partyInfo.startTime.month, partyInfo.startTime.day), PartyUtils.formatTime(partyInfo.startTime.hour, partyInfo.startTime.minute))
                    self.isPrivate = partyInfo.isPrivate
                    self.__setPublicPrivateButton()
                    if partyInfo.status == PartyGlobals.PartyStatus.CanStart:
                        self.partyGoButton['state'] = DirectGuiGlobals.NORMAL
                        self.partyGoButton['text'] = (TTLocalizer.EventsPageGoButton,)
                    elif partyInfo.status == PartyGlobals.PartyStatus.Started:
                        place = base.cr.playGame.getPlace()
                        if isinstance(place, Party):
                            if hasattr(base, 'distributedParty'):
                                if base.distributedParty.partyInfo.hostId == base.localAvatar.doId:
                                    self.partyGoButton['state'] = DirectGuiGlobals.DISABLED
                                else:
                                    self.partyGoButton['state'] = DirectGuiGlobals.NORMAL
                            else:
                                self.partyGoButton['state'] = DirectGuiGlobals.NORMAL
                                self.notify.warning('base.distributedParty is not defined when base.cr.playGame.getPlace is party. This should never happen.')
                        else:
                            self.partyGoButton['state'] = DirectGuiGlobals.NORMAL
                        self.partyGoButton['text'] = (TTLocalizer.EventsPageGoBackButton,)
                    else:
                        self.partyGoButton['text'] = (TTLocalizer.EventsPageGoButton,)
                        self.partyGoButton['state'] = DirectGuiGlobals.DISABLED
                    if partyInfo.status not in (PartyGlobals.PartyStatus.Pending, PartyGlobals.PartyStatus.CanStart):
                        self.hostingCancelButton['state'] = DirectGuiGlobals.DISABLED
                    else:
                        self.hostingCancelButton['state'] = DirectGuiGlobals.NORMAL
                    self.hostingDateLabel.show()
                    self.hostedPartyDisplay.show()
                    return

        self.hostingDateLabel['text'] = TTLocalizer.EventsPageHostingTabNoParty
        self.hostingCancelButton['state'] = DirectGuiGlobals.DISABLED
        self.partyGoButton['state'] = DirectGuiGlobals.DISABLED
        self.publicButton['state'] = DirectGuiGlobals.DISABLED
        self.privateButton['state'] = DirectGuiGlobals.DISABLED
        self.hostedPartyDisplay.show()
        return
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:54,代码来源:EventsPage.py


示例18: refresh

    def refresh(self, partyInfoTupleList):
        PublicPartyGui.notify.debug('refresh : partyInfoTupleList = %s' % partyInfoTupleList)
        self.selectedItem = None
        self.partyList.removeAndDestroyAllItems()
        self.activityList.removeAndDestroyAllItems()
        self.partyStartButton['state'] = DirectGuiGlobals.DISABLED
        sortedList = partyInfoTupleList[:]

        def cmp(left, right):
            if left[2] < right[2]:
                return -1
            elif left[2] == right[2]:
                if len(left[4]) < len(right[4]):
                    return -1
                elif len(left[4]) == len(right[4]):
                    return 0
                else:
                    return 1
            else:
                return 1

        sortedList.sort(cmp, reverse=True)
        indexToCut = -1
        for index, partyTuple in enumerate(sortedList):
            numberOfGuests = partyTuple[2]
            if numberOfGuests < PartyGlobals.MaxToonsAtAParty:
                indexToCut = index
                break

        if indexToCut > 0:
            sortedList = sortedList[indexToCut:] + sortedList[:indexToCut]
        for index, partyTuple in enumerate(sortedList):
            shardId = partyTuple[0]
            zoneId = partyTuple[1]
            numberOfGuests = partyTuple[2]
            hostName = partyTuple[3]
            activityIds = partyTuple[4]
            minLeft = partyTuple[5]
            item = DirectButton(relief=DGG.RIDGE, borderWidth=(0.01, 0.01), frameSize=(-0.01,
             0.45,
             -0.015,
             0.04), frameColor=self.normalFrameColor, text=hostName, text_align=TextNode.ALeft, text_bg=Vec4(0.0, 0.0, 0.0, 0.0), text_scale=0.045, command=self.partyClicked)
            otherInfoWidth = 0.08
            numActivities = len(activityIds)
            PartyUtils.truncateTextOfLabelBasedOnWidth(item, hostName, PartyGlobals.EventsPageGuestNameMaxWidth)
            num = DirectLabel(relief=DGG.RIDGE, borderWidth=(0.01, 0.01), frameSize=(0.0,
             otherInfoWidth,
             -0.015,
             0.04), frameColor=self.normalFrameColor, text='%d' % numberOfGuests, text_align=TextNode.ALeft, text_scale=0.045, text_pos=(0.01, 0, 0), pos=(0.45, 0.0, 0.0))
            num.reparentTo(item)
            item.numLabel = num
            actLabelPos = num.getPos()
            actLabelPos.setX(actLabelPos.getX() + otherInfoWidth)
            actLabel = DirectLabel(relief=DGG.RIDGE, borderWidth=(0.01, 0.01), frameSize=(0.0,
             otherInfoWidth,
             -0.015,
             0.04), frameColor=self.normalFrameColor, text='%d' % numActivities, text_align=TextNode.ALeft, text_scale=0.045, text_pos=(0.01, 0, 0), pos=actLabelPos)
            actLabel.reparentTo(item)
            item.actLabel = actLabel
            minLabelPos = actLabel.getPos()
            minLabelPos.setX(minLabelPos.getX() + otherInfoWidth)
            minLabel = DirectLabel(relief=DGG.RIDGE, borderWidth=(0.01, 0.01), frameSize=(0.0,
             otherInfoWidth,
             -0.015,
             0.04), frameColor=self.normalFrameColor, text='%d' % minLeft, text_align=TextNode.ALeft, text_scale=0.045, text_pos=(0.01, 0, 0), pos=minLabelPos)
            minLabel.reparentTo(item)
            item.minLabel = minLabel
            item['extraArgs'] = [item]
            item.setPythonTag('shardId', shardId)
            item.setPythonTag('zoneId', zoneId)
            item.setPythonTag('activityIds', activityIds)
            self.partyList.addItem(item)

        return
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:74,代码来源:PublicPartyGui.py


示例19: fillActivityList

    def fillActivityList(self, activityIds):
        self.activityList.removeAndDestroyAllItems()
        sortedList = activityIds[:]
        sortedList.sort()
        lastActivityId = -1
        for activityId in sortedList:
            if activityId == lastActivityId:
                continue
            lastActivityId = activityId
            number = sortedList.count(activityId)
            text = TTLocalizer.PartyActivityNameDict[activityId]['generic']
            if number > 1:
                text += ' X %d' % number
            item = DirectLabel(relief=None, text=text, text_align=TextNode.ACenter, text_scale=0.05, text_pos=(0.0, -0.15), geom_scale=0.3, geom_pos=Vec3(0.0, 0.0, 0.07), geom=PartyUtils.getPartyActivityIcon(self.activityIconsModel, PartyGlobals.ActivityIds.getString(activityId)))
            self.activityList.addItem(item)

        return
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:17,代码来源:PublicPartyGui.py



注:本文中的toontown.parties.PartyUtils类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python DistributedPartyActivity.DistributedPartyActivity类代码示例发布时间:2022-05-27
下一篇:
Python nametag.NametagGlobals类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap