本文整理汇总了Python中toontown.parties.PartyUtils.formatDate方法的典型用法代码示例。如果您正苦于以下问题:Python PartyUtils.formatDate方法的具体用法?Python PartyUtils.formatDate怎么用?Python PartyUtils.formatDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.parties.PartyUtils
的用法示例。
在下文中一共展示了PartyUtils.formatDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadHostedPartyInfo
# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import formatDate [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
示例2: updateInvitation
# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import formatDate [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)
示例3: invitePartyClicked
# 需要导入模块: from toontown.parties import PartyUtils [as 别名]
# 或者: from toontown.parties.PartyUtils import formatDate [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