示例#1
1
 def getFormattedStrings(self, vInfoVO, vStatsVO, viStatsVO, ctx, fullPlayerName):
     padding = makeHtmlString('html_templates:battle', 'multiteamPadding', {})
     format = self._findPlayerHTMLFormat(vInfoVO, ctx, self._ui.colorManager)
     formatWithPadding = format + padding
     maxLabelLength = ctx.playerLabelMaxLength
     playerVO = vInfoVO.player
     isIGR = vInfoVO.vehicleType.isPremiumIGR
     if isIGR:
         maxLabelLength = maxLabelLength - 2
     fullPlayerName = self._trimLongName(fullPlayerName, maxLabelLength)
     fragsString = formatWithPadding % ' '
     if vStatsVO.frags or viStatsVO.equipmentKills:
         fragsString = formatWithPadding % str(vStatsVO.frags + viStatsVO.equipmentKills)
     accountDBIDStr = str(playerVO.accountDBID)
     if self._formatedNames is not None and accountDBIDStr in self._formatedNames:
         pName = format % self._formatedNames[accountDBIDStr]
     else:
         pName = format % fullPlayerName
     frags = fragsString
     vName = formatWithPadding % vInfoVO.vehicleType.guiName
     if isIGR:
         igrType = playerVO.igrType
         icon = makeHtmlString('html_templates:igr/iconSmall', 'premium' if igrType == IGR_TYPE.PREMIUM else 'basic')
         pName += icon
     pName += padding
     scoreFormat = self._getHTMLString('falloutSelfGold', self._ui.colorManager) + padding
     regularFormat = self._getHTMLString('textColorFalloutRegular', self._ui.colorManager) + padding
     highlightedDeaths = viStatsVO.stopRespawn
     deathsFormatStyle = 'textColorFalloutHighlightedDeaths' if highlightedDeaths else 'textColorFalloutRegularDeaths'
     deathsFormat = self._getHTMLString(deathsFormatStyle, self._ui.colorManager) + padding
     scoreString = scoreFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.winPoints)
     if viStatsVO.deathCount > 0:
         deathsString = deathsFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.deathCount)
     else:
         deathsString = deathsFormat % ''
     damageString = regularFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.damageDealt + viStatsVO.equipmentDamage)
     if hasResourcePoints():
         specialPointsString = regularFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.resourceAbsorbed)
     else:
         flagsCaptured = viStatsVO.flagActions[FLAG_ACTION.CAPTURED]
         specialPointsString = regularFormat % BigWorld.wg_getNiceNumberFormat(flagsCaptured)
     return (pName,
      frags,
      vName,
      (scoreString,
       damageString,
       deathsString,
       specialPointsString),
      '')
示例#2
0
    def _makeTeamValues(self, isEnemy, ctx, pNamesList, fragsList, vNamesList, additionalDatas, valuesHashes):
        result = super(FalloutBattleArenaController, self)._makeTeamValues(
            isEnemy, ctx, pNamesList, fragsList, vNamesList, additionalDatas, valuesHashes
        )
        specialPointsStr = ""
        damageStr = ""
        deathsStr = ""
        scoreStr = ""
        for scoreString, damageString, deathsString, specialPointsString in additionalDatas:
            scoreStr += scoreString
            deathsStr += deathsString
            damageStr += damageString
            specialPointsStr += specialPointsString

        if hasResourcePoints():
            battleType = "resources"
        else:
            battleType = "flags"
        result.update(
            {
                "specialPointsStr": specialPointsStr,
                "damageStr": damageStr,
                "deathsStr": deathsStr,
                "scoreStr": scoreStr,
                "battleType": battleType,
            }
        )
        return result
示例#3
0
 def _setTipsInfo(self):
     arena = arena_info.getClientArena()
     arenaDP = self._battleCtx.getArenaDP()
     if arena_info.hasResourcePoints():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT
     elif arena_info.hasFlags():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT
     else:
         bgUrl = ''
     if self.__isFallout:
         self.as_setEventInfoPanelDataS({'bgUrl': bgUrl,
          'items': getHelpTextAsDicts(arena_info.getArenaType())})
         self.as_setVisualTipInfoS(self.__makeVisualTipVO(arenaDP, arena))
     elif not self.__isTipInited:
         battlesCount = DEFAULT_BATTLES_COUNT
         if g_lobbyContext.getBattlesCount() is not None:
             battlesCount = g_lobbyContext.getBattlesCount()
         classTag, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo()
         criteria = tips.getTipsCriteria(arena)
         criteria.setBattleCount(battlesCount)
         criteria.setClassTag(classTag)
         criteria.setLevel(vLvl)
         criteria.setNation(nation)
         tip = criteria.find()
         self.as_setTipTitleS(text_styles.highTitle(tip.status))
         self.as_setTipS(text_styles.playerOnline(tip.body))
         self.as_setVisualTipInfoS(self.__makeVisualTipVO(arenaDP, arena, tip))
         self.__isTipInited = True
     return
def getHelpTextAsDicts(arenaType = None, arenaBonusType = None):
    pointsObjective = hasResourcePoints(arenaType, arenaBonusType)
    isMultiteam = getIsMultiteam()
    if pointsObjective:
        objectiveHead = neutral(FALLOUT.INFOPANEL_RESOURCEPOINTS_HEAD)
        objectiveDescr = main(FALLOUT.INFOPANEL_RESOURCEPOINTS_DESCR)
    else:
        objectiveHead = neutral(FALLOUT.INFOPANEL_GETFLAGS_HEAD)
        objectiveDescr = main(FALLOUT.INFOPANEL_GETFLAGS_DESCR)
    secretsWinHead = neutral(FALLOUT.INFOPANEL_SECRETWIN_HEAD)
    secretsWinDescr = main(FALLOUT.INFOPANEL_SECRETWIN_DESCR)
    repairHead = neutral(FALLOUT.INFOPANEL_REPAIR_HEAD)
    repairDescr = main(FALLOUT.INFOPANEL_REPAIR_DESCR)
    if isMultiteam:
        garageHead = neutral(FALLOUT.INFOPANEL_GARAGEMULTITEAM_HEAD)
        garageDescr = main(FALLOUT.INFOPANEL_GARAGEMULTITEAM_DESCR)
    else:
        garageHead = neutral(FALLOUT.INFOPANEL_GARAGE_HEAD)
        garageDescr = main(FALLOUT.INFOPANEL_GARAGE_DESCR)
    return [{'head': objectiveHead,
      'descr': objectiveDescr},
     {'head': secretsWinHead,
      'descr': secretsWinDescr},
     {'head': repairHead,
      'descr': repairDescr},
     {'head': garageHead,
      'descr': garageDescr}]
示例#5
0
 def _setTipsInfo(self):
     arena = getClientArena()
     isFallout = arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES
     arenaDP = self._battleCtx.getArenaDP()
     if hasResourcePoints():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT
     elif hasFlags():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT
     else:
         bgUrl = ''
     if isFallout:
         self.as_setEventInfoPanelDataS({
             'bgUrl':
             bgUrl,
             'items':
             getHelpTextAsDicts(arena.arenaType)
         })
     elif not self.__isTipInited:
         battlesCount = DEFAULT_BATTLES_COUNT
         if g_lobbyContext.getBattlesCount() is not None:
             battlesCount = g_lobbyContext.getBattlesCount()
         vType, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo()
         tipsIterator = tips.getTipsIterator(arena.guiType, battlesCount,
                                             vType, nation, vLvl)
         statusStr, tipStr = ('', '')
         if tipsIterator is not None:
             statusStr, tipStr = next(tipsIterator)
         else:
             LOG_ERROR('No required tips found')
         self.as_setTipTitleS(text_styles.highTitle(statusStr))
         self.as_setTipS(text_styles.playerOnline(tipStr))
         self.__isTipInited = True
示例#6
0
def getHelpTextAsDicts(arenaType = None, arenaBonusType = None):
    pointsObjective = hasResourcePoints(arenaType, arenaBonusType)
    isMultiteam = getIsMultiteam()
    if pointsObjective:
        objectiveHead = neutral(FALLOUT.INFOPANEL_RESOURCEPOINTS_HEAD)
        objectiveDescr = main(FALLOUT.INFOPANEL_RESOURCEPOINTS_DESCR)
    else:
        objectiveHead = neutral(FALLOUT.INFOPANEL_GETFLAGS_HEAD)
        objectiveDescr = main(FALLOUT.INFOPANEL_GETFLAGS_DESCR)
    secretsWinHead = neutral(FALLOUT.INFOPANEL_SECRETWIN_HEAD)
    secretsWinDescr = main(FALLOUT.INFOPANEL_SECRETWIN_DESCR)
    repairHead = neutral(FALLOUT.INFOPANEL_REPAIR_HEAD)
    repairDescr = main(FALLOUT.INFOPANEL_REPAIR_DESCR)
    if isMultiteam:
        garageHead = neutral(FALLOUT.INFOPANEL_GARAGEMULTITEAM_HEAD)
        garageDescr = main(FALLOUT.INFOPANEL_GARAGEMULTITEAM_DESCR)
    else:
        garageHead = neutral(FALLOUT.INFOPANEL_GARAGE_HEAD)
        garageDescr = main(FALLOUT.INFOPANEL_GARAGE_DESCR)
    return [{'head': objectiveHead,
      'descr': objectiveDescr},
     {'head': secretsWinHead,
      'descr': secretsWinDescr},
     {'head': repairHead,
      'descr': repairDescr},
     {'head': garageHead,
      'descr': garageDescr}]
示例#7
0
 def __getGeneralData(self):
     if hasResourcePoints():
         helpPanelMode = 'points'
     else:
         helpPanelMode = 'flags'
     return {'titleMsg': "<font face='$FieldFont' size='32' color='#F4EFE8'>%s</font><font size='4'><br><br></font>%s" % (i18n.makeString(INGAME_GUI.RESPAWNVIEW_TITLE), standard(i18n.makeString(INGAME_GUI.RESPAWNVIEW_ADDITIONALTIP))),
      'helpPanelMode': helpPanelMode}
示例#8
0
 def __init__(self, appNS):
     self.__ns = appNS
     self.__soundManager = None
     self.__arena = BigWorld.player().arena
     self.__plugins = PluginsCollection(self)
     plugins = {}
     if hasFlags():
         plugins['flagNotification'] = FlagNotificationPlugin
     if hasRespawns() and not BattleReplay.g_replayCtrl.isPlaying:
         plugins['respawnView'] = RespawnViewPlugin
     if hasResourcePoints():
         plugins['resources'] = ResourcePointsPlugin
     self.__plugins.addPlugins(plugins)
     BattleWindow.__init__(self, 'battle.swf')
     self.__isHelpWindowShown = False
     self.__cameraMode = None
     self.component.wg_inputKeyMode = 1
     self.component.position.z = DEPTH_OF_Battle
     self.movie.backgroundAlpha = 0
     self.addFsCallbacks({'battle.leave': self.onExitBattle})
     self.addExternalCallbacks({'battle.showCursor': self.cursorVisibility,
      'battle.tryLeaveRequest': self.tryLeaveRequest,
      'battle.populateFragCorrelationBar': self.populateFragCorrelationBar,
      'Battle.UsersRoster.Appeal': self.onDenunciationReceived,
      'Battle.selectPlayer': self.selectPlayer,
      'battle.helpDialogOpenStatus': self.helpDialogOpenStatus,
      'battle.initLobbyDialog': self._initLobbyDialog,
      'battle.reportBug': self.reportBug})
     self.__dynSquadListener = None
     BigWorld.wg_setRedefineKeysMode(False)
     self.onPostmortemVehicleChanged(BigWorld.player().playerVehicleID)
示例#9
0
 def __init__(self, appNS):
     self.__ns = appNS
     self.__soundManager = None
     self.__arena = BigWorld.player().arena
     self.__plugins = PluginsCollection(self)
     plugins = {}
     if hasFlags():
         plugins['flagNotification'] = FlagNotificationPlugin
     if hasRespawns() and not BattleReplay.g_replayCtrl.isPlaying:
         plugins['respawnView'] = RespawnViewPlugin
     if hasResourcePoints():
         plugins['resources'] = ResourcePointsPlugin
     self.__plugins.addPlugins(plugins)
     BattleWindow.__init__(self, 'battle.swf')
     self.__isHelpWindowShown = False
     self.__cameraMode = None
     self.component.wg_inputKeyMode = 1
     self.component.position.z = DEPTH_OF_Battle
     self.movie.backgroundAlpha = 0
     self.addFsCallbacks({'battle.leave': self.onExitBattle})
     self.addExternalCallbacks({'battle.showCursor': self.cursorVisibility,
      'battle.tryLeaveRequest': self.tryLeaveRequest,
      'battle.populateFragCorrelationBar': self.populateFragCorrelationBar,
      'Battle.UsersRoster.Appeal': self.onDenunciationReceived,
      'Battle.selectPlayer': self.selectPlayer,
      'battle.helpDialogOpenStatus': self.helpDialogOpenStatus,
      'battle.initLobbyDialog': self._initLobbyDialog,
      'battle.reportBug': self.reportBug})
     self.__dynSquadListener = None
     BigWorld.wg_setRedefineKeysMode(False)
     self.onPostmortemVehicleChanged(BigWorld.player().playerVehicleID)
     return
示例#10
0
 def _setTipsInfo(self):
     arena = getClientArena()
     isFallout = arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES
     arenaDP = self._battleCtx.getArenaDP()
     if hasResourcePoints():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT
     elif hasFlags():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT
     else:
         bgUrl = ''
     if isFallout:
         self.as_setEventInfoPanelDataS({'bgUrl': bgUrl,
          'items': getHelpTextAsDicts(arena.arenaType)})
     elif not self.__isTipInited:
         battlesCount = DEFAULT_BATTLES_COUNT
         if g_lobbyContext.getBattlesCount() is not None:
             battlesCount = g_lobbyContext.getBattlesCount()
         vType, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo()
         tipsIterator = tips.getTipsIterator(arena.guiType, battlesCount, vType, nation, vLvl)
         statusStr, tipStr = ('', '')
         if tipsIterator is not None:
             statusStr, tipStr = next(tipsIterator)
         else:
             LOG_ERROR('No required tips found')
         self.as_setTipTitleS(text_styles.highTitle(statusStr))
         self.as_setTipS(text_styles.playerOnline(tipStr))
         self.__isTipInited = True
     return
示例#11
0
 def getFormattedStrings(self, vInfoVO, vStatsVO, viStatsVO, ctx, fullPlayerName):
     format = self._findPlayerHTMLFormat(vInfoVO, ctx, self._ui.colorManager)
     unicodeStr, _ = unicode_from_utf8(fullPlayerName)
     if len(unicodeStr) > ctx.labelMaxLength:
         fullPlayerName = '{0}..'.format(normalized_unicode_trim(fullPlayerName, ctx.labelMaxLength - 2))
     fragsString = format % ' '
     if vStatsVO.frags or viStatsVO.equipmentKills:
         fragsString = format % str(vStatsVO.frags + viStatsVO.equipmentKills)
     pName = format % fullPlayerName
     frags = fragsString
     vName = format % vInfoVO.vehicleType.shortName
     scoreFormat = self._getHTMLString('textColorGold', self._ui.colorManager)
     regularFormat = self._getHTMLString('textColorFalloutRegular', self._ui.colorManager)
     highlightedDeaths = viStatsVO.stopRespawn
     deathsFormatStyle = 'textColorFalloutHighlightedDeaths' if highlightedDeaths else 'textColorFalloutRegularDeaths'
     deathsFormat = self._getHTMLString(deathsFormatStyle, self._ui.colorManager)
     scoreString = scoreFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.winPoints)
     if viStatsVO.deathCount > 0:
         deathsString = deathsFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.deathCount)
     else:
         deathsString = deathsFormat % ''
     damageString = regularFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.damageDealt + viStatsVO.equipmentDamage)
     if hasResourcePoints():
         specialPointsString = regularFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.resourceAbsorbed)
     else:
         flagsCaptured = viStatsVO.flagActions[FLAG_ACTION.CAPTURED]
         specialPointsString = regularFormat % BigWorld.wg_getNiceNumberFormat(flagsCaptured)
     return (pName,
      frags,
      vName,
      (scoreString,
       damageString,
       deathsString,
       specialPointsString))
示例#12
0
 def getFormattedStrings(self, vInfoVO, vStatsVO, viStatsVO, ctx,
                         fullPlayerName):
     padding = makeHtmlString('html_templates:battle', 'multiteamPadding',
                              {})
     format = self._findPlayerHTMLFormat(vInfoVO, ctx,
                                         self._ui.colorManager)
     formatWithPadding = format + padding
     maxLabelLength = ctx.playerLabelMaxLength
     playerVO = vInfoVO.player
     isIGR = vInfoVO.vehicleType.isPremiumIGR
     if isIGR:
         maxLabelLength = maxLabelLength - 2
     fullPlayerName = self._trimLongName(fullPlayerName, maxLabelLength)
     fragsString = formatWithPadding % ' '
     if vStatsVO.frags or viStatsVO.equipmentKills:
         fragsString = formatWithPadding % str(vStatsVO.frags +
                                               viStatsVO.equipmentKills)
     accountDBIDStr = str(playerVO.accountDBID)
     if self._formatedNames is not None and accountDBIDStr in self._formatedNames:
         pName = format % self._formatedNames[accountDBIDStr]
     else:
         pName = format % fullPlayerName
     frags = fragsString
     vName = formatWithPadding % vInfoVO.vehicleType.guiName
     if isIGR:
         igrType = playerVO.igrType
         icon = makeHtmlString(
             'html_templates:igr/iconSmall',
             'premium' if igrType == IGR_TYPE.PREMIUM else 'basic')
         pName += icon
     pName += padding
     scoreFormat = self._getHTMLString('falloutSelfGold',
                                       self._ui.colorManager) + padding
     regularFormat = self._getHTMLString('textColorFalloutRegular',
                                         self._ui.colorManager) + padding
     highlightedDeaths = viStatsVO.stopRespawn
     deathsFormatStyle = 'textColorFalloutHighlightedDeaths' if highlightedDeaths else 'textColorFalloutRegularDeaths'
     deathsFormat = self._getHTMLString(deathsFormatStyle,
                                        self._ui.colorManager) + padding
     scoreString = scoreFormat % BigWorld.wg_getNiceNumberFormat(
         viStatsVO.winPoints)
     if viStatsVO.deathCount > 0:
         deathsString = deathsFormat % BigWorld.wg_getNiceNumberFormat(
             viStatsVO.deathCount)
     else:
         deathsString = deathsFormat % ''
     damageString = regularFormat % BigWorld.wg_getNiceNumberFormat(
         viStatsVO.damageDealt + viStatsVO.equipmentDamage)
     if hasResourcePoints():
         specialPointsString = regularFormat % BigWorld.wg_getNiceNumberFormat(
             viStatsVO.resourceAbsorbed)
     else:
         flagsCaptured = viStatsVO.flagActions[FLAG_ACTION.CAPTURED]
         specialPointsString = regularFormat % BigWorld.wg_getNiceNumberFormat(
             flagsCaptured)
     return (pName, frags, vName, (scoreString, damageString, deathsString,
                                   specialPointsString), '')
示例#13
0
 def __populateData(self, isMutlipleTeams = False):
     arena = avatar_getter.getArena()
     arenaDP = g_sessionProvider.getArenaDP()
     arenaData = ['',
      0,
      '',
      '',
      '']
     if arena:
         arenaData = [toUpper(arena.arenaType.name)]
         descExtra = getPrebattleFullDescription(arena.extraData or {})
         arenaSubType = getArenaSubTypeName(BigWorld.player().arenaTypeID)
         if descExtra:
             arenaData.extend([arena.guiType + 1, descExtra])
         elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]:
             arenaTypeName = '#arenas:type/%s/name' % arenaSubType
             arenaData.extend([getNecessaryArenaFrameName(arenaSubType, isBaseExists(BigWorld.player().arenaTypeID, BigWorld.player().team)), arenaTypeName])
         elif arena.guiType in constants.ARENA_GUI_TYPE.RANGE:
             arenaData.append(constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType])
             if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints():
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_RESOURCEPOINTS_UPPER))
             elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and isMutlipleTeams:
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_MIX_UPPER))
             else:
                 arenaData.append('#menu:loading/battleTypes/%d' % arena.guiType)
         else:
             arenaData.extend([arena.guiType + 1, '#menu:loading/battleTypes/%d' % arena.guiType])
         myTeamNumber = arenaDP.getNumberOfTeam()
         getTeamName = g_sessionProvider.getCtx().getTeamName
         arenaData.extend([getTeamName(myTeamNumber), getTeamName(arenaDP.getNumberOfTeam(enemy=True))])
         teamHasBase = 1 if isBaseExists(BigWorld.player().arenaTypeID, myTeamNumber) else 2
         if not isEventBattle():
             typeEvent = 'normal'
             winText = getBattleSubTypeWinText(BigWorld.player().arenaTypeID, teamHasBase)
         else:
             typeEvent = 'fallout'
             if getIsMultiteam():
                 winText = i18n.makeString(ARENAS.TYPE_FALLOUTMUTLITEAM_DESCRIPTION)
             else:
                 winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType)
         arenaData.append(winText)
         arenaData.append(typeEvent)
         vehInfo = arenaDP.getVehicleInfo(arenaDP.getPlayerVehicleID())
         pqTipData = [None] * 3
         pQuests = vehInfo.player.getPotapovQuests()
         serverSettings = g_lobbyContext.getServerSettings()
         isPQEnabled = serverSettings is not None and serverSettings.isPotapovQuestEnabled()
         if isPQEnabled and (arena.guiType == constants.ARENA_GUI_TYPE.RANDOM or arena.guiType == constants.ARENA_GUI_TYPE.TRAINING and constants.IS_DEVELOPMENT):
             if len(pQuests):
                 quest = pQuests[0]
                 pqTipData = [quest.getUserName(), quest.getUserMainCondition(), quest.getUserAddCondition()]
             else:
                 pqTipData = [i18n.makeString('#ingame_gui:potapovQuests/tip'), None, None]
         arenaData.extend(pqTipData)
         arenaData.extend([getArenaIcon(_SMALL_MAP_SOURCE)])
     self.__callEx('arenaData', arenaData)
     return
示例#14
0
 def __populateData(self, isMutlipleTeams = False):
     arena = avatar_getter.getArena()
     arenaDP = g_sessionProvider.getArenaDP()
     arenaData = ['',
      0,
      '',
      '',
      '']
     if arena:
         arenaData = [toUpper(arena.arenaType.name)]
         descExtra = getPrebattleFullDescription(arena.extraData or {})
         arenaSubType = getArenaSubTypeName(BigWorld.player().arenaTypeID)
         if descExtra:
             arenaData.extend([arena.guiType + 1, descExtra])
         elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]:
             arenaTypeName = '#arenas:type/%s/name' % arenaSubType
             arenaData.extend([getNecessaryArenaFrameName(arenaSubType, isBaseExists(BigWorld.player().arenaTypeID, BigWorld.player().team)), arenaTypeName])
         elif arena.guiType in constants.ARENA_GUI_TYPE.RANGE:
             arenaData.append(constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType])
             if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints():
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_RESOURCEPOINTS_UPPER))
             elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and isMutlipleTeams:
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_MIX_UPPER))
             else:
                 arenaData.append('#menu:loading/battleTypes/%d' % arena.guiType)
         else:
             arenaData.extend([arena.guiType + 1, '#menu:loading/battleTypes/%d' % arena.guiType])
         myTeamNumber = arenaDP.getNumberOfTeam()
         getTeamName = g_sessionProvider.getCtx().getTeamName
         arenaData.extend([getTeamName(myTeamNumber), getTeamName(arenaDP.getNumberOfTeam(enemy=True))])
         teamHasBase = 1 if isBaseExists(BigWorld.player().arenaTypeID, myTeamNumber) else 2
         if not isEventBattle():
             typeEvent = 'normal'
             winText = getBattleSubTypeWinText(BigWorld.player().arenaTypeID, teamHasBase)
         else:
             typeEvent = 'fallout'
             if getIsMultiteam():
                 winText = i18n.makeString(ARENAS.TYPE_FALLOUTMUTLITEAM_DESCRIPTION)
             else:
                 winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType)
         arenaData.append(winText)
         arenaData.append(typeEvent)
         vehInfo = arenaDP.getVehicleInfo(arenaDP.getPlayerVehicleID())
         pqTipData = [None] * 3
         pQuests = vehInfo.player.getPotapovQuests()
         serverSettings = g_lobbyContext.getServerSettings()
         isPQEnabled = serverSettings is not None and serverSettings.isPotapovQuestEnabled()
         if isPQEnabled and (arena.guiType == constants.ARENA_GUI_TYPE.RANDOM or arena.guiType == constants.ARENA_GUI_TYPE.TRAINING and constants.IS_DEVELOPMENT):
             if len(pQuests):
                 quest = pQuests[0]
                 pqTipData = [quest.getUserName(), quest.getUserMainCondition(), quest.getUserAddCondition()]
             else:
                 pqTipData = [i18n.makeString('#ingame_gui:potapovQuests/tip'), None, None]
         arenaData.extend(pqTipData)
         arenaData.extend([getArenaIcon(_SMALL_MAP_SOURCE)])
     self.__callEx('arenaData', arenaData)
示例#15
0
 def __getGeneralData(self):
     if hasResourcePoints():
         helpPanelMode = 'points'
     else:
         helpPanelMode = 'flags'
     return {'titleMsg': "<font face='$FieldFont' size='32' color='#F4EFE8'>%s</font><font size='4'><br><br></font>%s" % (i18n.makeString(INGAME_GUI.RESPAWNVIEW_TITLE), standard(i18n.makeString(INGAME_GUI.RESPAWNVIEW_ADDITIONALTIP))),
      'helpPanelMode': helpPanelMode,
      'topInfoStr': '',
      'respawnInfoStr': '',
      'isPostmortemViewBtnEnabled': False,
      'postmortemBtnLbl': FALLOUT.INFOPANEL_GARAGE_POSTMORTEMBTNLBL}
示例#16
0
 def _addArenaExtraData(self, arenaDP):
     arena = getClientArena()
     if arena:
         arenaType = arena.arenaType
         extraData = arena.extraData or {}
         descExtra = getPrebattleFullDescription(extraData)
         arenaTypeID = getArenaTypeID()
         arenaSubType = getArenaSubTypeName(arenaTypeID)
         team = arenaDP.getNumberOfTeam()
         enemy = arenaDP.getNumberOfTeam(True)
         hasBase = isBaseExists(arenaTypeID, team)
         allyTeamName, enemyTeamName = self._battleCtx.getTeamName(
             team), self._battleCtx.getTeamName(enemy)
         if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES:
             winText = i18n.makeString('#arenas:type/%s/description' %
                                       arenaSubType)
         else:
             winText = getBattleSubTypeWinText(arenaTypeID,
                                               1 if hasBase else 2)
         if descExtra:
             battleTypeLocaleStr = descExtra
             if arena.guiType != constants.ARENA_GUI_TYPE.UNKNOWN and arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS:
                 battleTypeFrameLabel = constants.ARENA_GUI_TYPE_LABEL.LABELS[
                     arena.guiType]
             else:
                 battleTypeFrameLabel = 'neutral'
         elif arena.guiType in [
                 constants.ARENA_GUI_TYPE.RANDOM,
                 constants.ARENA_GUI_TYPE.TRAINING
         ]:
             battleTypeLocaleStr = '#arenas:type/%s/name' % arenaSubType
             battleTypeFrameLabel = getNecessaryArenaFrameName(
                 arenaSubType, hasBase)
         elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints(
         ):
             battleTypeFrameLabel = 'resourcePoints'
             battleTypeLocaleStr = MENU.LOADING_BATTLETYPES_RESOURCEPOINTS
         else:
             battleTypeLocaleStr = '#menu:loading/battleTypes/%d' % arena.guiType
             if arena.guiType != constants.ARENA_GUI_TYPE.UNKNOWN and arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS:
                 battleTypeFrameLabel = constants.ARENA_GUI_TYPE_LABEL.LABELS[
                     arena.guiType]
             else:
                 battleTypeFrameLabel = 'neutral'
         arenaInfoData = {
             'mapName': arenaType.name,
             'winText': winText,
             'battleTypeLocaleStr': battleTypeLocaleStr,
             'battleTypeFrameLabel': battleTypeFrameLabel,
             'allyTeamName': allyTeamName,
             'enemyTeamName': enemyTeamName
         }
         self._setArenaInfo(arenaInfoData)
示例#17
0
 def __getGeneralData(self):
     if hasResourcePoints():
         helpPanelMode = 'points'
     else:
         helpPanelMode = 'flags'
     return {
         'titleMsg':
         "<font face='$FieldFont' size='32' color='#F4EFE8'>%s</font><font size='4'><br><br></font>%s"
         %
         (i18n.makeString(INGAME_GUI.RESPAWNVIEW_TITLE),
          standard(i18n.makeString(INGAME_GUI.RESPAWNVIEW_ADDITIONALTIP))),
         'helpPanelMode':
         helpPanelMode
     }
示例#18
0
    def __init__(self, appNS):
        g_sessionProvider.registerViewComponents(*_COMPONENTS_TO_CTRLS)
        self.__ns = appNS
        self.__soundManager = None
        self.__arena = BigWorld.player().arena
        self.__plugins = PluginsCollection(self)
        plugins = {}
        if hasFlags():
            plugins['flagNotification'] = FlagNotificationPlugin
        if hasRepairPoints():
            plugins['repairTimer'] = RepairTimerPlugin
        if hasRespawns() and (constants.IS_DEVELOPMENT or not BattleReplay.g_replayCtrl.isPlaying):
            plugins['respawnView'] = RespawnViewPlugin
        if hasResourcePoints():
            plugins['resources'] = ResourcePointsPlugin
        if hasGasAttack():
            plugins['gasAttack'] = GasAttackPlugin
        self.__plugins.addPlugins(plugins)
        self.__denunciator = BattleDenunciator()
        self.__timerSounds = {}
        for timer, sounds in self.VEHICLE_DEATHZONE_TIMER_SOUND.iteritems():
            self.__timerSounds[timer] = {}
            for level, sound in sounds.iteritems():
                self.__timerSounds[timer][level] = SoundGroups.g_instance.getSound2D(sound)

        self.__timerSound = None
        BattleWindow.__init__(self, 'battle.swf')
        self.__isHelpWindowShown = False
        self.__cameraMode = None
        self.component.wg_inputKeyMode = 1
        self.component.position.z = DEPTH_OF_Battle
        self.movie.backgroundAlpha = 0
        self.addFsCallbacks({'battle.leave': self.onExitBattle})
        self.addExternalCallbacks({'battle.showCursor': self.cursorVisibility,
         'battle.tryLeaveRequest': self.tryLeaveRequest,
         'battle.populateFragCorrelationBar': self.populateFragCorrelationBar,
         'Battle.UsersRoster.Appeal': self.onDenunciationReceived,
         'Battle.selectPlayer': self.selectPlayer,
         'battle.helpDialogOpenStatus': self.helpDialogOpenStatus,
         'battle.initLobbyDialog': self._initLobbyDialog,
         'battle.reportBug': self.reportBug})
        self.__dynSquadListener = None
        BigWorld.wg_setRedefineKeysMode(False)
        self.onPostmortemVehicleChanged(BigWorld.player().playerVehicleID)
        return
示例#19
0
 def __populateData(self, isMutlipleTeams = False):
     arena = avatar_getter.getArena()
     arenaDP = g_sessionProvider.getArenaDP()
     arenaData = ['',
      0,
      '',
      '',
      '']
     if arena:
         arenaData = [toUpper(arena.arenaType.name)]
         descExtra = getPrebattleFullDescription(arena.extraData or {})
         arenaSubType = getArenaSubTypeName(BigWorld.player().arenaTypeID)
         if descExtra:
             arenaData.extend([arena.guiType + 1, descExtra])
         elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]:
             arenaTypeName = '#arenas:type/%s/name' % arenaSubType
             arenaData.extend([getNecessaryArenaFrameName(arenaSubType, isBaseExists(BigWorld.player().arenaTypeID, BigWorld.player().team)), arenaTypeName])
         elif arena.guiType in constants.ARENA_GUI_TYPE.RANGE:
             arenaData.append(constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType])
             if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints():
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_RESOURCEPOINTS_UPPER))
             elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and isMutlipleTeams:
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_MIX_UPPER))
             else:
                 arenaData.append('#menu:loading/battleTypes/%d' % arena.guiType)
         else:
             arenaData.extend([arena.guiType + 1, '#menu:loading/battleTypes/%d' % arena.guiType])
         myTeamNumber = arenaDP.getNumberOfTeam()
         getTeamName = g_sessionProvider.getCtx().getTeamName
         arenaData.extend([getTeamName(myTeamNumber), getTeamName(arenaDP.getNumberOfTeam(enemy=True))])
         teamHasBase = 1 if isBaseExists(BigWorld.player().arenaTypeID, myTeamNumber) else 2
         if not isEventBattle():
             typeEvent = 'normal'
             winText = getBattleSubTypeWinText(BigWorld.player().arenaTypeID, teamHasBase)
         else:
             typeEvent = 'fallout'
             if getIsMultiteam():
                 winText = i18n.makeString(ARENAS.TYPE_FALLOUTMUTLITEAM_DESCRIPTION)
             else:
                 winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType)
         arenaData.append(winText)
         arenaData.append(typeEvent)
         arenaData.extend(_getQuestsTipData(arena, arenaDP))
         arenaData.extend([getArenaIcon(_SMALL_MAP_SOURCE)])
     self.__callEx('arenaData', arenaData)
示例#20
0
 def getFormattedStrings(self, vInfoVO, vStatsVO, viStatsVO, ctx, fullPlayerName):
     padding = makeHtmlString('html_templates:battle', 'multiteamPadding', {})
     format = self._findPlayerHTMLFormat(vInfoVO, ctx, self._ui.colorManager)
     formatWithPadding = format + padding
     unicodeStr, _ = unicode_from_utf8(fullPlayerName)
     maxLabelLength = ctx.labelMaxLength
     isIGR = vInfoVO.player.isIGR()
     if isIGR:
         maxLabelLength = maxLabelLength - 2
     if len(unicodeStr) > maxLabelLength:
         fullPlayerName = '{0}..'.format(normalized_unicode_trim(fullPlayerName, maxLabelLength - 2))
     fragsString = formatWithPadding % ' '
     if vStatsVO.frags or viStatsVO.equipmentKills:
         fragsString = formatWithPadding % str(vStatsVO.frags + viStatsVO.equipmentKills)
     pName = format % fullPlayerName
     frags = fragsString
     vName = formatWithPadding % vInfoVO.vehicleType.shortName
     if isIGR:
         igrType = vInfoVO.player.igrType
         icon = makeHtmlString('html_templates:igr/iconSmall', 'premium' if igrType == IGR_TYPE.PREMIUM else 'basic')
         pName += icon
     pName += padding
     scoreFormat = self._getHTMLString('textColorGold', self._ui.colorManager) + padding
     regularFormat = self._getHTMLString('textColorFalloutRegular', self._ui.colorManager) + padding
     highlightedDeaths = viStatsVO.stopRespawn
     deathsFormatStyle = 'textColorFalloutHighlightedDeaths' if highlightedDeaths else 'textColorFalloutRegularDeaths'
     deathsFormat = self._getHTMLString(deathsFormatStyle, self._ui.colorManager) + padding
     scoreString = scoreFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.winPoints)
     if viStatsVO.deathCount > 0:
         deathsString = deathsFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.deathCount)
     else:
         deathsString = deathsFormat % ''
     damageString = regularFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.damageDealt + viStatsVO.equipmentDamage)
     if hasResourcePoints():
         specialPointsString = regularFormat % BigWorld.wg_getNiceNumberFormat(viStatsVO.resourceAbsorbed)
     else:
         flagsCaptured = viStatsVO.flagActions[FLAG_ACTION.CAPTURED]
         specialPointsString = regularFormat % BigWorld.wg_getNiceNumberFormat(flagsCaptured)
     return (pName,
      frags,
      vName,
      (scoreString,
       damageString,
       deathsString,
       specialPointsString))
示例#21
0
 def getFormattedStrings(self, vInfoVO, vStatsVO, viStatsVO, ctx,
                         fullPlayerName):
     format = self._findPlayerHTMLFormat(vInfoVO, ctx,
                                         self._ui.colorManager)
     unicodeStr, _ = unicode_from_utf8(fullPlayerName)
     if len(unicodeStr) > ctx.labelMaxLength:
         fullPlayerName = '{0}..'.format(
             normalized_unicode_trim(fullPlayerName,
                                     ctx.labelMaxLength - 2))
     fragsString = format % ' '
     if vStatsVO.frags or viStatsVO.equipmentKills:
         fragsString = format % str(vStatsVO.frags +
                                    viStatsVO.equipmentKills)
     pName = format % fullPlayerName
     frags = fragsString
     vName = format % vInfoVO.vehicleType.shortName
     scoreFormat = self._getHTMLString('textColorGold',
                                       self._ui.colorManager)
     regularFormat = self._getHTMLString('textColorFalloutRegular',
                                         self._ui.colorManager)
     highlightedDeaths = viStatsVO.stopRespawn
     deathsFormatStyle = 'textColorFalloutHighlightedDeaths' if highlightedDeaths else 'textColorFalloutRegularDeaths'
     deathsFormat = self._getHTMLString(deathsFormatStyle,
                                        self._ui.colorManager)
     scoreString = scoreFormat % BigWorld.wg_getNiceNumberFormat(
         viStatsVO.winPoints)
     if viStatsVO.deathCount > 0:
         deathsString = deathsFormat % BigWorld.wg_getNiceNumberFormat(
             viStatsVO.deathCount)
     else:
         deathsString = deathsFormat % ''
     damageString = regularFormat % BigWorld.wg_getNiceNumberFormat(
         viStatsVO.damageDealt + viStatsVO.equipmentDamage)
     if hasResourcePoints():
         specialPointsString = regularFormat % BigWorld.wg_getNiceNumberFormat(
             viStatsVO.resourceAbsorbed)
     else:
         flagsCaptured = viStatsVO.flagActions[FLAG_ACTION.CAPTURED]
         specialPointsString = regularFormat % BigWorld.wg_getNiceNumberFormat(
             flagsCaptured)
     return (pName, frags, vName, (scoreString, damageString, deathsString,
                                   specialPointsString))
示例#22
0
 def __init__(self, parentUI):
     Flash.__init__(self, _MARKERS_MANAGER_SWF)
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_VehicleMarker
     self.component.drawWithRestrictedViewPort = False
     self.movie.backgroundAlpha = 0
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(weakref.proxy(self))
     self.__plugins = PluginsCollection(self)
     plugins = {'equipments': _EquipmentsMarkerPlugin}
     if arena_info.hasFlags():
         plugins['flags'] = _FlagsMarkerPlugin
     if arena_info.hasRepairPoints():
         plugins['repairs'] = _RepairsMarkerPlugin
     if arena_info.hasResourcePoints():
         plugins['resources'] = _ResourceMarkerPlugin
     self.__plugins.addPlugins(plugins)
     self.__ownUI = None
     self.__parentUI = parentUI
     self.__markers = {}
示例#23
0
 def __init__(self, parentUI):
     Flash.__init__(self, _MARKERS_MANAGER_SWF)
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_VehicleMarker
     self.component.drawWithRestrictedViewPort = False
     self.movie.backgroundAlpha = 0
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(weakref.proxy(self))
     self.__plugins = PluginsCollection(self)
     plugins = {'equipments': _EquipmentsMarkerPlugin}
     if arena_info.hasFlags():
         plugins['flags'] = _FlagsMarkerPlugin
     if arena_info.hasRepairPoints():
         plugins['repairs'] = _RepairsMarkerPlugin
     if arena_info.hasResourcePoints():
         plugins['resources'] = _ResourceMarkerPlugin
     self.__plugins.addPlugins(plugins)
     self.__ownUI = None
     self.__parentUI = parentUI
     self.__markers = {}
示例#24
0
 def _addArenaExtraData(self, arenaDP):
     arena = getClientArena()
     if arena:
         arenaType = arena.arenaType
         extraData = arena.extraData or {}
         descExtra = getPrebattleFullDescription(extraData)
         arenaTypeID = getArenaTypeID()
         arenaSubType = getArenaSubTypeName(arenaTypeID)
         team = arenaDP.getNumberOfTeam()
         enemy = arenaDP.getNumberOfTeam(True)
         hasBase = isBaseExists(arenaTypeID, team)
         allyTeamName, enemyTeamName = self._battleCtx.getTeamName(team), self._battleCtx.getTeamName(enemy)
         if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES:
             winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType)
         else:
             winText = getBattleSubTypeWinText(arenaTypeID, 1 if hasBase else 2)
         if descExtra:
             battleTypeLocaleStr = descExtra
             if arena.guiType != constants.ARENA_GUI_TYPE.UNKNOWN and arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS:
                 battleTypeFrameLabel = constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType]
             else:
                 battleTypeFrameLabel = 'neutral'
         elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]:
             battleTypeLocaleStr = '#arenas:type/%s/name' % arenaSubType
             battleTypeFrameLabel = getNecessaryArenaFrameName(arenaSubType, hasBase)
         elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints():
             battleTypeFrameLabel = 'resourcePoints'
             battleTypeLocaleStr = MENU.LOADING_BATTLETYPES_RESOURCEPOINTS
         else:
             battleTypeLocaleStr = '#menu:loading/battleTypes/%d' % arena.guiType
             if arena.guiType != constants.ARENA_GUI_TYPE.UNKNOWN and arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS:
                 battleTypeFrameLabel = constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType]
             else:
                 battleTypeFrameLabel = 'neutral'
         arenaInfoData = {'mapName': arenaType.name,
          'winText': winText,
          'battleTypeLocaleStr': battleTypeLocaleStr,
          'battleTypeFrameLabel': battleTypeFrameLabel,
          'allyTeamName': allyTeamName,
          'enemyTeamName': enemyTeamName}
         self._setArenaInfo(arenaInfoData)
示例#25
0
    def _makeTeamValues(self, isEnemy, ctx, pNamesList, fragsList, vNamesList, additionalDatas, valuesHashes):
        result = super(FalloutBattleArenaController, self)._makeTeamValues(isEnemy, ctx, pNamesList, fragsList, vNamesList, additionalDatas, valuesHashes)
        specialPointsStr = ''
        damageStr = ''
        deathsStr = ''
        scoreStr = ''
        for scoreString, damageString, deathsString, specialPointsString in additionalDatas:
            scoreStr += scoreString
            deathsStr += deathsString
            damageStr += damageString
            specialPointsStr += specialPointsString

        if hasResourcePoints():
            battleType = 'resources'
        else:
            battleType = 'flags'
        result.update({'specialPointsStr': specialPointsStr,
         'damageStr': damageStr,
         'deathsStr': deathsStr,
         'scoreStr': scoreStr,
         'battleType': battleType})
        return result
示例#26
0
    def _makeTeamValues(self, isEnemy, ctx, pNamesList, fragsList, vNamesList, additionalDatas, valuesHashes):
        result = super(FalloutBattleArenaController, self)._makeTeamValues(isEnemy, ctx, pNamesList, fragsList, vNamesList, additionalDatas, valuesHashes)
        specialPointsStr = ''
        damageStr = ''
        deathsStr = ''
        scoreStr = ''
        for scoreString, damageString, deathsString, specialPointsString in additionalDatas:
            scoreStr += scoreString
            deathsStr += deathsString
            damageStr += damageString
            specialPointsStr += specialPointsString

        if hasResourcePoints():
            battleType = 'resources'
        else:
            battleType = 'flags'
        result.update({'specialPointsStr': specialPointsStr,
         'damageStr': damageStr,
         'deathsStr': deathsStr,
         'scoreStr': scoreStr,
         'battleType': battleType})
        return result
示例#27
0
 def new_setTipsInfo(self):
     DEFAULT_BATTLES_COUNT = 100
     
     arena = getClientArena()
     isFallout = arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES
     arenaDP = self._battleCtx.getArenaDP()
     if hasResourcePoints():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT
     elif hasFlags():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT
     else:
         bgUrl = ''
     if isFallout:
         self.as_setEventInfoPanelDataS({'bgUrl': bgUrl,
          'items': getHelpTextAsDicts(arena.arenaType)})
     if not self._BattleLoading__isTipInited:
         battlesCount = DEFAULT_BATTLES_COUNT
         if g_lobbyContext.getBattlesCount() is not None:
             battlesCount = g_lobbyContext.getBattlesCount()
         vType, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo()
         tipsIterator = tips.getTipsIterator(arena.guiType, battlesCount, vType, nation, vLvl)
         statusStr, tipStr = ('', '')
         if tipsIterator is not None:
             statusStr, tipStr = next(tipsIterator)
         else:
             LOG_ERROR('No required tips found')
         self.as_setTipTitleS(text_styles.highTitle(statusStr))
         
         #------win chance----
         content = text_styles.playerOnline(tipStr) 
         if Statistics.myConf['win_chance_enable'] and Statistics.okCw():
             win_chance = Statistics.getWinChance()
             if win_chance:
                 arenaTypeID = getArenaTypeID()
                 colour = '#ff0000'
                 if win_chance < 49:
                     colour = '#ff0000'
                 elif win_chance >= 49 and win_chance <= 51:
                     colour = '#ffff00'
                 elif win_chance > 51:
                     colour = '#00ff00'
                 formatz = {'win_chance':win_chance,'color':colour}
                 content += Statistics.myConf['win_chance_text'].format(**formatz)
         self.as_setTipS(content)
         #---------------------
             
         #----- table ----------
         if Statistics.myConf['table_enable'] and Statistics.okCw():
             x, y = GUI.screenResolution()      
             Statistics.table = BattleLoadingBarTable(Statistics.myConf['table_texture'])
             Statistics.table.setWidthMode('PIXEL')
             Statistics.table.setHeightMode('PIXEL')
             Statistics.table.setVerticalPositionMode('PIXEL')
             Statistics.table.setHorizontalPositionMode('PIXEL')
             Statistics.table.setHorizontalAnchor('LEFT')
             Statistics.table.setVerticalAnchor('TOP')
             Statistics.table.setWidth(Statistics.myConf['table_width'])#400
             Statistics.table.setHeight(Statistics.myConf['table_height'])#5
             Statistics.table.setPosition(eval(Statistics.myConf['table_position']))
             Statistics.table.setMaterialFx(Statistics.myConf['table_materialFX'])
             Statistics.table.setColor(eval(Statistics.myConf['table_color']))
             Statistics.table.setVisible(True)
             Statistics.table.add()
             config = {}
             config['texture'] = Statistics.myConf['table_bars_texture']
             config['width'] = Statistics.myConf['table_bars_width']
             config['height'] = Statistics.myConf['table_bars_height']
             config['position'] = eval(Statistics.myConf['table_bars_position'])
             config['delta'] = Statistics.myConf['table_bars_delta']
             config['font'] = Statistics.myConf['table_bars_font']
             config['materialFX'] = Statistics.myConf['table_bars_materialFX']
             config['color'] = (eval(Statistics.myConf['table_bars_color'][0]),eval(Statistics.myConf['table_bars_color'][1]))
             config[VEHICLE_CLASS_NAME.LIGHT_TANK] = Statistics.myConf[VEHICLE_CLASS_NAME.LIGHT_TANK]
             config[VEHICLE_CLASS_NAME.MEDIUM_TANK] = Statistics.myConf[VEHICLE_CLASS_NAME.MEDIUM_TANK]
             config[VEHICLE_CLASS_NAME.HEAVY_TANK] = Statistics.myConf[VEHICLE_CLASS_NAME.HEAVY_TANK]
             config[VEHICLE_CLASS_NAME.SPG] = Statistics.myConf[VEHICLE_CLASS_NAME.SPG]
             config[VEHICLE_CLASS_NAME.AT_SPG] = Statistics.myConf[VEHICLE_CLASS_NAME.AT_SPG]     
             config['table_bars_label'] = Statistics.myConf['table_bars_label']
             config['table_bars_odd_pos'] = Statistics.myConf['table_bars_label_pos']
             config['show_label'] = Statistics.myConf['table_bars_tankType_show']
             config['show_perc'] = Statistics.myConf['table_bars_label_show']
             config['align'] = Statistics.myConf['table_bars_align']
             Statistics.table.addBars(config)
         #---------------------
         
         self._BattleLoading__isTipInited = True
     return
示例#28
0
    def new_setTipsInfo(self):
        DEFAULT_BATTLES_COUNT = 100

        arena = getClientArena()
        isFallout = arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES
        arenaDP = self._battleCtx.getArenaDP()
        if hasResourcePoints():
            bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT
        elif hasFlags():
            bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT
        else:
            bgUrl = ''
        if isFallout:
            self.as_setEventInfoPanelDataS({
                'bgUrl':
                bgUrl,
                'items':
                getHelpTextAsDicts(arena.arenaType)
            })
        if not self._BattleLoading__isTipInited:
            battlesCount = DEFAULT_BATTLES_COUNT
            if g_lobbyContext.getBattlesCount() is not None:
                battlesCount = g_lobbyContext.getBattlesCount()
            vType, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo()
            tipsIterator = tips.getTipsIterator(arena.guiType, battlesCount,
                                                vType, nation, vLvl)
            statusStr, tipStr = ('', '')
            if tipsIterator is not None:
                statusStr, tipStr = next(tipsIterator)
            else:
                LOG_ERROR('No required tips found')
            self.as_setTipTitleS(text_styles.highTitle(statusStr))

            #------win chance----
            content = text_styles.playerOnline(tipStr)
            if Statistics.myConf['win_chance_enable'] and Statistics.okCw():
                win_chance = Statistics.getWinChance()
                if win_chance:
                    arenaTypeID = getArenaTypeID()
                    colour = '#ff0000'
                    if win_chance < 49:
                        colour = '#ff0000'
                    elif win_chance >= 49 and win_chance <= 51:
                        colour = '#ffff00'
                    elif win_chance > 51:
                        colour = '#00ff00'
                    formatz = {'win_chance': win_chance, 'color': colour}
                    content += Statistics.myConf['win_chance_text'].format(
                        **formatz)
            self.as_setTipS(content)
            #---------------------

            #----- table ----------
            if Statistics.myConf['table_enable'] and Statistics.okCw():
                x, y = GUI.screenResolution()
                Statistics.table = BattleLoadingBarTable(
                    Statistics.myConf['table_texture'])
                Statistics.table.setWidthMode('PIXEL')
                Statistics.table.setHeightMode('PIXEL')
                Statistics.table.setVerticalPositionMode('PIXEL')
                Statistics.table.setHorizontalPositionMode('PIXEL')
                Statistics.table.setHorizontalAnchor('LEFT')
                Statistics.table.setVerticalAnchor('TOP')
                Statistics.table.setWidth(
                    Statistics.myConf['table_width'])  #400
                Statistics.table.setHeight(
                    Statistics.myConf['table_height'])  #5
                Statistics.table.setPosition(
                    eval(Statistics.myConf['table_position']))
                Statistics.table.setMaterialFx(
                    Statistics.myConf['table_materialFX'])
                Statistics.table.setColor(
                    eval(Statistics.myConf['table_color']))
                Statistics.table.setVisible(True)
                Statistics.table.add()
                config = {}
                config['texture'] = Statistics.myConf['table_bars_texture']
                config['width'] = Statistics.myConf['table_bars_width']
                config['height'] = Statistics.myConf['table_bars_height']
                config['position'] = eval(
                    Statistics.myConf['table_bars_position'])
                config['delta'] = Statistics.myConf['table_bars_delta']
                config['font'] = Statistics.myConf['table_bars_font']
                config['materialFX'] = Statistics.myConf[
                    'table_bars_materialFX']
                config['color'] = (
                    eval(Statistics.myConf['table_bars_color'][0]),
                    eval(Statistics.myConf['table_bars_color'][1]))
                config[VEHICLE_CLASS_NAME.LIGHT_TANK] = Statistics.myConf[
                    VEHICLE_CLASS_NAME.LIGHT_TANK]
                config[VEHICLE_CLASS_NAME.MEDIUM_TANK] = Statistics.myConf[
                    VEHICLE_CLASS_NAME.MEDIUM_TANK]
                config[VEHICLE_CLASS_NAME.HEAVY_TANK] = Statistics.myConf[
                    VEHICLE_CLASS_NAME.HEAVY_TANK]
                config[VEHICLE_CLASS_NAME.SPG] = Statistics.myConf[
                    VEHICLE_CLASS_NAME.SPG]
                config[VEHICLE_CLASS_NAME.AT_SPG] = Statistics.myConf[
                    VEHICLE_CLASS_NAME.AT_SPG]
                config['table_bars_label'] = Statistics.myConf[
                    'table_bars_label']
                config['table_bars_odd_pos'] = Statistics.myConf[
                    'table_bars_label_pos']
                config['show_label'] = Statistics.myConf[
                    'table_bars_tankType_show']
                config['show_perc'] = Statistics.myConf[
                    'table_bars_label_show']
                config['align'] = Statistics.myConf['table_bars_align']
                Statistics.table.addBars(config)
            #---------------------

            self._BattleLoading__isTipInited = True
        return