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 {}
示例#2
0
 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 {}
示例#3
0
 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()
示例#4
0
 def getID(self):
     return getUnitMgrID()
示例#5
0
 def getID(self):
     return getUnitMgrID()
 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()