def _getFullDescription(self, stepName, discount=None, forHeroCard=False): modifiedStepName = self.__modifyName(stepName) locKey = None if forHeroCard: locKey = QUESTS.getActionDescription('hero/full/{}'.format(modifiedStepName)) if locKey is None: locKey = QUESTS.getActionDescription('full/{}'.format(modifiedStepName)) return i18n.makeString(locKey, discount=discount)
def _getButtonName(cls, stepName): """Button text :param stepName: step name :return: i18n button text """ formatter = 'button/{}'.format(stepName) return i18n.makeString(QUESTS.getActionDescription(formatter))
def _getFullDescription(self, stepName, discount=None, forHeroCard=False): if stepName == 'set_MarathonFinished': locKey = QUESTS.getActionDescription( 'hero/full/{}'.format(stepName)) return i18n.makeString( locKey, value=self._marathonCtrl.getExtraDaysToBuy()) return super(MarathonEventActionInfo, self)._getFullDescription(stepName, discount, forHeroCard)
def _getAutoDescription(self, stepName): """Card description text Used only for coming soon cards :param stepName: step name :return: i18n description string """ formatter = 'auto/{}'.format(self.__modifyName(stepName)) return i18n.makeString(QUESTS.getActionDescription(formatter))
def _getShortDescription(self, stepName, **kwargs): """Card description text Used for small cards :param stepName: step name :param kwargs: dict params for text :return: i18n description string """ formatter = 'short/{}'.format(self.__modifyName(stepName)) return i18n.makeString(QUESTS.getActionDescription(formatter), **kwargs)
def getTableData(self): res = [] for data in self.__sortBoosters(): booster = data.discountName guiType = booster.boosterGuiType formatter = 'booster/{}'.format(guiType) busterName = i18n.makeString(QUESTS.getActionDescription(formatter)) busterSmallIcon = RES_ICONS.getBusterSmallIcon(guiType) item = {'icon': busterSmallIcon, 'additionalIcon': '', 'title': busterName, 'discount': formatStrDiscount(data), 'price': self._formatPriceIcon(booster, False)} res.append(item) return res
def _getButtonName(cls, stepName): formatter = 'button/{}'.format(stepName) return i18n.makeString(QUESTS.getActionDescription(formatter))
def _getShortDescription(self, stepName, **kwargs): formatter = 'short/{}'.format(self.__modifyName(stepName)) return i18n.makeString(QUESTS.getActionDescription(formatter), **kwargs)
def _getAutoDescription(self, stepName): formatter = 'auto/{}'.format(self.__modifyName(stepName)) return i18n.makeString(QUESTS.getActionDescription(formatter))