def getActiveConsumables(self): key = (getUnitMgrID(), connectionManager.peripheryID) if key in self.consumables: consumablesByRev = self.consumables[key] revs = consumablesByRev.keys() if revs: consumables = consumablesByRev[max(revs)] return dict(((slotIdx, (orderTypeID, level)) for orderTypeID, level, slotIdx in consumables)) return {}
def start(self, ctx): if self.__isStarted: return self.__isStarted = True addListener = g_eventBus.addListener addListener(TutorialEvent.UI_CONTROL_ADDED, self.__handleUIAdded, scope=EVENT_BUS_SCOPE.GLOBAL) addListener(TutorialEvent.UI_CONTROL_REMOVED, self.__handleUIRemoved, scope=EVENT_BUS_SCOPE.GLOBAL) addListener(TutorialEvent.REFUSE, self.__handleRefuseTraining, scope=EVENT_BUS_SCOPE.GLOBAL) addListener(TutorialEvent.RESTART, self.__handleRestartTraining, scope=EVENT_BUS_SCOPE.GLOBAL) addListener(ShowWindowEvent.SHOW_TUTORIAL_BATTLE_HISTORY, self.__handleHistoryShow, scope=EVENT_BUS_SCOPE.DEFAULT) self.setDisabled(ctx.isInPrebattle or ctx.isInRandomQueue or game_control.g_instance.roaming.isInRoaming() or getUnitMgrID() > 0) self._subscribe()
def getID(self): return getUnitMgrID()