def onPreSave(self, argsList): """ Save reminders. """ if self.reminders.isEmpty(): SdToolKit.sdDelGlobal(SD_MOD_ID, SD_QUEUES_ID) else: SdToolKit.sdSetGlobal(SD_MOD_ID, SD_QUEUES_ID, self.reminders)
def onLoadGame(self, argsList): """ Load saved reminders. """ self.clearReminders() queues = SdToolKit.sdGetGlobal(SD_MOD_ID, SD_QUEUES_ID) if queues: self.setReminders(queues) else: # check for old save format (single queue) queue = SdToolKit.sdGetGlobal(SD_MOD_ID, SD_QUEUE_ID) if queue: BugUtil.info("Reminder - Converting single-queue format") self.setReminders(Reminders(queue)) SdToolKit.sdDelGlobal(SD_MOD_ID, SD_QUEUE_ID)
def onPreSave(self, argsList): if self.reminders.isEmpty(): SdToolKit.sdDelGlobal("Reminders", "queues") else: SdToolKit.sdSetGlobal("Reminders", "queues", self.reminders)