当前位置: 首页>>代码示例>>Python>>正文


Python PartyUtils.formatTime方法代码示例

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


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

示例1: loadHostedPartyInfo

# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import formatTime [as 别名]
    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,代码行数:56,代码来源:EventsPage.py

示例2: updateInvitation

# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import formatTime [as 别名]
 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,代码行数:20,代码来源:InviteVisual.py

示例3: invitePartyClicked

# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import formatTime [as 别名]
 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,代码行数:17,代码来源:EventsPage.py


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