Example #1
0
 def __changeColor(self, diff):
     if 'isColorBlind' not in diff:
         return
     cType = 'colorBlind' if diff['isColorBlind'] else 'common'
     colors = self.__colors[cType]
     BigWorld.wgSetEdgeDetectColors(
         (colors['self'], colors['enemy'], colors['friend']))
    def ally_silouhette(self):
        if self.__enableRenderModel:
            try:
                BigWorld.wgSetEdgeDetectColors((self.__color, self.__enemyhigh, self.__allyhigh))
                player = BigWorld.player()
                if player is not None:
                    if hasattr(player, 'isOnArena'):
                        curCtrl = getattr(getattr(BigWorld.player(), 'inputHandler', None), 'ctrl', None)
                        if player.isOnArena:
                            for v in BigWorld.entities.values():
                                if isinstance(v, Vehicle):
                                    if v.isAlive() and v.isStarted:
                                        if v.publicInfo['team'] is BigWorld.player().team:
                                            target = BigWorld.target()
                                            if BigWorld.entity(BigWorld.player().playerVehicleID) is not None and BigWorld.entity(v.id) is not None:
                                                distance = (BigWorld.entity(BigWorld.player().playerVehicleID).position - BigWorld.entity(v.id).position).length
                                            else:
                                                distance = 1
                                            if target is not None and target.id == v.id:
                                                BigWorld.wgDelEdgeDetectEntity(v)
                                                BigWorld.wgAddEdgeDetectEntity(v, 2, False)
                                            elif int(v.id) != int(BigWorld.player().playerVehicleID) and distance <= self.__distancevalue or self.__sniperonly == True and not isinstance(curCtrl, SniperControlMode):
                                                BigWorld.wgDelEdgeDetectEntity(v)
                                            elif int(v.id) == int(BigWorld.player().playerVehicleID):
                                                continue
                                            else:
                                                BigWorld.wgDelEdgeDetectEntity(v)
                                                BigWorld.wgAddEdgeDetectEntity(v, 0, False)
                                    else:
                                        BigWorld.wgDelEdgeDetectEntity(v)

            except TypeError as err:
                print ('[ally_silouhette] Error: ', err)

        return
Example #3
0
def __changeColor(base, diff):
    if 'isColorBlind' not in diff:
        return
    cType = 'colorBlind' if diff['isColorBlind'] else 'common'
    isHangar = isinstance(BigWorld.player(), PlayerAccount)
    colors = g_instance._EdgeDetectColorController__colors[cType]

    if isSquad:
        friend = colorVector(
            config.get('colors/system/squadman_alive', '#FFB964'),
            colors['friend'])
        enemy = colorVector(config.get('colors/system/enemy_alive', '#2C9AFF'),
                            colors['enemy'])
    elif isTeamKill:
        currentColor = config.get('colors/system/teamKiller_alive', '#00EAFF')
        friend = colorVector(currentColor, colors['friend'])
        enemy = colorVector(currentColor, colors['enemy'])
    else:
        friend = colorVector(config.get('colors/system/ally_alive', '#96FF00'),
                             colors['friend'])
        enemy = colorVector(config.get('colors/system/enemy_alive', '#2C9AFF'),
                            colors['enemy'])

    colorsSet = (colors['hangar'] if isHangar else colors['self'], enemy,
                 friend, colors['flag'])
    BigWorld.wgSetEdgeDetectColors(colorsSet)
 def view_edge(self):
     if hasattr(self.autoaim_vehicle, 'appearance') and hasattr(self.autoaim_vehicle, 'model') and self.autoaim_vehicle.isAlive():
         BigWorld.wgDelEdgeDetectEntity(self.autoaim_vehicle)
         if BigWorld.wg_collideSegment(BigWorld.player().spaceID, self.autoaim_vehicle.appearance.compoundModel.position, BigWorld.entity(BigWorld.player().playerVehicleID).appearance.compoundModel.position, False) is None:
             BigWorld.wgSetEdgeDetectColors((Math.Vector4(self._autoaim_def), Math.Vector4(self._enemy), Math.Vector4(self._friend), Math.Vector4(self._autoaim)))
             BigWorld.wgAddEdgeDetectEntity(self.autoaim_vehicle, 3, 0)
     self.view_edge_callback = BigWorld.callback(0.5, self.view_edge)
     return
Example #5
0
 def __changeColor(self, diff):
     if 'isColorBlind' not in diff:
         return
     cType = 'colorBlind' if diff['isColorBlind'] else 'common'
     isHangar = isinstance(BigWorld.player(), PlayerAccount)
     colors = self.__colors[cType]
     colorsSet = (colors['hangar'] if isHangar else colors['self'],
                  colors['enemy'], colors['friend'], colors['flag'])
     BigWorld.wgSetEdgeDetectColors(colorsSet)
 def __changeColor(self, diff):
     if 'isColorBlind' not in diff:
         return
     cType = 'colorBlind' if diff['isColorBlind'] else 'common'
     colors = self.__colors[cType]
     BigWorld.wgSetEdgeDetectColors((colors['self'],
      colors['enemy'],
      colors['friend'],
      colors['flag']))
 def __changeColor(self, diff):
     if 'isColorBlind' not in diff:
         return
     cType = 'colorBlind' if diff['isColorBlind'] else 'common'
     isHangar = isinstance(BigWorld.player(), PlayerAccount)
     colors = self.__colors[cType]
     colorsSet = (colors['hangar'] if isHangar else colors['self'],
      colors['enemy'],
      colors['friend'],
      colors['flag'])
     BigWorld.wgSetEdgeDetectColors(colorsSet)
Example #8
0
 def __changeColor(self, diff):
     if 'isColorBlind' not in diff:
         return
     cType = 'colorBlind' if diff['isColorBlind'] else 'common'
     isHangar = isinstance(BigWorld.player(), PlayerAccount)
     isFestivityHangar = isHangar and self._festivityController.isEnabled()
     colors = self.__colors[cType]
     colorsSet = (colors['hangar'] if isHangar else colors['self'],
                  colors['enemy'], colors['friend'],
                  self._festivityController.getHangarEdgeColor()
                  if isFestivityHangar else colors['flag'])
     BigWorld.wgSetEdgeDetectColors(colorsSet)
Example #9
0
 def view_edge(self):
     if hasattr(self.autoaim_vehicle, 'appearance') and hasattr(
             self.autoaim_vehicle,
             'model') and self.autoaim_vehicle.isAlive():
         BigWorld.wgDelEdgeDetectEntity(self.autoaim_vehicle)
         if BigWorld.wg_collideSegment(
                 BigWorld.player().spaceID, self.autoaim_vehicle.appearance.
                 modelsDesc['gun']['model'].position,
                 BigWorld.entity(
                     BigWorld.player().playerVehicleID).appearance.
                 modelsDesc['gun']['model'].position, False) is None:
             BigWorld.wgSetEdgeDetectColors(
                 (Math.Vector4(self._autoaim_def),
                  Math.Vector4(self._enemy), Math.Vector4(self._friend),
                  Math.Vector4(self._autoaim)))
             BigWorld.wgAddEdgeDetectEntity(self.autoaim_vehicle, 3, 0)
     self.view_edge_callback = BigWorld.callback(0.5, self.view_edge)
 def hide_edge(self):
     if hasattr(self.autoaim_vehicle, 'appearance'):
         BigWorld.wgDelEdgeDetectEntity(self.autoaim_vehicle)
     BigWorld.wgSetEdgeDetectColors((Math.Vector4(self._autoaim_def), Math.Vector4(self._enemy_def), Math.Vector4(self._friend_def), Math.Vector4(self._flag_def)))
Example #11
0
def addEdge(vehicle):
    if isinstance(vehicle, Vehicle):
        if vehicle.isStarted and not vehicle.isPlayer and vehicle.isAlive():
            if vehicle.publicInfo['team'] is not BigWorld.player().team:
                BigWorld.wgSetEdgeDetectColors((Math.Vector4(0.5, 0.5, 0.5, 1), Math.Vector4(1.0, 0.07, 0.027, 1), Math.Vector4(0.488, 0.839, 0.023, 1), Math.Vector4(0.9, 0.8, 0.1, 1)))
                BigWorld.wgAddEdgeDetectEntity(vehicle, 3, 2, False)
Example #12
0
 def hide_edge(self):
     if hasattr(self.autoaim_vehicle, 'appearance'):
         BigWorld.wgDelEdgeDetectEntity(self.autoaim_vehicle)
     BigWorld.wgSetEdgeDetectColors(
         (Math.Vector4(self._autoaim_def), Math.Vector4(self._enemy_def),
          Math.Vector4(self._friend_def), Math.Vector4(self._flag_def)))