def injectButton(self, event): if not config.data['enabled']: return if inject.g_appLoader().getDefBattleApp(): if g_gui.get_key(config.data['buttonShow']) and event.isKeyDown( ) and self.battleStarted: if config.data[ 'showOnlyLightTanks'] and Vehicle.getVehicleClassTag( self.player.getVehicleDescriptor( ).type.tags) != VEHICLE_CLASS_NAME.LIGHT_TANK: return self.status = not self.status message = config.i18n[ 'UI_message_on'] if self.status else config.i18n[ 'UI_message_off'] color = '#84DE40' if self.status else '#FFA500' inject.message(message, color) self.setVisible(self.status) if g_gui.get_key( config.buttons['buttonMark']) and event.isKeyDown(): if self.player: teamBase = self.player.guiSessionProvider.getArenaDP( ).getNumberOfTeam() teamBase -= 1 position = self.player.getOwnVehiclePosition() message = 'map: %s, base: %s, pos: %s' % ( self.mapSelected, teamBase, position) # noinspection PyProtectedMember gameplayID = self.player.arena.arenaType._ArenaType__gameplayCfg[ 'gameplayID'] print '"%s": [%s]([%s], [%s])' % ( self.mapSelected, gameplayID, position if not teamBase else '', position if teamBase else '') inject.message(message) self.createModel(position)
def insigniaScout(self, test=False): if 'scout' in insigniaMonitor.insignia: battle = inject.g_appLoader().getDefBattleApp() if battle is not None: comp = battle.containerManager.getContainer( ViewTypes.VIEW).getView() if comp is not None: # noinspection PyProtectedMember entries = comp.components['minimap'].getPlugin( 'vehicles')._entries for vehicleID in entries: if entries[vehicleID].isEnemy( ) and entries[vehicleID].isActive(): if vehicleID in self.result['Detections']: self.result['Detections'].remove(vehicleID) value = insigniaMonitor.getCondition( 'scout', 'minDetections') if value is None: return if 9 - len(self.result['Detections']) - value < 1: if not test: value += 1 else: if value < 9: insigniaMonitor.setNotAvailable('scout') return insigniaMonitor.setCondition('scout', 'minDetections', value)
def injectButton(self, event): if inject.g_appLoader().getDefBattleApp(): if g_gui.get_key( config.data['buttonChassis']) and event.isKeyDown(): self.repairChassis() if g_gui.get_key( config.data['buttonRepair']) and event.isKeyDown(): self.repairAll()
def pushButton(event): if inject.g_appLoader().getDefBattleApp(): if event.key in (Keys.KEY_F5, Keys.KEY_F6) and event.isKeyDown(): controller = MessengerEntry.g_instance.gui.channelsCtrl.getController( _OutCmdDecorator(44, messageArgs(strArg1='')).getClientID()) if controller: controller.sendMessage( config.i18n['UI_messageF5'] if event.key == Keys.KEY_F5 else config.i18n['UI_messageF6'])