Advertisement
Guest User

Untitled

a guest
Mar 11th, 2014
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.41 KB | None | 0 0
  1. __version__ = 'V2.9 P2.7 W0.8.11 05.03.2014'
  2. import BigWorld
  3. import Vehicle
  4. import Math
  5. import ConfLoader
  6. import Keys
  7. CONFIG = ConfLoader.configConnect(__file__)
  8. MOD_ENABLE = True
  9. MOD_LANGUAGE = ConfLoader.configReadIntValue(CONFIG, 'SYSTEM', 'Language', 0)
  10. COLOR_ACTIVE_ENEMY = ConfLoader.configReadAColorVector4Value(CONFIG, 'VIM_TANKSRENDERMODEL', 'Color_ActiveEnemy', '$80FF0000')
  11. COLOR_PASSIVE_ENEMY = ConfLoader.configReadAColorVector4Value(CONFIG, 'VIM_TANKSRENDERMODEL', 'Color_PassiveEnemy', '$B3B3B3B3')
  12. COLOR_ACTIVE_ALLY = ConfLoader.configReadAColorVector4Value(CONFIG, 'VIM_TANKSRENDERMODEL', 'Color_ActiveAlly', '$8000FF00')
  13. Param1 = {
  14.     'key': ConfLoader.configReadBKeysValue(CONFIG, 'VIM_TANKSRENDERMODEL', 'Key_Enable', 'KEY_NUMPAD0'),
  15.     'press': False }
  16.  
  17. def isBKeysDown(BKeys):
  18.     result = True
  19.     if len(BKeys) > 1:
  20.         for key in BKeys:
  21.             if BigWorld.isKeyDown(key):
  22.                 pass
  23.             result = result
  24.             if not result:
  25.                 break
  26.                 continue
  27.     if len(BKeys) == 1:
  28.         if BigWorld.isKeyDown(BKeys[0]) and not BigWorld.isKeyDown(Keys.KEY_LSHIFT) and not BigWorld.isKeyDown(Keys.KEY_LALT) and not BigWorld.isKeyDown(Keys.KEY_LCONTROL) and not BigWorld.isKeyDown(Keys.KEY_RSHIFT) and not BigWorld.isKeyDown(Keys.KEY_RALT):
  29.             pass
  30.         result = not BigWorld.isKeyDown(Keys.KEY_RCONTROL)
  31.     else:
  32.         result = False
  33.     return result
  34.  
  35.  
  36. def dynamic_loops():
  37.     global MOD_ENABLE
  38.     if not isBKeysDown(Param1['key']) or Param1['press']:
  39.         if not MOD_ENABLE:
  40.             if MOD_LANGUAGE == 1:
  41.                 pass
  42.             1('Enemy outline: On', 'green')
  43.         elif MOD_LANGUAGE == 1:
  44.             pass
  45.        
  46.         None('Enemy outline: Off', 'green')
  47.         MOD_ENABLE = not MOD_ENABLE
  48.         Param1['press'] = True
  49.    
  50.     Param1['press'] = False
  51.     BigWorld.callback(4.58737e+018, dynamic_loops)
  52.  
  53.  
  54. def print_message(msgstr, color):
  55.     if len(msgstr) > 0:
  56.         g_windowsManager = g_windowsManager
  57.         import gui.WindowsManager
  58.         if g_windowsManager.battleWindow is not None:
  59.             if BigWorld.player() is not None:
  60.                 BigWorld.player().soundNotifications.play('chat_shortcut_common_fx')
  61.             g_windowsManager.battleWindow.call('battle.VehicleMessagesPanel.ShowMessage', [
  62.                 '0',
  63.                 msgstr,
  64.                 color])
  65.        
  66.  
  67. dynamic_loops()
  68. settings = False
  69. status = { }
  70.  
  71. def tanks_render_model():
  72.     global settings
  73.     if MOD_ENABLE:
  74.         player = BigWorld.player()
  75.         if player is not None:
  76.             if hasattr(player, 'isOnArena'):
  77.                 if player.isOnArena:
  78.                     if not settings:
  79.                         settings = True
  80.                         BigWorld.wgSetEdgeDetectColors((COLOR_PASSIVE_ENEMY, COLOR_ACTIVE_ENEMY, COLOR_ACTIVE_ALLY))
  81.                     target = BigWorld.target()
  82.                     id_base = []
  83.                     for v in BigWorld.entities.values():
  84.                         if type(v) is Vehicle.Vehicle or v.isAlive():
  85.                             id_base.append(v.id)
  86.                             if v.publicInfo['team'] is BigWorld.player().team:
  87.                                 if not target is not None and target.id == v.id or status.has_key(v.id):
  88.                                     BigWorld.wgAddEdgeDetectEntity(v, 2)
  89.                                     status[v.id] = 2
  90.                                
  91.                             elif status.has_key(v.id):
  92.                                 BigWorld.wgDelEdgeDetectEntity(v)
  93.                                 del status[v.id]
  94.                            
  95.                         elif target is not None and target.id == v.id:
  96.                             if (not status.has_key(v.id) or status.has_key(v.id)) and status[v.id] == 0:
  97.                                 BigWorld.wgDelEdgeDetectEntity(v)
  98.                                 BigWorld.wgAddEdgeDetectEntity(v, 1)
  99.                                 status[v.id] = 1
  100.                            
  101.                         elif (not status.has_key(v.id) or status.has_key(v.id)) and status[v.id] == 1:
  102.                             BigWorld.wgDelEdgeDetectEntity(v)
  103.                             BigWorld.wgAddEdgeDetectEntity(v, 0)
  104.                             status[v.id] = 0
  105.                        
  106.                     if status.has_key(v.id):
  107.                         BigWorld.wgDelEdgeDetectEntity(v)
  108.                         del status[v.id]
  109.                    
  110.                 for vid in status:
  111.                     if vid not in id_base:
  112.                         del status[vid]
  113.                         continue
  114.            
  115.        
  116.     elif settings:
  117.         settings = False
  118.         for v in BigWorld.entities.values():
  119.             if type(v) is Vehicle.Vehicle or status.has_key(v.id):
  120.                 BigWorld.wgDelEdgeDetectEntity(v)
  121.                 del status[v.id]
  122.            
  123.        
  124.  
  125.  
  126. def on_tanks_render_model():
  127.     global status, settings
  128.    
  129.     try:
  130.         player = BigWorld.player()
  131.         if player is not None and hasattr(player, 'inputHandler'):
  132.             if hasattr(player.inputHandler, 'ctrl'):
  133.                 tanks_render_model()
  134.                 return None
  135.         status = { }
  136.         settings = False
  137.     finally:
  138.         BigWorld.callback(4.59187e+018, on_tanks_render_model)
  139.  
  140.  
  141. on_tanks_render_model()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement