コード例 #1
0
ファイル: markers.py プロジェクト: webiumsk/WOT0.10.0
    def start(self):
        player = BigWorld.player()
        playerVehicleID = player.playerVehicleID
        arena = player.arena
        arenaType = arena.arenaType
        self.__playerTeam = player.team
        self.__isTeamPlayer = self.__playerTeam in arenaType.squadTeamNumbers if arena_info.getIsMultiteam(arenaType) else True
        self.__capturePoints = arenaType.flagAbsorptionPoints
        self.__spawnPoints = arenaType.flagSpawnPoints
        isFlagBearer = False
        for flagID, flagInfo in g_ctfManager.getFlags():
            vehicleID = flagInfo['vehicle']
            if vehicleID is None:
                flagState = flagInfo['state']
                if flagState == constants.FLAG_STATE.WAITING_FIRST_SPAWN:
                    self.__onFlagSpawning(flagID, flagInfo['respawnTime'])
                elif flagState in (constants.FLAG_STATE.ON_GROUND, constants.FLAG_STATE.ON_SPAWN):
                    self.__onSpawnedAtBase(flagID, flagInfo['team'], flagInfo['minimapPos'])
            elif vehicleID == playerVehicleID:
                isFlagBearer = True

        if isFlagBearer:
            self.__addCaptureMarkers()
        super(_FlagsMarkerPlugin, self).start()
        return
コード例 #2
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}]
コード例 #3
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}]
コード例 #4
0
ファイル: markers.py プロジェクト: jamesxia4/wot_client
    def start(self):
        player = BigWorld.player()
        playerVehicleID = player.playerVehicleID
        arena = player.arena
        arenaType = arena.arenaType
        self.__playerTeam = player.team
        self.__isTeamPlayer = self.__playerTeam in arenaType.squadTeamNumbers if arena_info.getIsMultiteam(
            arenaType) else True
        self.__capturePoints = arenaType.flagAbsorptionPoints
        self.__spawnPoints = arenaType.flagSpawnPoints
        isFlagBearer = False
        for flagID, flagInfo in g_ctfManager.getFlags():
            vehicleID = flagInfo['vehicle']
            if vehicleID is None:
                flagState = flagInfo['state']
                if flagState == constants.FLAG_STATE.WAITING_FIRST_SPAWN:
                    self.__onFlagSpawning(flagID, flagInfo['respawnTime'])
                elif flagState in (constants.FLAG_STATE.ON_GROUND,
                                   constants.FLAG_STATE.ON_SPAWN):
                    self.__onSpawnedAtBase(flagID, flagInfo['team'],
                                           flagInfo['minimapPos'])
            elif vehicleID == playerVehicleID:
                isFlagBearer = True

        if isFlagBearer:
            self.__addCaptureMarkers()
        super(_FlagsMarkerPlugin, self).start()
コード例 #5
0
ファイル: battle.py プロジェクト: webiumsk/WOT0.9.10
 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
コード例 #6
0
ファイル: battle_loading.py プロジェクト: webiumsk/WOT0.10.0
 def _populate(self):
     super(BattleLoading, self)._populate()
     arena = getClientArena()
     self.__isFalloutMultiTeam = getIsMultiteam()
     g_sessionProvider.addArenaCtrl(self)
     BigWorld.wg_updateColorGrading()
     BigWorld.wg_enableGUIBackground(True, False)
     self._addArenaTypeData()
     Waiting.close()
コード例 #7
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)
コード例 #8
0
 def start(self, ui):
     self.__ui = weakref.proxy(ui)
     player = BigWorld.player()
     vehicleID = player.playerVehicleID
     team = player.team
     arena = player.arena
     arenaType = arena.arenaType
     self.__isTeamPlayer = team in arenaType.squadTeamNumbers if getIsMultiteam(arenaType) else True
     g_ctfManager.onFlagCapturedByVehicle += self.__onFlagCapturedByVehicle
     g_ctfManager.onFlagAbsorbed += self.__onFlagAbsorbed
     g_ctfManager.onFlagDroppedToGround += self.__onFlagDroppedToGround
     if g_ctfManager.isFlagBearer(vehicleID):
         self.__ui.showFlagCaptured()
コード例 #9
0
 def start(self, ui):
     self.__ui = weakref.proxy(ui)
     player = BigWorld.player()
     vehicleID = player.playerVehicleID
     team = player.team
     arena = player.arena
     arenaType = arena.arenaType
     self.__isTeamPlayer = team in arenaType.squadTeamNumbers if getIsMultiteam(
         arenaType) else True
     g_ctfManager.onFlagCapturedByVehicle += self.__onFlagCapturedByVehicle
     g_ctfManager.onFlagAbsorbed += self.__onFlagAbsorbed
     g_ctfManager.onFlagDroppedToGround += self.__onFlagDroppedToGround
     if g_ctfManager.isFlagBearer(vehicleID):
         self.__ui.showFlagCaptured()
コード例 #10
0
ファイル: battle.py プロジェクト: webiumsk/WOT0.10.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)
コード例 #11
0
ファイル: markers.py プロジェクト: webiumsk/WOT0.10.0
 def addVehicleMarker(self, vProxy, vInfo, guiProps):
     vTypeDescr = vProxy.typeDescriptor
     maxHealth = vTypeDescr.maxHealth
     mProv = vProxy.model.node('HP_gui')
     isAlly = guiProps.isFriend
     speaking = False
     if GUI_SETTINGS.voiceChat:
         speaking = VoiceChatInterface.g_instance.isPlayerSpeaking(vInfo.player.accountDBID)
     hunting = VehicleActions.isHunting(vInfo.events)
     markerID = self._createVehicleMarker(isAlly, mProv)
     self.__markers[vInfo.vehicleID] = _VehicleMarker(markerID, vProxy, self.__ownUIProxy)
     battleCtx = g_sessionProvider.getCtx()
     fullName, pName, clanAbbrev, regionCode, vehShortName = battleCtx.getFullPlayerNameWithParts(vProxy.id)
     vType = vInfo.vehicleType
     squadIcon = ''
     if arena_info.getIsMultiteam() and vInfo.isSquadMan():
         teamIdx = g_sessionProvider.getArenaDP().getMultiTeamsIndexes()[vInfo.team]
         squadIconTemplate = '%s%d'
         if guiProps.name() == 'squadman':
             squadTeam = 'my'
         elif isAlly:
             squadTeam = 'ally'
         else:
             squadTeam = 'enemy'
         squadIcon = squadIconTemplate % (squadTeam, teamIdx)
     self.invokeMarker(markerID, 'init', [vType.classTag,
      vType.iconPath,
      vehShortName,
      vType.level,
      fullName,
      pName,
      clanAbbrev,
      regionCode,
      vProxy.health,
      maxHealth,
      guiProps.name(),
      speaking,
      hunting,
      guiProps.base,
      g_ctfManager.isFlagBearer(vInfo.vehicleID),
      squadIcon])
     return markerID
コード例 #12
0
ファイル: respawn_view.py プロジェクト: webiumsk/WOT-0.9.12
 def __getHelpText(self):
     arena = BigWorld.player().arena
     arenaType = arena.arenaType
     isSolo = len(list(g_sessionProvider.getArenaDP().getVehiclesIterator())) == 1
     plusStr = makeString(FALLOUT.INFOPANEL_SINGLEHELPTEXT_PLUS)
     isMultiteam = getIsMultiteam(arenaType)
     headerStr = makeHtmlString(_HTML_TEMPLATE_FALLOUT_INFO_KEY, 'header', makeString(FALLOUT.INFOPANEL_SECRETWIN_HEAD))
     additionalBlockTemplate = makeHtmlString(_HTML_TEMPLATE_FALLOUT_INFO_KEY, 'winPoints')
     costKill, costFlags, costDamage = getCosts(arenaType, isSolo, True)
     helpStr = ''
     if hasFlags(arenaType, arena.bonusType) and len(costFlags) > 0:
         costFlags = list(costFlags)[0]
         helpStr = self.__getAdditionalBlockStr(additionalBlockTemplate, FALLOUT.INFOPANEL_SINGLEHELPTEXT_WINPOINTS_FLAGCAPTURE, warning(plusStr + str(costFlags)))
         if isMultiteam and isSolo:
             helpStr = self.__getAdditionalBlockStr(additionalBlockTemplate, FALLOUT.INFOPANEL_SINGLEHELPTEXT_WINPOINTS_FLAGDESTROY, warning(plusStr + str(costFlags)))
     helpStr += self.__getAdditionalBlockStr(additionalBlockTemplate, FALLOUT.INFOPANEL_SINGLEHELPTEXT_WINPOINTS_KILL, warning(plusStr + str(costKill)))
     damageDealt, points = costDamage
     points = warning(plusStr + str(points))
     helpStr += additionalBlockTemplate % makeString(FALLOUT.INFOPANEL_SINGLEHELPTEXT_WINPOINTS_DAMAGE, points=points, damageDealt=damageDealt)
     return headerStr + helpStr
コード例 #13
0
ファイル: markers.py プロジェクト: jamesxia4/wot_client
 def addVehicleMarker(self, vProxy, vInfo, guiProps):
     vTypeDescr = vProxy.typeDescriptor
     maxHealth = vTypeDescr.maxHealth
     mProv = vProxy.model.node('HP_gui')
     isAlly = guiProps.isFriend
     speaking = False
     if GUI_SETTINGS.voiceChat:
         speaking = VoiceChatInterface.g_instance.isPlayerSpeaking(
             vInfo.player.accountDBID)
     hunting = VehicleActions.isHunting(vInfo.events)
     markerID = self.__ownUI.addMarker(
         mProv, 'VehicleMarkerAlly' if isAlly else 'VehicleMarkerEnemy')
     self.__markers[vInfo.vehicleID] = _VehicleMarker(
         markerID, vProxy, self.__ownUIProxy)
     battleCtx = g_sessionProvider.getCtx()
     fullName, pName, clanAbbrev, regionCode, vehShortName = battleCtx.getFullPlayerNameWithParts(
         vProxy.id)
     vType = vInfo.vehicleType
     squadIcon = ''
     if arena_info.getIsMultiteam() and vInfo.isSquadMan():
         teamIdx = g_sessionProvider.getArenaDP().getMultiTeamsIndexes()[
             vInfo.team]
         squadIconTemplate = '%s%d'
         if guiProps.name() == 'squadman':
             squadTeam = 'my'
         elif isAlly:
             squadTeam = 'ally'
         else:
             squadTeam = 'enemy'
         squadIcon = squadIconTemplate % (squadTeam, teamIdx)
     self.invokeMarker(markerID, 'init', [
         vType.classTag, vType.iconPath, vehShortName, vType.level,
         fullName, pName, clanAbbrev, regionCode, vProxy.health, maxHealth,
         guiProps.name(), speaking, hunting, guiProps.base,
         g_ctfManager.isFlagBearer(vInfo.vehicleID), squadIcon
     ])
     return markerID
コード例 #14
0
ファイル: Statistics.py プロジェクト: IJOL/wotmods
 def new_addVehicleMarker(self, vProxy, vInfo, guiProps):
     if not Statistics.myConf['marker_enable'] or BattleUtils.isCw():
         return old_addVehicleMarker(self, vProxy, vInfo, guiProps)
     
     #----------- original code ------------------
     vTypeDescr = vProxy.typeDescriptor
     maxHealth = vTypeDescr.maxHealth
     mProv = vProxy.model.node('HP_gui')
     isAlly = guiProps.isFriend
     speaking = False
     if GUI_SETTINGS.voiceChat:
         speaking = VoiceChatInterface.g_instance.isPlayerSpeaking(vInfo.player.accountDBID)
     hunting = VehicleActions.isHunting(vInfo.events)
     markerID = self._MarkersManager__ownUI.addMarker(mProv, 'VehicleMarkerAlly' if isAlly else 'VehicleMarkerEnemy')
     self._MarkersManager__markers[vInfo.vehicleID] = _VehicleMarker(markerID, vProxy, self._MarkersManager__ownUIProxy)
     battleCtx = g_sessionProvider.getCtx()
     fullName, pName, clanAbbrev, regionCode, vehShortName = battleCtx.getFullPlayerNameWithParts(vProxy.id)
     vType = vInfo.vehicleType
     squadIcon = ''
     if arena_info.getIsMultiteam() and vInfo.isSquadMan():
         teamIdx = g_sessionProvider.getArenaDP().getMultiTeamsIndexes()[vInfo.team]
         squadIconTemplate = '%s%d'
         if guiProps.name() == 'squadman':
             squadTeam = 'my'
         elif isAlly:
             squadTeam = 'ally'
         else:
             squadTeam = 'enemy'
         squadIcon = squadIconTemplate % (squadTeam, teamIdx)
     #----- end -------
     isAlive = vInfo.isAlive()
     dbID = vInfo.player.accountDBID
     cacheId = str(dbID) + str(isAlive)
     if Statistics.cache.has_key('marker') and Statistics.cache['marker'].has_key(cacheId):
         pName_built = Statistics.cache['marker'][cacheId]
     else:
         pr, lang, wr, bt = Statistics.getInfos(dbID)
         player_name = pName
         tank_name = vehShortName
         clan_name = clanAbbrev
         isCompatriot = Statistics.isMyCompatriot(dbID,BigWorld.player());
         formatz= Statistics.getFormat('marker',pr, wr, bt, lang, player_name, tank_name, clan_name, isAlive, isCompatriot)
         pName_built = Statistics.myConf['marker'].format(**formatz)
         if not Statistics.cache.has_key('marker'):
             Statistics.cache['marker'] = {}
         Statistics.cache['marker'][cacheId] = pName_built
     
     #----------- original code ------------------
     self.invokeMarker(markerID, 'init', [vType.classTag,
      vType.iconPath,
      vehShortName,
      vType.level,
      fullName,
      pName_built,
      clanAbbrev,
      regionCode,
      vProxy.health,
      maxHealth,
      guiProps.name(),
      speaking,
      hunting,
      guiProps.base,
      g_ctfManager.isFlagBearer(vInfo.vehicleID),
      squadIcon])
     return markerID
コード例 #15
0
ファイル: Statistics.py プロジェクト: whenisee/wotmods
    def new_addVehicleMarker(self, vProxy, vInfo, guiProps):
        if not Statistics.myConf['marker_enable'] or BattleUtils.isCw():
            return old_addVehicleMarker(self, vProxy, vInfo, guiProps)

        #----------- original code ------------------
        vTypeDescr = vProxy.typeDescriptor
        maxHealth = vTypeDescr.maxHealth
        mProv = vProxy.model.node('HP_gui')
        isAlly = guiProps.isFriend
        speaking = False
        if GUI_SETTINGS.voiceChat:
            speaking = VoiceChatInterface.g_instance.isPlayerSpeaking(
                vInfo.player.accountDBID)
        hunting = VehicleActions.isHunting(vInfo.events)
        markerID = self._MarkersManager__ownUI.addMarker(
            mProv, 'VehicleMarkerAlly' if isAlly else 'VehicleMarkerEnemy')
        self._MarkersManager__markers[vInfo.vehicleID] = _VehicleMarker(
            markerID, vProxy, self._MarkersManager__ownUIProxy)
        battleCtx = g_sessionProvider.getCtx()
        fullName, pName, clanAbbrev, regionCode, vehShortName = battleCtx.getFullPlayerNameWithParts(
            vProxy.id)
        vType = vInfo.vehicleType
        squadIcon = ''
        if arena_info.getIsMultiteam() and vInfo.isSquadMan():
            teamIdx = g_sessionProvider.getArenaDP().getMultiTeamsIndexes()[
                vInfo.team]
            squadIconTemplate = '%s%d'
            if guiProps.name() == 'squadman':
                squadTeam = 'my'
            elif isAlly:
                squadTeam = 'ally'
            else:
                squadTeam = 'enemy'
            squadIcon = squadIconTemplate % (squadTeam, teamIdx)
        #----- end -------
        isAlive = vInfo.isAlive()
        dbID = vInfo.player.accountDBID
        cacheId = str(dbID) + str(isAlive)
        if Statistics.cache.has_key(
                'marker') and Statistics.cache['marker'].has_key(cacheId):
            pName_built = Statistics.cache['marker'][cacheId]
        else:
            pr, lang, wr, bt = Statistics.getInfos(dbID)
            player_name = pName
            tank_name = vehShortName
            clan_name = clanAbbrev
            isCompatriot = Statistics.isMyCompatriot(dbID, BigWorld.player())
            formatz = Statistics.getFormat('marker', pr, wr, bt, lang,
                                           player_name, tank_name, clan_name,
                                           isAlive, isCompatriot)
            pName_built = Statistics.myConf['marker'].format(**formatz)
            if not Statistics.cache.has_key('marker'):
                Statistics.cache['marker'] = {}
            Statistics.cache['marker'][cacheId] = pName_built

        #----------- original code ------------------
        self.invokeMarker(markerID, 'init', [
            vType.classTag, vType.iconPath, vehShortName, vType.level,
            fullName, pName_built, clanAbbrev, regionCode, vProxy.health,
            maxHealth,
            guiProps.name(), speaking, hunting, guiProps.base,
            g_ctfManager.isFlagBearer(vInfo.vehicleID), squadIcon
        ])
        return markerID