def start(self, ui):
     self.__ui = weakref.proxy(ui)
     g_ctfManager.onFlagCapturedByVehicle += self.__onFlagCapturedByVehicle
     g_ctfManager.onFlagAbsorbed += self.__onFlagAbsorbed
     g_ctfManager.onFlagDroppedToGround += self.__onFlagDroppedToGround
     if g_ctfManager.isFlagBearer(BigWorld.player().playerVehicleID):
         self.__ui.showFlagCaptured()
 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()
Exemplo n.º 3
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()
 def start(self, ui):
     self.__ui = weakref.proxy(ui)
     player = BigWorld.player()
     self.__playerVehicleID = player.playerVehicleID
     self.__playerTeam = player.team
     self.__soundNotifications = weakref.proxy(getSoundNotifications())
     arena = player.arena
     arenaType = arena.arenaType
     self.__isTeamPlayer = self.__playerTeam in arenaType.squadTeamNumbers if isFalloutMultiTeam() else True
     g_ctfManager.onFlagCapturedByVehicle += self.__onFlagCapturedByVehicle
     g_ctfManager.onFlagAbsorbed += self.__onFlagAbsorbed
     g_ctfManager.onFlagDroppedToGround += self.__onFlagDroppedToGround
     g_ctfManager.onFlagRemoved += self.__onFlagRemoved
     if g_ctfManager.isFlagBearer(self.__playerVehicleID):
         self.__ui.showFlagCaptured()
Exemplo n.º 5
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
Exemplo n.º 6
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.__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
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
    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