def toggleHangarUI(visible): lobby = ServicesLocator.appLoader.getApp() hangar = lobby.containerManager.getView(WindowLayer.SUB_VIEW) hangar.as_setVisibleS(visible) lobby.graphicsOptimizationManager.switchOptimizationEnabled(visible) @overrideMethod(HangarCameraManager, '_HangarCameraManager__updateCameraByMouseMove') def new_updateCameraByMouseMove(base, *args, **kwargs): if config.data['UIVisible'] or not config.cameraPos or config.data[ 'currentCamPos'] == len( config.cameraPos) or not config.data['lockCamera']: base(*args, **kwargs) def setCameraLocation(settings): cfg = hangarCFG() dependency.instance(IHangarSpace).space.setCameraLocation( cfg[settings['target_pos'] + 'cam_start_target_pos'], Math.Vector3(*settings['pivot_pos']) if isinstance( settings['pivot_pos'], list) else cfg[settings['pivot_pos'] + 'cam_pivot_pos'], math.radians(settings['angles'][0]), math.radians(settings['angles'][1]), settings['dist'], None, True) analytics = Analytics(config.ID, config.version, 'UA-76792179-14')
self.dossier.clear() self.pending.clear() def userRegion(databaseID): if databaseID < 500000000: return 'ru' if databaseID < 1000000000: return 'eu' if databaseID < 2000000000: return 'na' return 'asia' g_config = ConfigInterface() analytics = Analytics(g_config.ID, g_config.version, 'UA-76792179-15') @overrideMethod(ClientArena, '_ClientArena__onVehicleListUpdate') def new__onVehicleListUpdate(base, self, *args, **kwargs): base(self, *args, **kwargs) g_config.loadStats() @overrideMethod(BattleEntry, 'beforeDelete') def new_BattleEntry_beforeDelete(base, self, *args, **kwargs): base(self, *args, **kwargs) g_config.resetStats() @overrideMethod(CompoundAppearance, '_CompoundAppearance__applyVehicleOutfit')
traceback.print_exc() print nodeName if fakeMotorDict[nodeName] in tuple( fakesDict[vehicleID][nodeName].motors): fakesDict[vehicleID][nodeName].delMotor( fakeMotorDict[nodeName]) del fakeMotorsDict[vehicleID] if vehicleID in fakesDict: del fakesDict[vehicleID] except StandardError: traceback.print_exc() print callPlace statistic_mod = Analytics(_config.ID, _config.version, 'UA-76792179-2', _config.configsDict) curSpeedsDict = {} @overrideMethod(Vehicle, 'startVisual') def new_startVisual(base, self): base(self) if self.isStarted and self.isAlive( ) and _config.data['enabled'] and _config.isLampsVisible: BigWorld.callback( 0.1, partial(lightsCreate, self.id, 'Vehicle.startVisual')) @overrideMethod(Vehicle, 'stopVisual') def new_vehicle_onLeaveWorld(base, self, *args, **kwargs): if self.isStarted:
sun_controller(isSunControlled) if _config.data['enabled']: _clear_loop() def battleKeyControl(event): global isSunControlled if checkKeys(_config.data['hotkey']) and event.isKeyDown(): isSunControlled = not isSunControlled sun_controller(isSunControlled) if isSunControlled: sendMessage(_config.i18n['UI_activSunMod']) else: sendMessage(_config.i18n['UI_deactivSunMod'], 'Red') def inj_hkKeyEvent(event): BattleApp = g_appLoader.getDefBattleApp() try: if BattleApp and _config.data['enabled']: battleKeyControl(event) except StandardError: print '%s: ERROR at inj_hkKeyEvent' % _config.ID traceback.print_exc() InputHandler.g_instance.onKeyDown += inj_hkKeyEvent InputHandler.g_instance.onKeyUp += inj_hkKeyEvent statistic_mod = Analytics(_config.ID, _config.version, 'UA-76792179-3')
self.data['toggle_key']) and event.isKeyDown(): self.displayed = not self.displayed elif self.data['mode'] == 2: self.displayed = checkKeys(self.data['toggle_key']) for vehicleID in self.__hpCache: self.setHPField(vehicleID) mod_playersHP = None try: from gui.vxBattleFlash import vxBattleFlash, vxBattleFlashAliases from gui.vxBattleFlash.events import vxEvents, BATTLE_FLASH_EVENT_ID from gui.vxBattleFlash.constants import FLASH mod_playersHP = PlayersPanelController() statistic_mod = Analytics(mod_playersHP.ID, mod_playersHP.version, 'UA-76792179-11') except ImportError: print '%(mod_ID)s: Battle Flash API (vxBattleFlash) not found. Text viewing disabled.' except StandardError: traceback.print_exc() else: @overrideMethod(ArenaVehiclesPlugin, '_ArenaVehiclesPlugin__setInAoI') def new_setInAoI(base, self, entry, isInAoI): result = base(self, entry, isInAoI) try: for vehicleID, entry2 in self._entries.iteritems(): if entry == entry2 and isInAoI: if vehicleID in mod_playersHP.vCache: break mod_playersHP.updateHealth(vehicleID)
__modID__ = '%(mod_ID)s' __date__ = '%(file_compile_date)s' from PYmodsCore import Analytics from config import g_config try: from gui.mods import mod_skinner except ImportError: pass import processor import collision statistic_mod = Analytics(g_config.ID, g_config.version, 'UA-76792179-4')
self.format(targetInf).decode('utf-8'), chanId, g_config.data['chatDelay']) for cellId in self.pingList: if cellId == CellHelper.PING_SELF: cellId = CellHelper.getPosCellId(False) elif cellId == CellHelper.PING_CAMERA: cellId = CellHelper.getPosCellId(True) g_queue.addToQueue(self.PING_DELAY, self.pingCellId, cellId) self.updateCooldown() g_queue = CommandQueue() safeFmt = SafeFormatter() g_config = ConfigInterface() statistic_mod = Analytics( g_config.ID, g_config.version, 'UA-76792179-10', [g_config.commands.keys()[g_config.data['selectedConfig']]]) def getCrosshairType(player, target): if not isTargetCorrect(player, target): return SHORTCUT_STATES.DEFAULT elif target.publicInfo.team == player.team: return SHORTCUT_STATES.ALLY else: return SHORTCUT_STATES.ENEMY def isTargetCorrect(player, target): return (target is not None and isinstance(target, Vehicle) and target.isAlive() and player is not None and isPlayerAvatar()
events = self.soundNotifications._IngameSoundNotifications__events notificationsData = _config.data['sound_notifications'] for eventName, event in events.iteritems(): if eventName in notificationsData: for category in event: event[category]['sound'] = notificationsData[eventName].get( category, event[category]['sound']) self.soundNotifications._IngameSoundNotifications__events = events return result @overrideMethod(PlayerAvatar, 'updateVehicleGunReloadTime') def updateVehicleGunReloadTime(base, self, vehicleID, timeLeft, baseTime): if ((self._PlayerAvatar__prevGunReloadTimeLeft != timeLeft and timeLeft == 0.0) and not self.guiSessionProvider.shared.vehicleState.isInPostmortem): try: if 'fx' in _config.data['sound_notifications'].get( 'gun_reloaded', {}): SoundGroups.g_instance.playSound2D( _config.data['sound_notifications']['gun_reloaded']['fx']) except StandardError: traceback.print_exc() base(self, vehicleID, timeLeft, baseTime) _config = ConfigInterface() statistic_mod = Analytics(_config.ID, _config.version, 'UA-76792179-13', _config.confList)
self.badge = g_badges[result.player.dbID]['lobby'] self.badgeIcon = style.makeBadgeIcon(self.badge) @overrideMethod(RES_ICONS, 'getBadgeIcon') def new_getBadgeIcon(base, _, size, value): if isinstance(value, int) or '_' not in value: return base(size, value) return getBadgePath(value) @overrideMethod(RES_ICONS, 'getBadgeIconBySize') def new_getBadgeIconBySize(base, _, w, h, value): if isinstance(value, int) or '_' not in value: return base(w, h, value) return getBadgePath(value) def getBadgePath(value): outcome = '../AppreciationBadges/{}.png'.format(value) normOutcome = os.path.normpath('gui/flash/' + outcome).replace( os.sep, '/') if ResMgr.openSection(normOutcome) is None: print 'WARNING: not found icon:', normOutcome traceback.print_stack() return '' return outcome else: message = 'folder not found!' badges = [] print 'AppreciationBadges v.1.0.1 by Polyacov_Yury:', message analytics = Analytics('AppreciationBadges', 'v.1.0.1', 'UA-76792179-17', badges)
newSettings = {} if self.disable: newSettings['disable'] = self.disable newSettings['remap'] = settings.get('remap', {}) loadJson(self.ID, 'settings', newSettings, self.configPath, True) def registerSettings(self): super(self.__class__, self).registerSettings() if hasattr(BigWorld, 'g_modsListApi'): kwargs = dict(id='CamoSelectorUI', name=self.i18n['UI_flash_header'], description=self.i18n['UI_flash_header_tooltip'], icon='gui/flash/CamoSelector.png', enabled=self.data['enabled'], login=False, lobby=True, callback=lambda: None if g_currentVehicle.isInBattle( ) or g_currentPreviewVehicle.isPresent() else (self.onMSAPopulate(), g_appLoader.getDefLobbyApp(). loadView(ViewLoadParams('CamoSelectorMainView')))) try: BigWorld.g_modsListApi.addModification(**kwargs) except AttributeError: BigWorld.g_modsListApi.addMod(**kwargs) self.isModAdded = True g_config = ConfigInterface() statistic_mod = Analytics(g_config.ID, g_config.version, 'UA-76792179-7', g_config.configFolders)
from PYmodsCore import Analytics from gui.Scaleform.daapi.view.battle.shared.damage_log_panel import DamageLogPanel DamageLogPanel._updateTopLog, DamageLogPanel._updateBottomLog = DamageLogPanel._updateBottomLog, DamageLogPanel._updateTopLog DamageLogPanel._addToTopLog, DamageLogPanel._addToBottomLog = DamageLogPanel._addToBottomLog, DamageLogPanel._addToTopLog analytics = Analytics('%(mod_ID)s', 'v.1.0.0 (%(file_compile_date)s)', 'UA-76792179-19') print '%(mod_ID)s v.1.0.0 (%(file_compile_date)s) by Polyacov_Yury (thx to Armagomen): initialised.'