def __init__(self, doneEvent=None): FSM.__init__(self, 'PartyPlannerFSM') DirectFrame.__init__(self) self.doneEvent = doneEvent self.stateArray = [ 'Off', 'Welcome', 'PartyEditor', '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')
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) return