def __init__(self, avatar, lessonId, entities, bootcampGui,
                 soundAssistant):
        lessonSettings = getBattleSettings(lessonId)
        super(BattleAssistant,
              self).__init__(HintSystem(avatar, lessonSettings.hints))
        self.__idHighlight = None
        self.__lessonId = lessonId
        self.__idClosePrebattleTimer = None
        self.__soundAssistant = soundAssistant
        self.__highlightedElements = set()
        for animationName, panelName in BattleAssistant.HIGHLIGHTED_GUI_DICT.iteritems(
        ):
            curPanels = lessonSettings.visiblePanels
            if lessonId > 0:
                prevPanels = getBattleSettings(lessonId - 1).visiblePanels
                if panelName not in prevPanels and panelName in curPanels:
                    self.__highlightedElements.add(animationName)
            if panelName in curPanels:
                self.__highlightedElements.add(animationName)

        markers = {}
        if hasattr(avatar, 'arenaExtraData'):
            if 'markers' in avatar.arenaExtraData:
                markers = avatar.arenaExtraData['markers']
        from BootcampMarkers import BootcampMarkersManager
        self._markerManager = BootcampMarkersManager()
        self._markerManager.init(entities, markers, bootcampGui)
        g_bootcampEvents.onUIStateChanged += self._onUIStateChanged
        return
예제 #2
0
 def _onUIStateChanged(self, state):
     if state == UI_STATE.START:
         self.__idHighlight = BigWorld.callback(BattleAssistant.ASSISTANT_TIMEOUT_HIGHLIGHT, self.__doHighlight)
         prebattle = getBattleSettings(self.__lessonId).prebattle
         if prebattle.has_key('visible_hints'):
             g_eventBus.handleEvent(events.LoadViewEvent(VIEW_ALIAS.BOOTCAMP_PREBATTLE_HITNS, None, prebattle), EVENT_BUS_SCOPE.BATTLE)
             self.__idClosePrebattleTimer = BigWorld.callback(prebattle['timeout'], self.__onClosePrebattle)
     elif state == UI_STATE.STOP:
         self.stop()
     return
예제 #3
0
    def __init__(self, avatar, lessonId):
        super(BattleAssistant, self).__init__()
        self.__idHighlight = None
        self.__lessonId = lessonId
        self.__idClosePrebattleTimer = None
        self.__highlightedElements = set()
        lessonSettings = getBattleSettings(lessonId)
        for animationName, panelName in BattleAssistant.HIGHLIGHTED_GUI_DICT.iteritems(
        ):
            curPanels = lessonSettings.visiblePanels
            if lessonId > 0:
                prevPanels = getBattleSettings(lessonId - 1).visiblePanels
                if panelName not in prevPanels and panelName in curPanels:
                    self.__highlightedElements.add(animationName)
            if panelName in curPanels:
                self.__highlightedElements.add(animationName)

        g_bootcampEvents.onUIStateChanged += self._onUIStateChanged
        return
예제 #4
0
 def getBattleLoadingPages(self):
     return getBattleSettings(self.__lessonId).lessonPages
예제 #5
0
 def getBattleRibbonsSettings(self):
     return getBattleSettings(self.__lessonId).ribbons
예제 #6
0
 def getBattleSettings(self):
     settings = getBattleSettings(self.__lessonId)
     return (settings.visiblePanels, settings.hiddenPanels)