Example #1
0
class FunctionalLobbyChapterInfo(FunctionalChapterInfo):

    def __init__(self):
        super(FunctionalChapterInfo, self).__init__()
        chapter = self._data
        chapterID = chapter.getID()
        self._conditions = None
        conditions = chapter.getHasIDEntity(chapterID)
        if conditions is not None and len(conditions):
            self._conditions = FunctionalConditions(conditions)
        self._isShow = False
        return

    def invalidate(self):
        if self._conditions is None:
            return
        else:
            ok = self._conditions.allConditionsOk()
            if ok and not self._isShow:
                chapter = self._data
                self._gui.setChapterInfo(chapter.getTitle(), chapter.getDescription(afterBattle=self._cache.isAfterBattle()))
                self._isShow = True
            elif not ok and self._isShow:
                self._gui.clearChapterInfo()
                self._isShow = False
            return
Example #2
0
class FunctionalLobbyChapterInfo(FunctionalChapterInfo):
    def __init__(self):
        super(FunctionalChapterInfo, self).__init__()
        chapter = self._data
        chapterID = chapter.getID()
        self._conditions = None
        conditions = chapter.getHasIDEntity(chapterID)
        if conditions is not None and len(conditions):
            self._conditions = FunctionalConditions(conditions)
        self._isShow = False
        return

    def invalidate(self):
        if self._conditions is None:
            return
        else:
            ok = self._conditions.allConditionsOk()
            if ok and not self._isShow:
                chapter = self._data
                self._gui.setChapterInfo(
                    chapter.getTitle(),
                    chapter.getDescription(
                        afterBattle=self._cache.isAfterBattle()))
                self._isShow = True
            elif not ok and self._isShow:
                self._gui.clearChapterInfo()
                self._isShow = False
            return
Example #3
0
    def __init__(self):
        super(FunctionalBattleChapterInfo, self).__init__()
        chapter = self._tutorial._data
        chapterID = chapter.getID()
        self._progress = []
        self._stepMask = -1
        progress = chapter.getHasIDEntity(chapterID)
        if progress is None:
            LOG_ERROR('Chapter progress not found', chapterID)
        else:
            for conditions in progress:
                func = FunctionalConditions(conditions)
                ok = func.allConditionsOk()
                self._progress.append((func, ok))

        self._gui.setChapterInfo(chapter.getTitle(), chapter.getDescription())
        descriptor = self._tutorial._descriptor
        chapterIdx = descriptor.getChapterIdx(chapterID)
        localCtx = BattleClientCtx.fetch().setChapterIdx(chapterIdx)
        self._gui.setTrainingPeriod(descriptor.getChapterIdx(chapterID), descriptor.getNumberOfChapters())
        self._gui.setTrainingProgress(descriptor.getProgress(localCtx.completed))
Example #4
0
    def __init__(self):
        super(FunctionalBattleChapterInfo, self).__init__()
        chapter = self._tutorial._data
        chapterID = chapter.getID()
        self._progress = []
        self._stepMask = -1
        progress = chapter.getHasIDEntity(chapterID)
        if progress is None:
            LOG_ERROR('Chapter progress not found', chapterID)
        else:
            for conditions in progress:
                func = FunctionalConditions(conditions)
                ok = func.allConditionsOk()
                self._progress.append((func, ok))

        self._gui.setChapterInfo(chapter.getTitle(), chapter.getDescription())
        descriptor = self._descriptor
        chapterIdx = descriptor.getChapterIdx(chapterID)
        localCtx = BattleClientCtx.fetch().setChapterIdx(chapterIdx)
        self._gui.setTrainingPeriod(descriptor.getChapterIdx(chapterID), descriptor.getNumberOfChapters())
        self._gui.setTrainingProgress(descriptor.getProgress(localCtx.completed))
Example #5
0
 def invoke(self, content, varID):
     descriptor = getQuestsDescriptor()
     chapterID = self.getVar(varID)
     chapter = descriptor.getChapter(chapterID)
     value = content['description']
     content['description'] = self.getVar(value, default=value)
     content['header'] = self.__getAwardHeader(content, chapter)
     content['bgImage'] = self.__getAwardIcon(content, chapter)
     content['bonuses'] = None
     bonus = chapter.getBonus()
     altBonusConditions = FunctionalConditions(
         bonus.getAltBonusValuesConditions())
     if altBonusConditions.allConditionsOk() and bonus.getAltValues():
         content['bonuses'] = bonus.getAltValues()
     else:
         content['bonuses'] = bonus.getValues()
     content['chapterID'] = chapterID
     progrCondition = chapter.getProgressCondition()
     if progrCondition.getID() == 'vehicleBattlesCount':
         content['vehicle'] = progrCondition.getValues().get('vehicle')
     content['showQuestsBtn'] = not descriptor.areAllBonusesReceived(
         self._bonuses.getCompleted())
     return