Example #1
0
 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 post_message(self, events):
     g_sessionProvider = BigWorld.player().guiSessionProvider
     self.format_recreate()
     for data in events:
         feedbackEvent = feedback_events.PlayerFeedbackEvent.fromDict(data)
         eventID = feedbackEvent.getType()
         if eventID in [FEEDBACK_EVENT_ID.PLAYER_SPOTTED_ENEMY, FEEDBACK_EVENT_ID.PLAYER_ASSIST_TO_KILL_ENEMY]:
             vehicleID = feedbackEvent.getTargetID()
             icon = '<img src="img://%s" width="%s" height="%s" />' % (g_sessionProvider.getArenaDP().getVehicleInfo(vehicleID).vehicleType.iconPath.replace('..', 'gui'), config.data['iconSizeX'], config.data['iconSizeY'])
             target_info = g_sessionProvider.getCtx().getPlayerFullNameParts(vID=vehicleID)
             if self.check_macros('{icons}'): self.format_str['icons'] += icon
             if self.check_macros('{names}'): self.format_str['names'] += '[%s]' % target_info[1] if target_info[1] else icon
             if self.check_macros('{vehicles}'): self.format_str['vehicles'] += '[%s]' % target_info[4] if target_info[4] else icon
             if self.check_macros('{icons_names}'): self.format_str['icons_names'] += '%s[%s]' % (icon, target_info[1]) if target_info[1] else icon
             if self.check_macros('{icons_vehicles}'): self.format_str['icons_vehicles'] += '%s[%s]' % (icon, target_info[4]) if target_info[4] else icon
             if self.check_macros('{damage}'):
                 info = getDamageInfo(feedbackEvent)
                 if info is not None and info.getType() == PERSONAL_EFFICIENCY_TYPE.ASSIST_DAMAGE:
                     self.format_str['damage'] += ' +%s' % info.getDamage()
             if self.check_macros('{full}'):
                 self.format_str['full'] += '%s[%s]' % (icon, target_info) if target_info else icon
             if eventID == FEEDBACK_EVENT_ID.PLAYER_SPOTTED_ENEMY:
                 if config.data['sound']: assist.sound(0)
                 inject.message(config.i18n['UI_message_Spotted_text'].format(**self.format_str), COLOR[config.data['messageColorSpotted']])
             else:
                 if config.data['sound']: assist.sound(1)
                 inject.message(config.i18n['UI_message_Assist_text'].format(**self.format_str), COLOR[config.data['messageColorAssist']])
 def post_message(self, events):
     g_sessionProvider = BigWorld.player().guiSessionProvider
     self.format_recreate()
     for data in events:
         feedbackEvent = feedback_events.PlayerFeedbackEvent.fromDict(data)
         eventID = feedbackEvent.getBattleEventType()
         if eventID in [BATTLE_EVENT_TYPE.SPOTTED, BATTLE_EVENT_TYPE.RADIO_ASSIST, BATTLE_EVENT_TYPE.TRACK_ASSIST, BATTLE_EVENT_TYPE.STUN_ASSIST]:
             vehicleID = feedbackEvent.getTargetID()
             icon = '<img src="img://%s" width="%s" height="%s" />' % (g_sessionProvider.getArenaDP().getVehicleInfo(vehicleID).vehicleType.iconPath.replace('..', 'gui'), config.data['iconSizeX'], config.data['iconSizeY'])
             target_info = g_sessionProvider.getCtx().getPlayerFullNameParts(vID=vehicleID)
             if self.check_macros('{icons}'): self.format_str['icons'] += icon
             if self.check_macros('{names}'): self.format_str['names'] += '[%s]' % target_info[1] if target_info[1] else icon
             if self.check_macros('{vehicles}'): self.format_str['vehicles'] += '[%s]' % target_info[4] if target_info[4] else icon
             if self.check_macros('{icons_names}'): self.format_str['icons_names'] += '%s[%s]' % (icon, target_info[1]) if target_info[1] else icon
             if self.check_macros('{icons_vehicles}'): self.format_str['icons_vehicles'] += '%s[%s]' % (icon, target_info[4]) if target_info[4] else icon
             if self.check_macros('{damage}'):
                 extra = feedbackEvent.getExtra()
                 if extra: self.format_str['damage'] += ' +%s' % extra.getDamage()
             if self.check_macros('{full}'):
                 self.format_str['full'] += '%s[%s]' % (icon, target_info) if target_info else icon
             if eventID == BATTLE_EVENT_TYPE.SPOTTED:
                 if config.data['sound']: assist.sound(0)
             else:
                 if config.data['sound']: assist.sound(1)
             text, color = self.textGenerator(eventID)
             inject.message(text, color)
 def keyPressed(event):
     if not _config.data['enabled']: return
     if g_gui.get_key(_config.data['buttonAutoMode']) and event.isKeyDown():
         vehicle = BigWorld.player().getVehicleAttached()
         if vehicle and vehicle.isAlive() and vehicle.isWheeledTech and vehicle.typeDescriptor.hasSiegeMode:
             _config.data['autoActivateWheelMode'] = not _config.data['autoActivateWheelMode']
             message = 'Wheel auto boost: %s' % ('ON' if _config.data['autoActivateWheelMode'] else 'OFF')
             inject.message(message, '#8378FC')
 def checkBattleStarted(self):
     if hasattr(self.player, 'arena') and self.player.arena.period is 3:
         self.status = config.data['showOnStartBattle']
         self.setVisible(self.status)
         if config.data['showBattleGreetings'] and self.battleStarted:
             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)
     else:
         BigWorld.callback(0.5, self.checkBattleStarted)
 def post_message(self, events):
     if not config.data['enabled']:
         return
     g_sessionProvider = BigWorld.player().guiSessionProvider
     self.format_recreate()
     for data in events:
         feedbackEvent = feedback_events.PlayerFeedbackEvent.fromDict(data)
         eventID = feedbackEvent.getBattleEventType()
         if eventID in [
                 BATTLE_EVENT_TYPE.SPOTTED, BATTLE_EVENT_TYPE.RADIO_ASSIST,
                 BATTLE_EVENT_TYPE.TRACK_ASSIST,
                 BATTLE_EVENT_TYPE.STUN_ASSIST
         ]:
             vehicleID = feedbackEvent.getTargetID()
             icon = '<img src="img://%s" width="%s" height="%s" />' % (
                 g_sessionProvider.getArenaDP().getVehicleInfo(
                     vehicleID).vehicleType.iconPath.replace('..', 'gui'),
                 config.data['iconSizeX'], config.data['iconSizeY'])
             target_info = g_sessionProvider.getCtx(
             ).getPlayerFullNameParts(vID=vehicleID)
             if self.check_macros('{icons}'):
                 self.format_str['icons'] += icon
             if self.check_macros('{names}'):
                 self.format_str[
                     'names'] += '[<b>%s</b>]' % target_info.playerName if target_info.playerName else icon
             if self.check_macros('{vehicles}'):
                 self.format_str[
                     'vehicles'] += '[<b>%s</b>]' % target_info.vehicleName if target_info.vehicleName else icon
             if self.check_macros('{icons_names}'):
                 self.format_str['icons_names'] += '%s[<b>%s</b>]' % (
                     icon, target_info.playerName
                 ) if target_info.playerName else icon
             if self.check_macros('{icons_vehicles}'):
                 self.format_str['icons_vehicles'] += '%s[<b>%s</b>]' % (
                     icon, target_info.vehicleName
                 ) if target_info.vehicleName else icon
             if self.check_macros('{damage}'):
                 extra = _createEfficiencyInfoFromFeedbackEvent(
                     feedbackEvent)
                 if extra and extra.getType(
                 ) in _AGGREGATED_DAMAGE_EFFICIENCY_TYPES:
                     self.format_str[
                         'damage'] += '<b> +%s</b>' % extra.getDamage()
             if self.check_macros('{full}'):
                 self.format_str['full'] += '%s[<b>%s</b>]' % (
                     icon, target_info) if target_info else icon
             if eventID == BATTLE_EVENT_TYPE.SPOTTED:
                 if config.data['sound']: assist.sound(0)
             else:
                 if config.data['sound']: assist.sound(1)
             text, color = self.textGenerator(eventID)
             inject.message(text, color)
 def injectButton(self, event):
     if not config.data['enabled']: return
     if g_appLoader.getDefBattleApp():
         if g_gui.get_key(config.data['button']) and event.isKeyDown():
             status = not self.settingsCore.options.getSetting(
                 settings_constants.GAME.DISABLE_BATTLE_CHAT).get()
             self.settingsCore.applySetting(
                 settings_constants.GAME.DISABLE_BATTLE_CHAT, status)
             self.settingsCore.confirmChanges(
                 self.settingsCore.applyStorages(restartApproved=False))
             inject.message(
                 config.i18n['UI_message_chatOn']
                 if status else config.i18n['UI_message_chatOff'],
                 '#FFA500' if status else '#84DE40')
Example #8
0
    def injectButton(self, event):
        if g_gui.get_key(config.data['buttonShowSplash']) and event.isKeyDown():
            self.modelSplashKeyPressed = True
            self.modelSplashVisible = not self.modelSplashVisible
            message = config.i18n['UI_artySplash_messageSplashOn'] if self.modelSplashVisible else config.i18n['UI_artySplash_messageSplashOff']
            color = '#84DE40' if self.modelSplashVisible else '#FFA500'
            inject.message(message, color)
            self.setVisible()

        if g_gui.get_key(config.data['buttonShowDot']) and event.isKeyDown():
            self.modelDotKeyPressed = True
            self.modelDotVisible = not self.modelDotVisible
            message = config.i18n['UI_artySplash_messageDotOn'] if self.modelDotVisible else config.i18n['UI_artySplash_messageDotOff']
            color = '#84DE40' if self.modelDotVisible else '#FFA500'
            inject.message(message, color)
            self.setVisible()
Example #9
0
 def post_message(self, eventID, vehicleID, value):
     if eventID in [
             _EVENT_ID.PLAYER_SPOTTED_ENEMY,
             _EVENT_ID.PLAYER_ASSIST_TO_KILL_ENEMY
     ]:
         self.format_recreate()
         icon = '<img src="img://%s" width="%s" height="%s" />' % (
             g_sessionProvider.getArenaDP().getVehicleInfo(
                 vehicleID).vehicleType.iconPath.replace('..', 'gui'),
             config.data['iconSizeX'], config.data['iconSizeY'])
         target_info = g_sessionProvider.getCtx().getPlayerFullNameParts(
             vID=vehicleID)
         if self.check_macros('{icons}'): self.format_str['icons'] += icon
         if self.check_macros('{names}'):
             self.format_str['names'] += '[%s]' % target_info[
                 1] if target_info[1] else icon
         if self.check_macros('{vehicles}'):
             self.format_str['vehicles'] += '[%s]' % target_info[
                 4] if target_info[4] else icon
         if self.check_macros('{icons_names}'):
             self.format_str['icons_names'] += '%s[%s]' % (
                 icon, target_info[1]) if target_info[1] else icon
         if self.check_macros('{icons_vehicles}'):
             self.format_str['icons_vehicles'] += '%s[%s]' % (
                 icon, target_info[4]) if target_info[4] else icon
         if self.check_macros('{damage}'):
             self.format_str['damage'] += '%s' % value
         if self.check_macros('{full}'):
             self.format_str['full'] += '%s[%s]' % (
                 icon, target_info) if target_info else icon
         if eventID == _EVENT_ID.PLAYER_SPOTTED_ENEMY:
             if config.data['sound']: assist.sound(0)
             return inject.message(
                 config.i18n['UI_message_Spotted_text'].format(
                     **self.format_str),
                 COLOR[config.data['messageColorSpotted']])
         if config.data['sound']: assist.sound(1)
         return inject.message(
             config.i18n['UI_message_Assist_text'].format(
                 **self.format_str),
             COLOR[config.data['messageColorAssist']])
 def message():
     inject.message(_config.i18n['UI_battle_activateMessage'])
 def message():
     inject.message(_config.i18n['UI_battle_activate_message'])