Example #1
0
 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
Example #2
0
 def __init__(self):
     super(FunctionalLobbyChapterContext, self).__init__()
     chapter = self._data
     chapterID = chapter.getID()
     self._conditions = None
     conditions = chapter.getHasIDEntity(chapterID)
     if conditions:
         self._conditions = FunctionalConditions(conditions)
     self._isShow = False
     return
Example #3
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 #4
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 #5
0
 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
Example #6
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 #7
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 #8
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
 def __checkConditions(hint):
     conditions = hint['conditions']
     return True if conditions is None else FunctionalConditions(
         conditions).allConditionsOk()
def _allConditionsOk(item):
    conditions = item.getConditions()
    return True if conditions is None or FunctionalConditions(
        conditions).allConditionsOk() else False
Example #11
0
 def __checkConditions(self, hint):
     conditions = hint['conditions']
     if conditions is None:
         return True
     else:
         return FunctionalConditions(conditions).allConditionsOk()