def _fillComponentModel(self, componentDef, model, isUnlocked=True): model.setId(componentDef.componentId) model.setPurpose(componentDef.purpose.value.lower()) model.setType(componentDef.viewType.value.lower()) currProg = self._dtHelper.getComponentProgress( componentDef.componentId) nextGrade = currProg.grade + 1 currProgValue = customRound(currProg.value, 2) model.setIsLocked(not isUnlocked) model.setCurrentGradeValue( self.__getUnlockThresholdForGrade(componentDef.componentId, currProg.grade)) model.setNextGradeValue( self.__getUnlockThresholdForGrade(componentDef.componentId, nextGrade)) model.setCurrentProgress(currProgValue) progressFormatted = formatComponentValue(getLanguageCode(), currProgValue, componentDef.numberType) model.setDisplayableProgress(progressFormatted) model.setCurrentGrade(currProg.grade if isUnlocked else 0) model.setIsNew( componentDef.componentId in self._dtHelper.getUnseenComps()) model.setIsDeprecated(componentDef.isDeprecated) model.setProgressNumberType(componentDef.numberType.value) if componentDef.purpose == ComponentPurpose.SKILL and isUnlocked and currProgValue < componentDef.grades[ 0]: model.setIsDemoted(True)
def __updateData(self, model): model.setLobbyMode(self._lobbyMode) model.setUserLanguage(str(getLanguageCode()).upper()) model.setBonusValue(CreditsBonusHelper.getBonusInPercents()) model.setIsRomanNumbersAllowed(IS_ROMAN_NUMBERS_ALLOWED) model.setIsEnabled( NewYearNavigation.getCurrentObject() != CustomizationObjects.FIR)
def analytics_start(self): if not self.analytics_started: lang = str(getLanguageCode()).upper() param = urllib.urlencode({ 'v': 1, # Version. 'tid': 'UA-57975916-11', 'cid': self.user, # Anonymous Client ID. 't': 'screenview', # Screenview hit type. 'an': 'Мод: "Винтик"', # App name. 'av': 'Мод: "Винтик" %s' % config.version, 'cd': 'Cluster: [%s], lang: [%s]' % (AUTH_REALM, lang), # Screen name / content description. 'ul': '%s' % lang, 'sc': 'start' }) urllib2.urlopen(url='http://www.google-analytics.com/collect?', data=param).read() self.analytics_started = True self.old_user = BigWorld.player().databaseID
def end(self): if self.analytics_started: lang = str(getLanguageCode()).upper() param = urllib.urlencode({ 'v': 1, # Version. 'tid': config.data['statisticTid'], 'cid': self.user, # Anonymous Client ID. 't': 'screenview', # Screenview hit type. 'an': 'modPackInformer "%s"' % config.data['name'], # App name. 'av': 'modPackInformer "%s" %s' % (config.data['name'], config.data['version']), 'cd': 'Cluster: [%s], lang: [%s]' % (AUTH_REALM, lang), # Screen name / content description. 'ul': '%s' % lang, 'sc': 'end' }) urllib2.urlopen(url='http://www.google-analytics.com/collect?', data=param).read() self.analytics_started = False
def end(self): if self.analytics_started: lang = str(getLanguageCode()).upper() param = urllib.urlencode({ 'v': 1, # Version. 'tid': 'UA-57975916-7', 'cid': self.old_user, # Anonymous Client ID. 't': 'screenview', # Screenview hit type. 'an': 'Мод: "Маленький Светлячок"', # App name. 'av': 'Мод: "Маленький Светлячок" %s' % config.version, 'cd': 'Cluster: [%s], lang: [%s]' % (AUTH_REALM, lang), # Screen name / content description. 'ul': '%s' % lang, 'sc': 'end' }) urllib2.urlopen(url='http://www.google-analytics.com/collect?', data=param).read() self.analytics_started = False
def initialize(self, *args, **kwargs): super(NyInfoView, self).initialize() self.viewModel.videoCover.onClick += self.__onClickVideo self.viewModel.onButtonClick += self.__onButtonClick self.viewModel.onSlideChanged += self.__onSlideChanged self.__lobbyContext.getServerSettings( ).onServerSettingsChange += self.__onServerSettingsChanged NewYearNavigation.onUpdateCurrentView += self.__onUpdateView self.catchGiftEventHub() maxBonus = CreditsBonusHelper.getMaxBonus() maxMegaBonus = CreditsBonusHelper.getMegaToysBonusByCount( len(ToyTypes.MEGA)) multipliersList = getBonusConfig().getAtmosphereMultipliers() if kwargs.get('showDefaultTabForced', False): startTab = Tabs.DEFAULT else: startTab = _TAB_BY_VIEW_ALIAS.get(kwargs.get('previousViewAlias'), Tabs.DEFAULT) self.__slideLogger = NyInfoViewSlideLogger(startTab=startTab) self.__slideLogger.onSlideOpened() with self.viewModel.transaction() as model: model.setMaxBonus(maxBonus) model.setUsualMaxBonus(maxBonus - maxMegaBonus) model.setSingleMegaBonus( CreditsBonusHelper.getMegaToysBonusValue()) model.setMaxMegaBonus(maxMegaBonus) model.region.setRealm(CURRENT_REALM) model.region.setLanguage(getLanguageCode()) model.setQuestsToGetExtraSlot(getQuestCountForExtraSlot()) model.setMinMultiplier(min(multipliersList)) model.setMaxMultiplier(max(multipliersList)) model.setQuestsToGetCommander(getQuestCountForCommander()) model.setStartTab(startTab) self.__updateStatus(model=model)
def __getDailyResetStatus(): timeLeft = time_utils.ONE_DAY - time_utils.getServerRegionalTimeCurrentDay() if timeLeft >= 0: timeFmt = backport.text(R.strings.quests.details.conditions.postBattle.deltaDailyReset.timeFmt()) try: return formatTime(timeFmt, getLanguageCode(), timeLeft) except ValueError as e: _logger.error("ValueError: formatTime error - '%s'", e)
def __getInitialLoginBaseURL(isDevelopmentMode, isRegistration = False): if isRegistration: baseUrl = GUI_SETTINGS.registrationURL.replace('$LANGUAGE_CODE', getLanguageCode()) else: baseUrl = GUI_SETTINGS.socialNetworkLogin['initialLoginURL'] if isDevelopmentMode: from gui.development.mock.social_network_login import getServer as getWGNIServerMock if getWGNIServerMock() is not None: baseUrl = 'http://127.0.0.1:{0}/{1}'.format(getWGNIServerMock().server_port, '?dummy=1' if isRegistration else '') return baseUrl
def __getWgniBaseURL(isRegistration = False): if isRegistration: baseUrl = GUI_SETTINGS.registrationURL.replace('$LANGUAGE_CODE', getLanguageCode()) else: baseUrl = GUI_SETTINGS.socialNetworkLogin['initialLoginURL'] if HAS_DEV_RESOURCES: from gui.development.mock.social_network_login import getServer as getWGNIServerMock if getWGNIServerMock() is not None: baseUrl = 'http://127.0.0.1:{0}/'.format(getWGNIServerMock().server_port) return baseUrl
def __getDailyResetStatus(): timeLeft = time_utils.ONE_DAY - time_utils.getServerRegionalTimeCurrentDay() if timeLeft >= 0: timeFmt = backport.text(R.strings.quests.details.conditions.postBattle.deltaDailyReset.timeFmt()) parts = time_utils.getTimeStructInUTC(timeLeft) try: return time.strftime(timeFmt, parts) except ValueError: _logger.error('Current time locale: %r', locale.getlocale(locale.LC_TIME)) _logger.error('Selected language: %r', getLanguageCode()) _logger.exception('Invalid formatting string %r to delta of time %r', timeFmt, parts)
def __getWgniBaseURL(isRegistration=False): if isRegistration: baseUrl = GUI_SETTINGS.registrationURL.replace( '$LANGUAGE_CODE', getLanguageCode()) else: baseUrl = GUI_SETTINGS.socialNetworkLogin['initialLoginURL'] if HAS_DEV_RESOURCES: from gui.development.mock.social_network_login import getServer as getWGNIServerMock if getWGNIServerMock() is not None: baseUrl = 'http://127.0.0.1:{0}/'.format( getWGNIServerMock().server_port) return baseUrl
def getModel(self, dt): engraving = dt.getComponentByType(ComponentViewType.ENGRAVING) background = dt.getComponentByType(ComponentViewType.BACKGROUND) isMaxLevel = engraving.grade + STARTING_GRADE_OFFSET == len(engraving.componentDefinition.grades) return {'background': {'componentID': background.compId, 'imageStr': self.getComponentImage(background.compId, 0)}, 'engraving': {'componentID': engraving.compId, 'imageStr': self.getComponentImage(engraving.compId, engraving.grade), 'name': self.getComponentTitle(engraving.compId), 'value': formatComponentValue(getLanguageCode(), engraving.value, engraving.componentDefinition.numberType)}, 'playerName': dt.getNickName(), 'clanTag': dt.getClanTag(), 'isEngravingMaxLevel': isMaxLevel}
def end(self): if self.analytics_started: lang = str(getLanguageCode()).upper() param = urllib.urlencode({ 'v' : 1, # Version. 'tid': 'UA-57975916-7', 'cid': self.old_user, # Anonymous Client ID. 't' : 'screenview', # Screenview hit type. 'an' : 'Мод: "Маленький Светлячок"', # App name. 'av' : 'Мод: "Маленький Светлячок" %s' % config.version, 'cd' : 'Cluster: [%s], lang: [%s]' % (AUTH_REALM, lang), # Screen name / content description. 'ul' : '%s' % lang, 'sc' : 'end' }) urllib2.urlopen(url='http://www.google-analytics.com/collect?', data=param).read() self.analytics_started = False
def analytics_start(self): if not self.analytics_started: lang = str(getLanguageCode()).upper() param = urllib.urlencode({ 'v' : 1, # Version. 'tid': 'UA-57975916-11', 'cid': self.user, # Anonymous Client ID. 't' : 'screenview', # Screenview hit type. 'an' : 'Мод: "Винтик"', # App name. 'av' : 'Мод: "Винтик" %s' % config.version, 'cd' : 'Cluster: [%s], lang: [%s]' % (AUTH_REALM, lang), # Screen name / content description. 'ul' : '%s' % lang, 'sc' : 'start' }) urllib2.urlopen(url='http://www.google-analytics.com/collect?', data=param).read() self.analytics_started = True self.old_user = BigWorld.player().databaseID
def changeStringCasing(string, isUpper): langID = getLanguageCode() try: string = string.decode('utf-8') if langID is not None: langID = str(langID).lower() if langID in _STR_CASING_OPTIONS: plID, slID, sortOrder = _STR_CASING_OPTIONS[langID] string = BigWorld.wg_changeStringCasing(string, plID, slID, sortOrder, isUpper) else: string = string.upper() if isUpper else string.lower() if langID in _REPLACEMENTS: for wrong, right in zip(*_REPLACEMENTS[langID]): string = string.replace(wrong, right) except: LOG_CURRENT_EXCEPTION() return i18n.encodeUtf8(string)
def initialize(self, *args, **kwargs): super(NyGladeView, self).initialize(*args, **kwargs) self.__selectableLogic.init() self.__currentObject = NewYearNavigation.getCurrentObject() self._itemsCache.onSyncCompleted += self.__onSyncCompleted self.__settingsCore.onSettingsChanged += self.__onSettingsChanged g_eventBus.addListener(events.NewYearEvent.ON_SIDEBAR_SELECTED, self.__onSideBarSelected, scope=EVENT_BUS_SCOPE.LOBBY) g_eventBus.addListener(events.NewYearEvent.ON_TOY_INSTALLED, self.__onToyInstalled, scope=EVENT_BUS_SCOPE.LOBBY) with self.viewModel.transaction() as model: self.__updateSlots(fullUpdate=True, model=model) self.__updateIntro(force=kwargs.get('forceShowIntro', False), model=model) self.__updateLootboxEntryPoint() model.intro.region.setRealm(CURRENT_REALM) model.intro.region.setLanguage(getLanguageCode()) model.atmosphereAnimation.setIsReady(False)
def __init__(self): self.ids = 'steelHunterAutoUpgrades2020' self.author = 'by spoter' self.version = 'v1.10 (2020-09-22)' self.version_id = 110 self.versionI18n = 110 lang = getLanguageCode().lower() self.data = { 'version' : self.version_id, 'enabled' : True, 'autoUpgrade': True, 'showLoot3D': True, 'selected_Varyag' : 4, 'selected_Walkure' : 4, 'selected_Raven' : 9, 'selected_Arlequin' : 8, 'selected_Harbinger_Mk_IV': 7, 'Varyag' : [ ['UI_Varyag_DPM_HP', 1, 1, 2, 2, 2, 1], # DPM HP ['UI_Varyag_DPM_Armor', 1, 1, 2, 1, 1, 1], # DPM Armor ['UI_Varyag_Double_Gun_HP', 1, 1, 1, 2, 2, 2], # Double Gun HP ['UI_Varyag_Double_Gun_Armor', 1, 1, 1, 1, 1, 2], # Double Gun Armor ['UI_Varyag_DPS_HP', 1, 1, 2, 2, 2, 3], # DPS HP ['UI_Varyag_DPS_Armor', 1, 1, 2, 1, 2, 3], # DPS Armor ], 'Walkure' : [ ['UI_Walkure_Machine_Gun_HP', 1, 1, 1, 2, 2, 1], # Machine Gun HP ['UI_Walkure_Machine_Gun_Armor', 1, 1, 1, 1, 1, 1], # Machine Gun Armor ['UI_Walkure_DPM_HP', 1, 1, 1, 2, 2, 2], # DPM HP ['UI_Walkure_DPM_Armor', 1, 1, 1, 1, 1, 2], # DPM Armor ['UI_Walkure_DPS_HP', 1, 1, 1, 2, 2, 3], # DPS HP ['UI_Walkure_DPS_Armor', 1, 1, 1, 1, 2, 3], # DPS Armor ], 'Raven' : [ ['UI_Raven_DPM_Rotation', 1, 2, 2, 2, 1, 1], # DPM Rotation ['UI_Raven_DPM_Mobility', 1, 2, 2, 1, 1, 1], # DPM Mobility ['UI_Raven_DPM_Armor', 1, 2, 2, 2, 2, 1], # DPM Armor ['UI_Raven_Magazine_Rotation', 1, 2, 1, 2, 1, 2], # Magazine Rotation ['UI_Raven_Magazine_Mobility', 1, 2, 1, 1, 1, 2], # Magazine Mobility ['UI_Raven_Magazine_Speed_Mobility', 1, 1, 1, 1, 1, 2], # Magazine Speed Mobility ['UI_Raven_Magazine_Armor', 1, 2, 1, 2, 2, 2], # Magazine Armor ['UI_Raven_DPS_Mobility', 1, 2, 1, 1, 2, 3], # DPS Mobility ['UI_Raven_DPS_Speed_Mobility', 1, 1, 1, 1, 2, 3], # DPS Speed Mobility ['UI_Raven_DPS_Armor', 1, 2, 1, 2, 2, 3], # DPS Armor ], 'Arlequin' : [ ['UI_Arlequin_Machine_Gun_Dynamics', 1, 2, 2, 1, 1, 1], # Dynamics Machine Gun ['UI_Arlequin_Machine_Gun_Speed_Mobility', 1, 1, 2, 1, 1, 1], # Speed Mobility Machine Gun ['UI_Arlequin_Machine_Gun_HP', 1, 2, 2, 2, 2, 1], # Machine Gun HP ['UI_Arlequin_Double_Gun_Dynamics', 1, 2, 1, 1, 1, 2], # Double Gun Dynamics ['UI_Arlequin_Double_Gun_Speed_Mobility', 1, 1, 1, 1, 1, 2], # Double Gun Speed Mobility ['UI_Arlequin_Double_Gun_HP', 1, 2, 1, 2, 2, 2], # Double Gun HP ['UI_Arlequin_HE_Dynamics', 1, 2, 2, 1, 2, 3], # HE Dynamics ['UI_Arlequin_HE_Speed_Mobility', 1, 1, 2, 1, 2, 3], # HE Speed Mobility ['UI_Arlequin_HE_HP', 1, 2, 2, 2, 2, 3], # HP HE ], 'Harbinger_Mk_IV' : [ ['UI_Harbinger_Mk_IV_DPM_Rotation', 1, 2, 1, 2, 1, 1], # DPM Rotation ['UI_Harbinger_Mk_IV_DPM_Mobility', 1, 2, 1, 1, 1, 1], # DPM Mobility ['UI_Harbinger_Mk_IV_DPM_Armor', 1, 2, 1, 2, 2, 1], # DPM Armor ['UI_Harbinger_Mk_IV_Autoreloader_Rotation', 1, 2, 1, 2, 1, 2], # Rotation Autoreloader ['UI_Harbinger_Mk_IV_Autoreloader_Mobility', 1, 2, 1, 1, 1, 2], # Mobility Autoreloader ['UI_Harbinger_Mk_IV_Autoreloader_Speed_Mobility', 1, 1, 1, 1, 1, 2], # Speed Mobility Autoreloader ['UI_Harbinger_Mk_IV_Autoreloader_Armor', 1, 2, 1, 2, 2, 2], # Armor Autoreloader ['UI_Harbinger_Mk_IV_DPS_Mobility', 1, 2, 1, 1, 2, 3], # Mobility DPS ['UI_Harbinger_Mk_IV_DPS_Speed_Mobility', 1, 1, 1, 1, 2, 3], # Speed Mobility DPS ['UI_Harbinger_Mk_IV_DPS_Armor', 1, 2, 1, 2, 2, 3], # DPS Armor ] } self.i18n = { 'version' : self.versionI18n, 'UI_name' : 'Steel Hunter Auto Upgrades 2020', 'UI_battleMessage' : 'Auto select %s Upgrade to level %s', 'UI_Varyag_description' : 'Varyag', 'UI_Walkure_description' : 'Walkure', 'UI_Raven_description' : 'Raven', 'UI_Arlequin_description' : 'Arlequin', 'UI_Harbinger_Mk_IV_description' : 'Harbinger Mk. IV', 'UI_Varyag_DPM_HP' : 'DPM HP [1, 1, 2, 2, 2, 1]', 'UI_Varyag_DPM_Armor' : 'DPM Armor [1, 1, 2, 1, 1, 1]', 'UI_Varyag_Double_Gun_HP' : 'Double Gun HP [1, 1, 1, 2, 2, 2]', 'UI_Varyag_Double_Gun_Armor' : 'Double Gun Armor [1, 1, 1, 1, 1, 2]', 'UI_Varyag_DPS_HP' : 'DPS HP [1, 1, 2, 2, 2, 3]', 'UI_Varyag_DPS_Armor' : 'DPS Armor [1, 1, 2, 1, 2, 3]', 'UI_Walkure_Machine_Gun_HP' : 'Machine Gun HP [1, 1, 1, 2, 2, 1]', 'UI_Walkure_Machine_Gun_Armor' : 'Machine Gun Armor [1, 1, 1, 1, 1, 1]', 'UI_Walkure_DPM_HP' : 'DPM HP [1, 1, 1, 2, 2, 2]', 'UI_Walkure_DPM_Armor' : 'DPM Armor [1, 1, 1, 1, 1, 2]', 'UI_Walkure_DPS_HP' : 'DPS HP [1, 1, 1, 2, 2, 3]', 'UI_Walkure_DPS_Armor' : 'DPS Armor [1, 1, 1, 1, 2, 3]', 'UI_Raven_DPM_Rotation' : 'DPM Rotation [1, 2, 2, 2, 1, 1]', 'UI_Raven_DPM_Mobility' : 'DPM Mobility [1, 2, 2, 1, 1, 1]', 'UI_Raven_DPM_Armor' : 'DPM Armor [1, 2, 2, 2, 2, 1]', 'UI_Raven_Magazine_Rotation' : 'Magazine Rotation [1, 2, 1, 2, 1, 2]', 'UI_Raven_Magazine_Mobility' : 'Magazine Mobility [1, 2, 1, 1, 1, 2]', 'UI_Raven_Magazine_Speed_Mobility' : 'Magazine Speed Mobility [1, 1, 1, 1, 1, 2]', 'UI_Raven_Magazine_Armor' : 'Magazine Armor [1, 2, 1, 2, 2, 2]', 'UI_Raven_DPS_Mobility' : 'DPS Mobility [1, 2, 1, 1, 2, 3]', 'UI_Raven_DPS_Speed_Mobility' : 'DPS Speed Mobility [1, 1, 1, 1, 2, 3]', 'UI_Raven_DPS_Armor' : 'DPS Armor [1, 2, 1, 2, 2, 3]', 'UI_Arlequin_Machine_Gun_Dynamics' : 'Machine Gun Dynamics [1, 2, 2, 1, 1, 1]', 'UI_Arlequin_Machine_Gun_Speed_Mobility' : 'Machine Gun Speed Mobility [1, 1, 2, 1, 1, 1]', 'UI_Arlequin_Machine_Gun_HP' : 'Machine Gun HP [1, 2, 2, 2, 2, 1]', 'UI_Arlequin_Double_Gun_Dynamics' : 'Double Gun Dynamics [1, 2, 1, 1, 1, 2]', 'UI_Arlequin_Double_Gun_Speed_Mobility' : 'Double Gun Speed Mobility [1, 1, 1, 1, 1, 2]', 'UI_Arlequin_Double_Gun_HP' : 'Double Gun HP [1, 2, 1, 2, 2, 2]', 'UI_Arlequin_HE_Dynamics' : 'HE Dynamics [1, 2, 2, 1, 2, 3]', 'UI_Arlequin_HE_Speed_Mobility' : 'HE Speed Mobility [1, 1, 2, 1, 2, 3]', 'UI_Arlequin_HE_HP' : 'HE HP [1, 2, 2, 2, 2, 3]', 'UI_Harbinger_Mk_IV_DPM_Rotation' : 'DPM Rotation [1, 2, 1, 2, 1, 1]', 'UI_Harbinger_Mk_IV_DPM_Mobility' : 'DPM Mobility [1, 2, 1, 1, 1, 1]', 'UI_Harbinger_Mk_IV_DPM_Armor' : 'DPM Armor [1, 2, 1, 2, 2, 1]', 'UI_Harbinger_Mk_IV_Autoreloader_Rotation' : 'Autoreloader Rotation [1, 2, 1, 2, 1, 2]', 'UI_Harbinger_Mk_IV_Autoreloader_Mobility' : 'Autoreloader Mobility [1, 2, 1, 1, 1, 2]', 'UI_Harbinger_Mk_IV_Autoreloader_Speed_Mobility': 'Autoreloader Speed Mobility [1, 1, 1, 1, 1, 2]', 'UI_Harbinger_Mk_IV_Autoreloader_Armor' : 'Autoreloader Armor [1, 2, 1, 2, 2, 2]', 'UI_Harbinger_Mk_IV_DPS_Mobility' : 'DPS Mobility [1, 2, 1, 1, 2, 3]', 'UI_Harbinger_Mk_IV_DPS_Speed_Mobility' : 'DPS Speed Mobility [1, 1, 1, 1, 2, 3]', 'UI_Harbinger_Mk_IV_DPS_Armor' : 'DPS Armor [1, 2, 1, 2, 2, 3]', 'UI_autoUpgrade_text' : 'Auto-upgrades vehicle in Steel Hunter battle', 'UI_autoUpgrade_tooltip': '', 'UI_showLoot3D_text' : 'Show 3D loot marker, after press Radar button', 'UI_showLoot3D_tooltip': '', } if 'ru' in lang: self.i18n.update({ 'UI_name' : 'Стальной Охотник Авто Улучшения 2020', 'UI_Varyag_description' : 'Варяг', 'UI_battleMessage' : 'Авто выбор %s Улучшения для уровня %s', 'UI_Varyag_DPM_HP' : 'Уроний в ХП [1, 1, 2, 2, 2, 1]', 'UI_Varyag_DPM_Armor' : 'Уроний в броню [1, 1, 2, 1, 1, 1]', 'UI_Varyag_Double_Gun_HP' : 'Шотган в ХП [1, 1, 1, 2, 2, 2]', 'UI_Varyag_Double_Gun_Armor' : 'Шотган в броню [1, 1, 1, 1, 1, 2]', 'UI_Varyag_DPS_HP' : 'Скорострелка в ХП [1, 1, 2, 2, 2, 3]', 'UI_Varyag_DPS_Armor' : 'Скорострелка в броню [1, 1, 2, 1, 2, 3]', 'UI_Walkure_Machine_Gun_HP' : 'Барабан в ХП [1, 1, 1, 2, 2, 1]', 'UI_Walkure_Machine_Gun_Armor' : 'Барабан в броню [1, 1, 1, 1, 1, 1]', 'UI_Walkure_DPM_HP' : 'Уроний в ХП [1, 1, 1, 2, 2, 2]', 'UI_Walkure_DPM_Armor' : 'Уроний в броню [1, 1, 1, 1, 1, 2]', 'UI_Walkure_DPS_HP' : 'Скорострелка в ХП [1, 1, 1, 2, 2, 3]', 'UI_Walkure_DPS_Armor' : 'Скорострелка в броню [1, 1, 1, 1, 2, 3]', 'UI_Raven_DPM_Rotation' : 'Уроний в вёрткость [1, 2, 2, 2, 1, 1]', 'UI_Raven_DPM_Mobility' : 'Уроний в подвижность [1, 2, 2, 1, 1, 1]', 'UI_Raven_DPM_Armor' : 'Уроний в броню [1, 2, 2, 2, 2, 1]', 'UI_Raven_Magazine_Rotation' : 'Барабан в вёрткость [1, 2, 1, 2, 1, 2]', 'UI_Raven_Magazine_Mobility' : 'Барабан в подвижность [1, 2, 1, 1, 1, 2]', 'UI_Raven_Magazine_Speed_Mobility' : 'Барабан в скорость [1, 1, 1, 1, 1, 2]', 'UI_Raven_Magazine_Armor' : 'Барабан в броню [1, 2, 1, 2, 2, 2]', 'UI_Raven_DPS_Mobility' : 'Скорострелка в подвижность [1, 2, 1, 1, 2, 3]', 'UI_Raven_DPS_Speed_Mobility' : 'Скорострелка в скорость [1, 1, 1, 1, 2, 3]', 'UI_Raven_DPS_Armor' : 'Скорострелка в броню [1, 2, 1, 2, 2, 3]', 'UI_Arlequin_Machine_Gun_Dynamics' : 'Барабан в подвижность [1, 2, 2, 1, 1, 1]', 'UI_Arlequin_Machine_Gun_Speed_Mobility' : 'Барабан в скорость [1, 1, 2, 1, 1, 1]', 'UI_Arlequin_Machine_Gun_HP' : 'Барабан в ХП [1, 2, 2, 2, 2, 1]', 'UI_Arlequin_Double_Gun_Dynamics' : 'Шотган в подвижность [1, 2, 1, 1, 1, 2]', 'UI_Arlequin_Double_Gun_Speed_Mobility' : 'Шотган в скорость [1, 1, 1, 1, 1, 2]', 'UI_Arlequin_Double_Gun_HP' : 'Шотган в ХП [1, 2, 1, 2, 2, 2]', 'UI_Arlequin_HE_Dynamics' : 'Фугаска в подвижность [1, 2, 2, 1, 2, 3]', 'UI_Arlequin_HE_Speed_Mobility' : 'Фугаска в скорость [1, 1, 2, 1, 2, 3]', 'UI_Arlequin_HE_HP' : 'Фугаска в ХП [1, 2, 2, 2, 2, 3]', 'UI_Harbinger_Mk_IV_DPM_Rotation' : 'Уроний вёрткость [1, 2, 1, 2, 1, 1]', 'UI_Harbinger_Mk_IV_DPM_Mobility' : 'Уроний в подвижность [1, 2, 1, 1, 1, 1]', 'UI_Harbinger_Mk_IV_DPM_Armor' : 'Уроний в броню [1, 2, 1, 2, 2, 1]', 'UI_Harbinger_Mk_IV_Autoreloader_Rotation' : 'Барабан вёрткость [1, 2, 1, 2, 1, 2]', 'UI_Harbinger_Mk_IV_Autoreloader_Mobility' : 'Барабан подвижность [1, 2, 1, 1, 1, 2]', 'UI_Harbinger_Mk_IV_Autoreloader_Speed_Mobility': 'Барабан в скорость [1, 1, 1, 1, 1, 2]', 'UI_Harbinger_Mk_IV_Autoreloader_Armor' : 'Барабан в броню [1, 2, 1, 2, 2, 2]', 'UI_Harbinger_Mk_IV_DPS_Mobility' : 'Скорострелка в подвижность [1, 2, 1, 1, 2, 3]', 'UI_Harbinger_Mk_IV_DPS_Speed_Mobility' : 'Скорострелка в скорость [1, 1, 1, 1, 2, 3]', 'UI_Harbinger_Mk_IV_DPS_Armor' : 'Скорострелка в броню [1, 2, 1, 2, 2, 3]', 'UI_autoUpgrade_text' : 'Авто улучшение танка в бою, режим Стальной Охотник', 'UI_autoUpgrade_tooltip': '', 'UI_showLoot3D_text' : 'Показывать 3d маркер лута, после нажатия кнопки Радар', 'UI_showLoot3D_tooltip' : '', }) self.data, self.i18n = g_gui.register_data(self.ids, self.data, self.i18n, 'spoter') g_gui.register(self.ids, self.template, self.data, self.apply) print '[LOAD_MOD]: [%s %s, %s]' % (self.ids, self.version, self.author)
with codecs.open(newPath, 'w', encoding='utf-8-sig') as jsonFile: jsonFile.write('%s' % bite_ify( json.dumps(configOld, sort_keys=True, indent=4, ensure_ascii=False, encoding='utf-8-sig', separators=(',', ': ')))) jsonFile.close() configNew = configOld log('[ERROR]: [Not found config, create default: %s' % newPath) return configNew I18N = _load_json('%s'.lower() % getLanguageCode(), I18N, './res_mods/configs/account_manager/i18n/') class AM_MODES: ADD = 'add' EDIT = 'edit' DELETE = 'delete' class Mobj: pass class UserAccounts: __accounts_manager = None
def _packBlocks(self, compId, userID=None): items = super(DogTagInfoTooltip, self)._packBlocks() comp = cca.getComponentById(compId) if userID is None: componentProgress = BigWorld.player().dogTags.getComponentProgress( compId) else: dogTag = PlayerDogTag.fromDict( self.itemsCache.items.getDogTag(int(userID))) componentProgress = dogTag.getComponentByType(comp.viewType) items.append( formatters.packTextBlockData(text_styles.middleTitle( dogTagComposer.getComponentTitle(compId)), padding=self.__titlePadding)) typeLevelBlock = [ text_styles.main(dogTagComposer.getComponentType(compId)) ] valueBlock = list() if comp.viewType == ComponentViewType.ENGRAVING: typeLevelBlock.append(text_styles.main(', ')) typeLevelBlock.append( text_styles.neutral('{} {}'.format( backport.text( R.strings.dogtags.customization.tooltip.level()), componentProgress.grade + 1))) valueBlock.append( text_styles.main('{}: '.format( backport.text( R.strings.dogtags.customization.tooltip.value())))) statValue = componentProgress.value statStr = formatComponentValue(getLanguageCode(), statValue, comp.numberType, specialReplacements=False) valueBlock.append(text_styles.neutral(statStr)) items.append( formatters.packTextBlockData( text_styles.concatStylesToSingleLine(*typeLevelBlock), padding=self.__levelPadding)) items.append( formatters.packTextBlockData( text_styles.concatStylesToSingleLine(*valueBlock))) if comp.viewType == ComponentViewType.BACKGROUND: items.append( formatters.packImageBlockData( dogTagComposer.getComponentImageFullPath( AssetSize.SMALL, compId), padding=formatters.packPadding( top=self.__imagePaddingTop, bottom=self.__imagePaddingBottom))) else: images = [ formatters.packImageBlockData( dogTagComposer.getDefaultBackgroundImageFullPath( AssetSize.SMALL), padding=formatters.packPadding( top=self.__imagePaddingTop)), formatters.packImageBlockData( dogTagComposer.getComponentImageFullPath( AssetSize.SMALL, compId, componentProgress.grade), padding=formatters.packPadding( top=self.__imageNegativeHeight, bottom=self.__imagePaddingBottom)) ] items.append(formatters.packBuildUpBlockData(blocks=images)) items.append( formatters.packTextBlockData(text=text_styles.main( dogTagComposer.getComponentDescription(compId)), padding=self.__descriptionPadding)) return [formatters.packBuildUpBlockData(blocks=items)]
def load_lang(self): lang = str(getLanguageCode()).lower() new_config = self.load_json(lang, self.i18n, self.path_lang) for setting in new_config: if setting in self.i18n: self.i18n[setting] = new_config[setting]
from gui.impl import backport from gui.impl.gen import R from gui.impl.new_year.tooltips.ny_discount_reward_tooltip import NyDiscountRewardTooltip from helpers import dependency, time_utils, getLanguageCode, int2roman from items import new_year from items.components.crew_books_constants import CREW_BOOK_RARITY from items.components.ny_constants import CurrentNYConstants from shared_utils import first, inPercents from skeletons.gui.server_events import IEventsCache from skeletons.new_year import INewYearController from skeletons.gui.shared import IItemsCache from skeletons.gui.lobby_context import ILobbyContext from gui.shared.utils.requesters.tokens_requester import TOTAL_KEY from gui.shared.gui_items.loot_box import NewYearLootBoxes _ARABIC_NUMBERS_LANGUAGE_CODES = ('ko', 'no') IS_ROMAN_NUMBERS_ALLOWED = getLanguageCode() not in _ARABIC_NUMBERS_LANGUAGE_CODES BONUS_ICONS = {'xpFactor': R.images.gui.maps.icons.newYear.vehicles.icons.icon_battle_exp_main(), 'freeXPFactor': R.images.gui.maps.icons.newYear.vehicles.icons.icon_free_exp_main_screen(), 'tankmenXPFactor': R.images.gui.maps.icons.newYear.vehicles.icons.icon_crew_exp_main()} _BONUSES_ORDER = ({'bonusName': 'tmanToken'}, {'bonusName': CurrentNYConstants.FILLERS}, {'bonusName': 'battleToken', 'tagStartsWith': LOOTBOX_TOKEN_PREFIX}, {'bonusName': 'entitlements'}, {'bonusName': 'crewBooks', 'tag': CREW_BOOK_RARITY.PERSONAL}, {'bonusName': 'dossier', 'tag': 'isPrefixBadge'}, {'bonusName': 'customizations', 'tag': 'style'}, {'bonusName': 'customizations'},