Jump to content
Korean Random

DKRUBEN

User
  • Posts

    168
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by DKRUBEN

  1. Now i will be try circles color on minimap. :ok:

     

    Quote
    
    # -*- coding: utf-8 -*-
    from math import degrees
    
    import Event
    import Keys
    from constants import VISIBILITY
    from frameworks.wulf import WindowLayer
    from gui.Scaleform.daapi.view.battle.shared.minimap.component import MinimapComponent
    from gui.Scaleform.daapi.view.battle.shared.minimap.plugins import PersonalEntriesPlugin, ArenaVehiclesPlugin
    from gui.Scaleform.daapi.view.battle.shared.minimap.settings import CONTAINER_NAME, CIRCLE_TYPE, CIRCLE_STYLE, VIEW_RANGE_CIRCLES_AS3_DESCR
    from gui.Scaleform.framework import g_entitiesFactories, ViewSettings, ScopeTemplates
    from gui.Scaleform.framework.entities.BaseDAAPIComponent import BaseDAAPIComponent
    from gui.Scaleform.framework.entities.DisposableEntity import EntityState
    from gui.Scaleform.framework.entities.View import View
    from gui.Scaleform.framework.managers.loaders import SFViewLoadParams
    from gui.app_loader.settings import APP_NAME_SPACE
    from gui.battle_control import avatar_getter
    from gui.shared.personality import ServicesLocator
    from helpers import dependency
    from skeletons.gui.app_loader import GuiGlobalSpaceID
    from skeletons.gui.battle_session import IBattleSessionProvider
    
    from DriftkingsCore import DriftkingsInterface, Analytics, override, getPlayer, checkKeys, hex_to_decimal
    
    AS_INJECTOR = 'MinimapCentredViewInjector'
    AS_BATTLE = 'MinimapCentredView'
    AS_SWF = 'MinimapCentred.swf'
    
    
    class FlashMinimap(object):
    
        def __init__(self):
            self.onBattleClosed = Event.Event()
            self.onBattleLoaded = Event.Event()
            self.onAltKey = Event.Event()
    
            ServicesLocator.appLoader.onGUISpaceEntered += self.onGUISpaceEntered
            ServicesLocator.appLoader.onGUISpaceLeft += self.onGUISpaceLeft
    
        def onGUISpaceEntered(self, spaceID):
            if spaceID == GuiGlobalSpaceID.BATTLE:
                g_events.onBattleLoaded()
    
        def onGUISpaceLeft(self, spaceID):
            if spaceID == GuiGlobalSpaceID.BATTLE:
                g_events.onBattleClosed()
    
    
    g_events = FlashMinimap()
    
    
    class ConfigInterface(DriftkingsInterface):
        sessionProvider = dependency.descriptor(IBattleSessionProvider)
    
        def __init__(self):
            g_events.onBattleLoaded += self.onBattleLoaded
            self.minimapZoom = False
            super(ConfigInterface, self).__init__()
    
        def init(self):
            self.ID = '%(mod_ID)s'
            self.version = '1.1.0 (%(file_compile_date)s)'
            self.author += '_DKRuben__EU'
            self.defaultKeys = {'button': [Keys.KEY_LCONTROL]}
            self.data = {
                'enabled': True,
                'permanentMinimapDeath': False,
                'yaw': True,
                'showNames': True,
                'viewRadius': True,
                'zoomFactor': 1.3,
                'button': self.defaultKeys['button'],
                'changeColorCircles': True,
                'colorDrawCircle': '2B28D1',
                'colorMaxViewCircle': 'E02810',
                'colorMinSpottingCircle': '35DE46',
                'colorViewCircle': 'FF7FFF',
            }
    
            self.i18n = {
                'UI_description': self.ID,
                'UI_setting_permanentMinimapDeath_text': 'Permanent Minimap Death',
                'UI_setting_permanentMinimapDeath_tooltip': 'Always show the destroyed on the map',
                'UI_setting_showNames_text': 'Show Names',
                'UI_setting_showNames_tooltip': 'Display the names of destroyed tanks',
                'UI_setting_yaw_text': 'Show Hover Angles',
                'UI_setting_yaw_tooltip': 'Show Hover Angles on all vehicles where they are',
                'UI_setting_viewRadius_text': 'Real View',
                'UI_setting_viewRadius_tooltip': 'Remove the limitation of the circle of vision 445m',
                'UI_setting_button_text': 'Zoom Button',
                'UI_setting_button_tooltip': 'Hot key for zoom.',
                'UI_setting_changeColorCircles_text': 'Change Color Circles',
                'UI_setting_changeColorCircles_tooltip': 'When enabled, you can change the color of the circles on the minimap.',
                'UI_setting_colorDrawCircleCheck_text': 'Draw Range Circle',
                'UI_setting_colorDrawCircle_text': 'Default: <font color=\'#%(colorDrawCircle)s\'></font>',
                'UI_setting_colorDrawCircle_tooltip': '',
                'UI_setting_colorMaxViewCircleCheck_text': 'Max. View Range Circle',
                'UI_setting_colorMaxViewCircle_text': 'Default: <font color=\'#%(colorMaxViewCircle)s\'></font>',
                'UI_setting_colorMaxViewCircle_tooltip': '',
                'UI_setting_colorMinSpottingCircleCheck_text': 'Min. Spotting Range Circle',
                'UI_setting_colorMinSpottingCircle_text': 'Default: <font color=\'#%(colorMinSpottingCircle)s\'></font>',
                'UI_setting_colorMinSpottingCircle_tooltip': '',
                'UI_setting_colorViewCircleCheck_text': 'View Range Circle',
                'UI_setting_colorViewCircle_text': 'Default: <font color=\'#%(colorViewCircle)s\'></font>',
                'UI_setting_colorViewCircle_tooltip': '',
            }
            super(ConfigInterface, self).init()
    
        def createTemplate(self):
            xColorDrawRange = self.tb.createControl('colorDrawCircle', self.tb.types.ColorChoice)
            xColorDrawRange['text'] = self.tb.getLabel('colorDrawCircleCheck')
            xColorDrawRange['tooltip'] %= {'colorDrawCircle': self.data['colorDrawCircle']}
            xColorMaxRange = self.tb.createControl('colorMaxViewCircle', self.tb.types.ColorChoice)
            xColorMaxRange['text'] = self.tb.getLabel('colorMaxViewCircleCheck')
            xColorMaxRange['tooltip'] %= {'colorMaxViewCircle': self.data['colorMaxViewCircle']}
            xColorMinSpottingRange = self.tb.createControl('colorMinSpottingCircle', self.tb.types.ColorChoice)
            xColorMinSpottingRange['text'] = self.tb.getLabel('colorMinSpottingCircleCheck')
            xColorMinSpottingRange['tooltip'] %= {'colorMinSpottingCircle': self.data['colorMinSpottingCircle']}
            xColorViewRange = self.tb.createControl('colorViewCircle', self.tb.types.ColorChoice)
            xColorViewRange['text'] = self.tb.getLabel('colorViewCircleCheck')
            xColorViewRange['tooltip'] %= {'colorViewCircle': self.data['colorViewCircle']}
    
            return {
                'modDisplayName': self.i18n['UI_description'],
                'enabled': self.data['enabled'],
                'column1': [
                    self.tb.createControl('permanentMinimapDeath'),
                    self.tb.createControl('showNames'),
                    self.tb.createHotKey('button'),
                    self.tb.createControl('viewRadius'),
                    self.tb.createControl('yaw')
                ],
                'column2': [
                    self.tb.createControl('changeColorCircles'),
                    xColorDrawRange,
                    xColorMaxRange,
                    xColorMinSpottingRange,
                    xColorViewRange
                ]
            }
    
        @property
        def notEpicBattle(self):
            return not self.sessionProvider.arenaVisitor.gui.isInEpicRange()
    
        @property
        def xvmInstalled(self):
            try:
                import xvm_main
                return True
            except ImportError:
                return False
    
        def onHotkeyPressed(self, event):
            if not hasattr(getPlayer(), 'arena') or not self.data['enabled']:
                return
            isDown = checkKeys(self.data['button'])
            if isDown != self.minimapZoom:
                self.minimapZoom = isDown
                g_events.onAltKey(isDown)
                avatar_getter.setForcedGuiControlMode(event.isKeyDown(), enableAiming=not event.isKeyDown(), cursorVisible=event.isKeyDown())
            if not event.isKeyDown():
                return
    
        @staticmethod
        def onBattleLoaded():
            app = ServicesLocator.appLoader.getApp(APP_NAME_SPACE.SF_BATTLE)
            if app is None:
                return
            app.loadView(SFViewLoadParams(AS_INJECTOR))
    
    
    config = ConfigInterface()
    analytics = Analytics(config.ID, config.version, 'UA-121940539-1')
    
    
    class MinimapCentredInjector(View):
    
        def _populate(self):
            # noinspection PyProtectedMember
            super(MinimapCentredInjector, self)._populate()
            g_events.onBattleClosed += self.destroy
    
        def _dispose(self):
            g_events.onBattleClosed -= self.destroy
            # noinspection PyProtectedMember
            super(MinimapCentredInjector, self)._dispose()
    
        def destroy(self):
            if self.getState() != EntityState.CREATED:
                return
            super(MinimapCentredInjector, self).destroy()
    
    
    class MinimapCentredView(BaseDAAPIComponent):
        def _populate(self):
            # noinspection PyProtectedMember
            super(MinimapCentredView, self)._populate()
            g_events.onBattleClosed += self.destroy
            g_events.onAltKey += self.onAltKey
    
        def _dispose(self):
            g_events.onBattleClosed -= self.destroy
            g_events.onAltKey -= self.onAltKey
            # noinspection PyProtectedMember
            super(MinimapCentredView, self)._dispose()
    
        def destroy(self):
            if self.getState() != EntityState.CREATED:
                return
            super(MinimapCentredView, self).destroy()
    
        def onAltKey(self, pressed):
            if config.notEpicBattle and not config.xvmInstalled:
                self.flashObject.as_minimapCentered(pressed, config.data['zoomFactor'])
    
    
    g_entitiesFactories.addSettings(ViewSettings(AS_INJECTOR, MinimapCentredInjector, AS_SWF, WindowLayer.WINDOW, None, ScopeTemplates.GLOBAL_SCOPE))
    g_entitiesFactories.addSettings(ViewSettings(AS_BATTLE, MinimapCentredView, None, WindowLayer.UNDEFINED, None, ScopeTemplates.DEFAULT_SCOPE))
    
    
    class _PersonalEntriesPlugin(PersonalEntriesPlugin):
    
        def start(self):
            super(_PersonalEntriesPlugin, self).start()
            if config.data['enabled'] and config.data['yaw'] and self.__yawLimits is None:
                vInfo = self._arenaDP.getVehicleInfo()
                yawLimits = vInfo.vehicleType.turretYawLimits
                if yawLimits is not None:
                    self.__yawLimits = (degrees(yawLimits[0]), degrees(yawLimits[1]))
    
        def _calcCircularVisionRadius(self):
            if config.data['enabled'] and config.data['viewRadius']:
                vehAttrs = self.sessionProvider.shared.feedback.getVehicleAttrs()
                return vehAttrs.get('circularVisionRadius', VISIBILITY.MIN_RADIUS)
            # noinspection PyProtectedMember
            return super(_PersonalEntriesPlugin, self)._calcCircularVisionRadius()
    
        # draw range circle
        def __addDrawRangeCircle(self):
            if config.data['enabled'] and config.data['changeColorCircles']:
                if self.__circlesVisibilityState & CIRCLE_TYPE.DRAW_RANGE:
                    return
                self.__circlesVisibilityState |= CIRCLE_TYPE.DRAW_RANGE
                self._invoke(self.__circlesID, VIEW_RANGE_CIRCLES_AS3_DESCR.AS_ADD_MAX_DRAW_CIRCLE, hex_to_decimal(config.data['colorDrawCircle']), CIRCLE_STYLE.ALPHA, 565.0)
                return super(_PersonalEntriesPlugin, self).__addDrawRangeCircle()
    
        # max view range circle
        def __addMaxViewRangeCircle(self):
            if config.data['enabled'] and config.data['changeColorCircles']:
                if self.__circlesVisibilityState & CIRCLE_TYPE.MAX_VIEW_RANGE:
                    return
                self.__circlesVisibilityState |= CIRCLE_TYPE.MAX_VIEW_RANGE
                self._invoke(self.__circlesID, VIEW_RANGE_CIRCLES_AS3_DESCR.AS_ADD_MAX_VIEW_CIRCLE, hex_to_decimal(config.data['colorMaxViewCircle']), CIRCLE_STYLE.ALPHA, VISIBILITY.MAX_RADIUS)
                return super(_PersonalEntriesPlugin, self).__addMaxViewRangeCircle()
    
        # add min spotting range circle
        def __addMinSpottingRangeCircle(self):
            if config.data['enabled'] and config.data['changeColorCircles']:
                if self.__circlesVisibilityState & CIRCLE_TYPE.MIN_SPOTTING_RANGE:
                    return
                self.__circlesVisibilityState |= CIRCLE_TYPE.MIN_SPOTTING_RANGE
                self._invoke(self.__circlesID, VIEW_RANGE_CIRCLES_AS3_DESCR.AS_ADD_MIN_SPOTTING_CIRCLE, hex_to_decimal(config.data['colorMinSpottingCircle']), CIRCLE_STYLE.ALPHA, VISIBILITY.MIN_RADIUS)
                return super(_PersonalEntriesPlugin, self).__addMinSpottingRangeCircle()
    
        # view range circle
        def __addViewRangeCircle(self):
            if config.data['enabled'] and config.data['changeColorCircles']:
                if self.__circlesVisibilityState & CIRCLE_TYPE.VIEW_RANGE:
                    return
                self.__circlesVisibilityState |= CIRCLE_TYPE.VIEW_RANGE
                self._invoke(self.__circlesID, VIEW_RANGE_CIRCLES_AS3_DESCR.AS_ADD_DYN_CIRCLE, hex_to_decimal(config.data['colorViewCircle']), CIRCLE_STYLE.ALPHA, self._getViewRangeRadius())
                return super(_PersonalEntriesPlugin, self).__addViewRangeCircle()
    
    
    class _ArenaVehiclesPlugin(ArenaVehiclesPlugin):
    
        def __init__(self, *args, **kwargs):
            super(_ArenaVehiclesPlugin, self).__init__(*args, **kwargs)
            self.__showDestroyEntries = config.data['permanentMinimapDeath']
            self.__isDestroyImmediately = config.data['permanentMinimapDeath']
    
        def _showVehicle(self, vehicleID, location):
            entry = self._entries[vehicleID]
            if entry.isAlive():
                # noinspection PyProtectedMember
                super(_ArenaVehiclesPlugin, self)._showVehicle(vehicleID, location)
    
        def _hideVehicle(self, entry):
            if entry.isAlive() and entry.isActive():
                # noinspection PyProtectedMember
                super(_ArenaVehiclesPlugin, self)._hideVehicle(entry)
    
        def __setDestroyed(self, vehicleID, entry):
            self.__clearAoIToFarCallback(vehicleID)
            if entry.setAlive(False) and not entry.wasSpotted():
                entryID = entry.getID()
                self._setInAoI(entry, True)
                self.__setActive(entry, True)
                self._move(entryID, CONTAINER_NAME.DEAD_VEHICLES)
                self._invoke(entryID, 'setDead', True)
                self._invoke(entryID, self._showNames)
            else:
                self.__setActive(entry, False)
    
        @property
        def _showNames(self):
            if config.data['enabled'] and self.__showDestroyEntries and config.data['showNames']:
                return 'showVehicleName'
            return 'hideVehicleName'
    
    
    @override(MinimapComponent, '_setupPlugins')
    def new_setupPlugins(func, self, arenaVisitor):
        res = func(self, arenaVisitor)
        if config.data['enabled'] and config.data['showNames'] and config.notEpicBattle and not config.xvmInstalled:
            if config.data['permanentMinimapDeath']:
                res['vehicles'] = _ArenaVehiclesPlugin
            res['personal'] = _PersonalEntriesPlugin
        return res

     

    all credits go to PolyacovYury for the core:no1:

    • Upvote 1
    • Downvote 1
  2. fixed thx...

     

    Quote
    
    from math import degrees
    
    import Event
    import Keys
    from constants import VISIBILITY
    from frameworks.wulf import WindowLayer
    from gui.Scaleform.daapi.view.battle.shared.minimap.component import MinimapComponent
    from gui.Scaleform.daapi.view.battle.shared.minimap.plugins import PersonalEntriesPlugin, ArenaVehiclesPlugin
    from gui.Scaleform.daapi.view.battle.shared.minimap.settings import CONTAINER_NAME
    from gui.Scaleform.framework import g_entitiesFactories, ViewSettings, ScopeTemplates
    from gui.Scaleform.framework.entities.BaseDAAPIComponent import BaseDAAPIComponent
    from gui.Scaleform.framework.entities.DisposableEntity import EntityState
    from gui.Scaleform.framework.entities.View import View
    from gui.Scaleform.framework.managers.loaders import SFViewLoadParams
    from gui.app_loader.settings import APP_NAME_SPACE
    from gui.battle_control import avatar_getter
    from gui.shared.personality import ServicesLocator
    from helpers import dependency
    from skeletons.gui.app_loader import GuiGlobalSpaceID
    from skeletons.gui.battle_session import IBattleSessionProvider
    # --------------
    from gui.Scaleform.daapi.view.battle.shared.minimap.plugins import PersonalEntriesPlugin
    from gui.Scaleform.daapi.view.battle.shared.minimap import settings
    from constants import AOI
    
    from DriftkingsCore import DriftkingsInterface, Analytics, override, getPlayer, checkKeys
    
    AS_INJECTOR = 'MinimapCentredViewInjector'
    AS_BATTLE = 'MinimapCentredView'
    AS_SWF = 'MinimapCentred.swf'
    
    
    class FlashMinimap(object):
    
        def __init__(self):
            self.onBattleClosed = Event.Event()
            self.onBattleLoaded = Event.Event()
            self.onAltKey = Event.Event()
    
            ServicesLocator.appLoader.onGUISpaceEntered += self.onGUISpaceEntered
            ServicesLocator.appLoader.onGUISpaceLeft += self.onGUISpaceLeft
    
        def onGUISpaceEntered(self, spaceID):
            if spaceID == GuiGlobalSpaceID.BATTLE:
                g_events.onBattleLoaded()
    
        def onGUISpaceLeft(self, spaceID):
            if spaceID == GuiGlobalSpaceID.BATTLE:
                g_events.onBattleClosed()
    
    
    g_events = FlashMinimap()
    
    
    class ConfigInterface(DriftkingsInterface):
        sessionProvider = dependency.descriptor(IBattleSessionProvider)
    
        def __init__(self):
            g_events.onBattleLoaded += self.onBattleLoaded
            self.minimapZoom = False
            super(ConfigInterface, self).__init__()
    
        def init(self):
            self.ID = '%(mod_ID)s'
            self.version = '1.1.0 (%(file_compile_date)s)'
            self.author += '_DKRuben__EU'
            self.defaultKeys = {'button': [Keys.KEY_LCONTROL]}
            self.data = {
                'enabled': True,
                'permanentMinimapDeath': False,
                'yaw': True,
                'showNames': True,
                'viewRadius': True,
                'zoomFactor': 1.3,
                'button': self.defaultKeys['button']
            }
    
            self.i18n = {
                'UI_description': self.ID,
                'UI_setting_permanentMinimapDeath_text': 'Permanent Minimap Death',
                'UI_setting_permanentMinimapDeath_tooltip': 'Always show the destroyed on the map',
                'UI_setting_showNames_text': 'Show Names',
                'UI_setting_showNames_tooltip': 'Display the names of destroyed tanks',
                'UI_setting_yaw_text': 'Show Hover Angles',
                'UI_setting_yaw_tooltip': 'Show Hover Angles on all vehicles where they are',
                'UI_setting_viewRadius_text': 'Real View',
                'UI_setting_viewRadius_tooltip': 'Remove the limitation of the circle of vision 445m',
                'UI_setting_button_text': 'Zoom Button',
                'UI_setting_button_tooltip': 'Hot key for zoom.',
            }
            super(ConfigInterface, self).init()
    
        def createTemplate(self):
            return {
                'modDisplayName': self.i18n['UI_description'],
                'enabled': self.data['enabled'],
                'column1': [
                    self.tb.createControl('permanentMinimapDeath'),
                    self.tb.createControl('showNames'),
                    self.tb.createHotKey('button')
                ],
                'column2': [
                    self.tb.createControl('viewRadius'),
                    self.tb.createControl('yaw')
                ]}
    
        @property
        def notEpicBattle(self):
            return not self.sessionProvider.arenaVisitor.gui.isInEpicRange()
    
        @property
        def xvmInstalled(self):
            try:
                import xvm_main
                return True
            except ImportError:
                return False
    
        def onHotkeyPressed(self, event):
            if not hasattr(getPlayer(), 'arena') or not self.data['enabled']:
                return
            isDown = checkKeys(self.data['button'])
            if isDown != self.minimapZoom:
                self.minimapZoom = isDown
                g_events.onAltKey(isDown)
                avatar_getter.setForcedGuiControlMode(event.isKeyDown(), enableAiming=not event.isKeyDown(), cursorVisible=event.isKeyDown())
            if not event.isKeyDown():
                return
    
        @staticmethod
        def onBattleLoaded():
            app = ServicesLocator.appLoader.getApp(APP_NAME_SPACE.SF_BATTLE)
            if app is None:
                return
            app.loadView(SFViewLoadParams(AS_INJECTOR))
    
    
    config = ConfigInterface()
    analytics = Analytics(config.ID, config.version, 'UA-121940539-1')
    
    
    class MinimapCentredInjector(View):
    
        def _populate(self):
            # noinspection PyProtectedMember
            super(MinimapCentredInjector, self)._populate()
            g_events.onBattleClosed += self.destroy
    
        def _dispose(self):
            g_events.onBattleClosed -= self.destroy
            # noinspection PyProtectedMember
            super(MinimapCentredInjector, self)._dispose()
    
        def destroy(self):
            if self.getState() != EntityState.CREATED:
                return
            super(MinimapCentredInjector, self).destroy()
    
    
    class MinimapCentredView(BaseDAAPIComponent):
        def _populate(self):
            # noinspection PyProtectedMember
            super(MinimapCentredView, self)._populate()
            g_events.onBattleClosed += self.destroy
            g_events.onAltKey += self.onAltKey
    
        def _dispose(self):
            g_events.onBattleClosed -= self.destroy
            g_events.onAltKey -= self.onAltKey
            # noinspection PyProtectedMember
            super(MinimapCentredView, self)._dispose()
    
        def destroy(self):
            if self.getState() != EntityState.CREATED:
                return
            super(MinimapCentredView, self).destroy()
    
        def onAltKey(self, pressed):
            if config.notEpicBattle and not config.xvmInstalled:
                self.flashObject.as_minimapCentered(pressed, config.data['zoomFactor'])
    
    
    g_entitiesFactories.addSettings(ViewSettings(AS_INJECTOR, MinimapCentredInjector, AS_SWF, WindowLayer.WINDOW, None, ScopeTemplates.GLOBAL_SCOPE))
    g_entitiesFactories.addSettings(ViewSettings(AS_BATTLE, MinimapCentredView, None, WindowLayer.UNDEFINED, None, ScopeTemplates.DEFAULT_SCOPE))
    
    
    class _PersonalEntriesPlugin(PersonalEntriesPlugin):
    
        def start(self):
            super(_PersonalEntriesPlugin, self).start()
            if config.data['yaw'] and self.__yawLimits is None:
                vInfo = self._arenaDP.getVehicleInfo()
                yawLimits = vInfo.vehicleType.turretYawLimits
                if yawLimits is not None:
                    self.__yawLimits = (degrees(yawLimits[0]), degrees(yawLimits[1]))
    
        def _calcCircularVisionRadius(self):
            if config.data['viewRadius']:
                vehAttrs = self.sessionProvider.shared.feedback.getVehicleAttrs()
                return vehAttrs.get('circularVisionRadius', VISIBILITY.MIN_RADIUS)
            # noinspection PyProtectedMember
            return super(_PersonalEntriesPlugin, self)._calcCircularVisionRadius()
    
    
    class _ArenaVehiclesPlugin(ArenaVehiclesPlugin):
    
        def __init__(self, *args, **kwargs):
            super(_ArenaVehiclesPlugin, self).__init__(*args, **kwargs)
            self.__showDestroyEntries = config.data['permanentMinimapDeath']
            self.__isDestroyImmediately = config.data['permanentMinimapDeath']
    
        def _showVehicle(self, vehicleID, location):
            entry = self._entries[vehicleID]
            if entry.isAlive():
                # noinspection PyProtectedMember
                super(_ArenaVehiclesPlugin, self)._showVehicle(vehicleID, location)
    
        def _hideVehicle(self, entry):
            if entry.isAlive() and entry.isActive():
                # noinspection PyProtectedMember
                super(_ArenaVehiclesPlugin, self)._hideVehicle(entry)
    
        def __setDestroyed(self, vehicleID, entry):
            self.__clearAoIToFarCallback(vehicleID)
            if entry.setAlive(False) and not entry.wasSpotted():
                entryID = entry.getID()
                self._setInAoI(entry, True)
                self.__setActive(entry, True)
                self._move(entryID, CONTAINER_NAME.DEAD_VEHICLES)
                self._invoke(entryID, 'setDead', True)
                self._invoke(entryID, self._showNames)
            else:
                self.__setActive(entry, False)
    
        @property
        def _showNames(self):
            if self.__showDestroyEntries and config.data['showNames']:
                return 'showVehicleName'
            return 'hideVehicleName'
    
    
    @override(MinimapComponent, '_setupPlugins')
    def new_setupPlugins(func, self, arenaVisitor):
        res = func(self, arenaVisitor)
        if config.data['showNames'] and config.notEpicBattle and not config.xvmInstalled:
            if config.data['permanentMinimapDeath']:
                res['vehicles'] = _ArenaVehiclesPlugin
            res['personal'] = _PersonalEntriesPlugin
        return res

     

     

    Now i will be try circles color on minimap. :ok:

    • Upvote 1
  3. # -*- coding: utf-8 -*-
    from math import degrees
    
    import Event
    import Keys
    from Avatar import PlayerAvatar
    from constants import ARENA_GUI_TYPE
    from constants import VISIBILITY
    from frameworks.wulf import WindowLayer
    from gui import InputHandler
    from gui.Scaleform.daapi.view.battle.shared.minimap.component import MinimapComponent
    from gui.Scaleform.daapi.view.battle.shared.minimap.plugins import PersonalEntriesPlugin, ArenaVehiclesPlugin
    from gui.Scaleform.daapi.view.battle.shared.minimap.settings import CONTAINER_NAME
    from gui.Scaleform.framework import g_entitiesFactories, ViewSettings, ScopeTemplates
    from gui.Scaleform.framework.entities.BaseDAAPIComponent import BaseDAAPIComponent
    from gui.Scaleform.framework.entities.DisposableEntity import EntityState
    from gui.Scaleform.framework.entities.View import View
    from gui.Scaleform.framework.managers.loaders import SFViewLoadParams
    from gui.app_loader.settings import APP_NAME_SPACE
    from gui.shared.personality import ServicesLocator
    from helpers import dependency
    from skeletons.gui.battle_session import IBattleSessionProvider
    
    from DriftkingsCore import DriftkingsInterface, Analytics, override, checkKeys
    
    BATTLES_RANGE = {ARENA_GUI_TYPE.RANDOM, ARENA_GUI_TYPE.UNKNOWN, ARENA_GUI_TYPE.TRAINING, ARENA_GUI_TYPE.RANKED,
                     ARENA_GUI_TYPE.EPIC_RANDOM, ARENA_GUI_TYPE.EPIC_RANDOM_TRAINING, ARENA_GUI_TYPE.SORTIE_2,
                     ARENA_GUI_TYPE.FORT_BATTLE_2, ARENA_GUI_TYPE.TUTORIAL, ARENA_GUI_TYPE.EPIC_BATTLE, ARENA_GUI_TYPE.MAPBOX}
    
    
    class FlashMinimap(object):
    
        def __init__(self):
            self.setMinimap = Event.Event()
            self.onUpdate = Event.Event()
            self.onBattleClosed = Event.Event()
            self.onBattleLoaded = Event.Event()
    
    
    g_events = FlashMinimap()
    
    
    class MinimapCentredInjector(View):
    
        def _populate(self):
            # noinspection PyProtectedMember
            super(MinimapCentredInjector, self)._populate()
            g_events.onBattleClosed += self.destroy
    
        def _dispose(self):
            g_events.onBattleClosed -= self.destroy
            # noinspection PyProtectedMember
            super(MinimapCentredInjector, self)._dispose()
    
        def destroy(self):
            if self.getState() != EntityState.CREATED:
                return
            super(MinimapCentredInjector, self).destroy()
    
    
    class MinimapCentredView(BaseDAAPIComponent):
        def _populate(self):
            # noinspection PyProtectedMember
            super(MinimapCentredView, self)._populate()
            g_events.onBattleClosed += self.destroy
            # g_events.setMinimap += self.as_minimapCenteredS
            g_events.onUpdate += self._onUpdate
    
        def _dispose(self):
            g_events.onBattleClosed -= self.destroy
            g_events.onUpdate -= self._onUpdate
            # g_events.setMinimap -= self.as_minimapCenteredS
            # noinspection PyProtectedMember
            super(MinimapCentredView, self)._dispose()
    
        def _onUpdate(self, conf):
            self.as_minimapCenteredS(conf['minimapZoom'], conf['zoomFactor'])
    
        def destroy(self):
            if self.getState() != EntityState.CREATED:
                return
            super(MinimapCentredView, self).destroy()
    
        def as_minimapCenteredS(self, enabled, scale):
            if self._isDAAPIInited():
                self.flashObject.as_minimapCentered(enabled, scale)
    
    
    class ConfigInterface(DriftkingsInterface):
        sessionProvider = dependency.descriptor(IBattleSessionProvider)
    
        def __init__(self):
            self.minimapZoom = False
            super(ConfigInterface, self).__init__()
    
        def init(self):
            self.ID = '%(mod_ID)s'
            self.version = '1.1.0 (%(file_compile_date)s)'
            self.author += '_DKRuben__EU'
            self.defaultKeys = {'button': [Keys.KEY_LCONTROL]}
            self.data = {
                'enabled': True,
                'minimapZoom': True,
                'permanentMinimapDeath': False,
                'yaw': True,
                'showNames': True,
                'viewRadius': True,
                'zoomFactor': 1.3,
                'button': self.defaultKeys['button']
            }
    
            self.i18n = {
                'UI_description': self.ID,
                'UI_setting_permanentMinimapDeath_text': 'Permanent Minimap Death',
                'UI_setting_permanentMinimapDeath_tooltip': 'Always show the destroyed on the map',
                'UI_setting_showNames_text': 'Show Names',
                'UI_setting_showNames_tooltip': 'Display the names of destroyed tanks',
                'UI_setting_yaw_text': 'Show Hover Angles',
                'UI_setting_yaw_tooltip': 'Show Hover Angles on all vehicles where they are',
                'UI_setting_viewRadius_text': 'Real View',
                'UI_setting_viewRadius_tooltip': 'Remove the limitation of the circle of vision 445m',
                'UI_setting_button_text': 'Zoom Button',
                'UI_setting_button_tooltip': 'Hot key for zoom.',
                'UI_setting_minimapZoom_text': 'Minimap Zoom',
                'UI_setting_minimapZoom_tooltip': 'Enlarges the minimap when the key is pressed',
            }
            super(ConfigInterface, self).init()
    
        def createTemplate(self):
            return {
                'modDisplayName': self.i18n['UI_description'],
                'enabled': self.data['enabled'],
                'column1': [
                    self.tb.createControl('permanentMinimapDeath'),
                    self.tb.createControl('showNames'),
                    self.tb.createControl('minimapZoom'),
                    self.tb.createHotKey('button')
                ],
                'column2': [
                    self.tb.createControl('viewRadius'),
                    self.tb.createControl('yaw')
                ]}
    
        def startBattle(self):
            InputHandler.g_instance.onKeyDown += self.keyPressed
            InputHandler.g_instance.onKeyUp += self.keyPressed
    
        def endBattle(self):
            InputHandler.g_instance.onKeyDown -= self.keyPressed
            InputHandler.g_instance.onKeyUp -= self.keyPressed
    
        @property
        def notEpicBattle(self):
            return not self.sessionProvider.arenaVisitor.gui.isInEpicRange()
    
        @property
        def xvmInstalled(self):
            try:
                import xvm_main
                return True
            except ImportError:
                return False
    
        def keyPressed(self, event):
            if not self.data['enabled']:
                return
            isKeyDownTrigger = event.isKeyDown()
            if event.key in [Keys.KEY_LALT, Keys.KEY_RALT]:
                if isKeyDownTrigger:
                    self.minimapZoom = True
                if event.isKeyUp():
                    self.minimapZoom = False
                if checkKeys(self.data['button']) and isKeyDownTrigger:
                    g_events.onUpdate(self.data['minimapZoom'], self.data['zoomFactor'])
    
    
    config = ConfigInterface()
    analytics = Analytics(config.ID, config.version, 'UA-121940539-1')
    
    
    class _PersonalEntriesPlugin(PersonalEntriesPlugin):
    
        def start(self):
            super(_PersonalEntriesPlugin, self).start()
            if config.data['yaw'] and self.__yawLimits is None:
                vInfo = self._arenaDP.getVehicleInfo()
                yawLimits = vInfo.vehicleType.turretYawLimits
                if yawLimits is not None:
                    self.__yawLimits = (degrees(yawLimits[0]), degrees(yawLimits[1]))
    
        def _calcCircularVisionRadius(self):
            if config.data['viewRadius']:
                vehAttrs = self.sessionProvider.shared.feedback.getVehicleAttrs()
                return vehAttrs.get('circularVisionRadius', VISIBILITY.MIN_RADIUS)
            # noinspection PyProtectedMember
            return super(_PersonalEntriesPlugin, self)._calcCircularVisionRadius()
    
    
    class _ArenaVehiclesPlugin(ArenaVehiclesPlugin):
    
        def __init__(self, *args, **kwargs):
            super(_ArenaVehiclesPlugin, self).__init__(*args, **kwargs)
            self.__showDestroyEntries = config.data['permanentMinimapDeath']
            self.__isDestroyImmediately = config.data['permanentMinimapDeath']
    
        def _showVehicle(self, vehicleID, location):
            entry = self._entries[vehicleID]
            if entry.isAlive():
                # noinspection PyProtectedMember
                super(_ArenaVehiclesPlugin, self)._showVehicle(vehicleID, location)
    
        def _hideVehicle(self, entry):
            if entry.isAlive() and entry.isActive():
                # noinspection PyProtectedMember
                super(_ArenaVehiclesPlugin, self)._hideVehicle(entry)
    
        def __setDestroyed(self, vehicleID, entry):
            self.__clearAoIToFarCallback(vehicleID)
            if entry.setAlive(False) and not entry.wasSpotted():
                entryID = entry.getID()
                self._setInAoI(entry, True)
                self.__setActive(entry, True)
                self._move(entryID, CONTAINER_NAME.DEAD_VEHICLES)
                self._invoke(entryID, 'setDead', True)
                self._invoke(entryID, self._showNames)
            else:
                self.__setActive(entry, False)
    
        @property
        def _showNames(self):
            if self.__showDestroyEntries and config.data['showNames']:
                return 'showVehicleName'
            return 'hideVehicleName'
    
    
    @override(MinimapComponent, '_setupPlugins')
    def new_setupPlugins(func, self, arenaVisitor):
        res = func(self, arenaVisitor)
        if config.data['showNames'] and config.notEpicBattle and not config.xvmInstalled:
            if config.data['permanentMinimapDeath']:
                res['vehicles'] = _ArenaVehiclesPlugin
            res['personal'] = _PersonalEntriesPlugin
        return res
    
    
    @override(PlayerAvatar, '_PlayerAvatar__startGUI')
    def new_startGUI(func, *args):
        func(*args)
        config.startBattle()
    
    
    @override(PlayerAvatar, '_PlayerAvatar__destroyGUI')
    def new_destroyGUI(func, *args):
        config.endBattle()
        func(*args)
    
    
    def getViewSettings():
        view_settings = []
        view_settings.append(ViewSettings('MinimapCentredViewInjector', MinimapCentredInjector, 'MinimapCentred.swf', WindowLayer.WINDOW, None, ScopeTemplates.GLOBAL_SCOPE))
        view_settings.append(ViewSettings('MinimapCentredView', MinimapCentredView, None, WindowLayer.UNDEFINED, None, ScopeTemplates.DEFAULT_SCOPE))
        return view_settings
    
    
    for item in getViewSettings():
        g_entitiesFactories.addSettings(item)
    
    
    def onBattleLoaded():
        app = ServicesLocator.appLoader.getApp(APP_NAME_SPACE.SF_BATTLE)
        if app is None:
            return
        app.loadView(SFViewLoadParams('MinimapCentredViewInjector'))
    
    
    g_events.onBattleLoaded += onBattleLoaded

    what am i doing wrong?
    I'm lost.
    please a tip.
    the flash file is just fine, in python I can't call it.

  4. how to find value 0 in tank stats.
    python code.

     

    def __getAccountDossier(self):
    	dossier = self.itemsCache.items.getAccountDossier().getRandomStats()
        return dossier
    
    def _setValue(itemCD):
    	stats = self.__getAccountDossier().getVehicles().get(intCD)
        result = float(100.0 * stats.wins / stats.battlesCount if stats.battlesCount else 0) # value sup 0 don't return  battlesCount = 0
        if stats.battlesCount != 0:
    		return
        value = '%.2f' % result if result < 100 else '100'
        value = '%s' % value.rjust(5)
        self.macro['win'] = '%s%%' % str(value) # internal
       	self.macro['c:win'] = self.getColor('winRate', result) # internal

     

  5. 2020-06-07 20:25:49: XVM: eXtended Visualization Mod ( https://modxvm.com/ )
    2020-06-07 20:25:49:     XVM Version     : 8.5.4
    2020-06-07 20:25:49:     XVM Revision    : 0022
    2020-06-07 20:25:49:     XVM Branch      : master
    2020-06-07 20:25:49:     XVM Hash        : afe37a060b344a97bf9a303840a4dfe80d5cac47
    2020-06-07 20:25:49:     WoT Version     : 1.9.1.0 Common Test
    2020-06-07 20:25:49:     WoT Architecture: 32bit
    2020-06-07 20:25:49:     Current Time    : 2020-06-07 20:25:49 +0100
    2020-06-07 20:25:49: ---------------------------
    2020-06-07 20:25:49: [WARN]  Following XVM fonts installed: ['C:\\Windows/Fonts\\XVMSymbol.ttf']
    2020-06-07 20:25:49: ---------------------------
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/xvm.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/@xvm.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/minimapAlt.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/minimap.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/minimapCircles.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/minimapLines.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/minimapMapSize.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/minimapLabelsAlt.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/minimapLabelsTemplates.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/minimapLabelsData.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/hitLog.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/battle.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/colors.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/export.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/elements.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/camera.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/sounds.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/battleLabels.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/battleLabelsTemplates.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/minimapLabels.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/battleLoading.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/statisticForm.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/playersPanel.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/markers.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/markersDeadExtended.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/markersDeadNormal.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/markersAliveExtended.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/markersAliveNormal.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/squad.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/iconset.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/tooltips.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/xmqp.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/tweaks.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/userInfo.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/alpha.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/battleResults.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/texts.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/captureBar.xc
    2020-06-07 20:25:49: [JSONxLoader] load: [cfg]/default/vehicleNames.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [cfg]/default/hotkeys.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [cfg]/default/hangar.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [cfg]/default/carousel.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [cfg]/default/carouselNormal.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [cfg]/default/carouselSmall.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [cfg]/default/widgets.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [cfg]/default/widgetsTemplates.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [cfg]/default/damageLog.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [cfg]/default/login.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [cfg]/default/battleLoadingTips.xc
    2020-06-07 20:25:50: [JSONxLoader] load: [res]/l10n/en.xc
    2020-06-07 20:25:50: Config loaded. Region: CT (detected), Language: en (detected)
    2020-06-07 20:25:50: [WARN]  xvm_online: no API available for this server
    2020-06-07 20:25:57: [X:000] [XFW/XfwComponent] loadMods: Loading swf mods:
    2020-06-07 20:25:57: [X:001]   xvm_lobby/as_lobby/xvm_lobby.swf
    2020-06-07 20:25:57: [L:002] [XFW/XfwComponent] onLibLoaded: ../res_mods/mods/xfw_packages/xvm_lobby/as_lobby/xvm_lobby.swf
    2020-06-07 20:25:57: [L:003] [XVM:LOBBY] processView: login
    2020-06-07 20:25:57: [L:004] [XFW/XfwComponent] onLibLoaded: Mod loaded: xvm_lobby.swf
    2020-06-07 20:25:57: [L:005] [XFW/XfwComponent] onLibLoaded: gui/flash/battleResults.swf
    2020-06-07 20:25:57: [L:006] [XFW/XfwComponent] onLibLoaded: gui/flash/TankCarousel.swf
    2020-06-07 20:25:57: [L:007] [XFW/XfwComponent] onLibLoaded: gui/flash/nodesLib.swf
    2020-06-07 20:25:57: [L:008] [XFW/XfwComponent] onLibLoaded: gui/flash/crew.swf
    2020-06-07 20:25:57: [L:009] [XFW/XfwComponent] onLibLoaded: ../res_mods/mods/xfw_packages/xvm_lobby/as_lobby/xvm_lobby_ui.swf
    2020-06-07 20:26:16: [INFO]    HTTPS: /4.0/getToken/3da5c7dc-****-****-****-********f903/511232657
    2020-06-07 20:26:16: [INFO]    Time: 241 ms, Size: 217 (306) bytes
    2020-06-07 20:26:16: [INFO]    HTTPS: /4.0/getVersion/511232657/8.5.4%230022/500/550
    2020-06-07 20:26:16: [INFO]    Time: 296 ms, Size: 21306 (129447) bytes
    2020-06-07 20:26:16: [INFO]    HTTPS: /4.0/getServerMessage/3da5c7dc-****-****-****-********f903
    2020-06-07 20:26:16: [INFO]    Time: 260 ms, Size: 39 (13) bytes
    2020-06-07 20:26:18: [L:010] [XFW/XfwComponent] onLibLoaded: gui/flash/guiControlsLobbyBattleDynamic.swf
    2020-06-07 20:26:18: [L:011] [XFW/XfwComponent] onLibLoaded: gui/flash/guiControlsLobbyDynamic.swf
    2020-06-07 20:26:18: [L:012] [XFW/XfwComponent] onLibLoaded: gui/flash/popovers.swf
    2020-06-07 20:26:18: [L:013] [XFW/XfwComponent] onLibLoaded: gui/flash/IconLibrary.swf
    2020-06-07 20:26:18: [L:014] [XVM:LOBBY] processView: lobby
    2020-06-07 20:26:18: xvm_integrity results: incorrect!
    	extra file res_mods/mods/xfw_packages/xvm_autologin/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_battle/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_battleresults/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_contacts/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_crew/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_equip/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_export/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_hangar/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_hotfix/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_integrity/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_limits/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_main/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_online/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_ping/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_profile/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_profiler/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_sounds/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_squad/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_tankcarousel/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_techtree/__init__.py
    	extra file res_mods/mods/xfw_packages/xvm_tooltips/__init__.py
    2020-06-07 20:26:18: [L:015] [XVM:LOBBY] processView: hangar
    2020-06-07 20:26:20: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:26:20: [INFO]    HTTPS: /4.0/getStatsByNick/3da5c7dc-****-****-****-********f903/EU/_DkRuben_
    2020-06-07 20:26:20: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:26:20: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%H:%M')'
    2020-06-07 20:26:20: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%A')'
    2020-06-07 20:26:20: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%d %b %Y')'
    2020-06-07 20:26:20: [INFO]    Time: 445 ms, Size: 5981 (16808) bytes
    2020-06-07 20:26:20: [INFO]    HTTPS: /4.0/getComments/3da5c7dc-****-****-****-********f903
    2020-06-07 20:26:21: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:26:34: [L:016] as_xfw_cmd: xvm_hangar.as_update_battle_type random
    null
    2020-06-07 20:26:36: [L:017] [XVM:LOBBY] processView: profile
    2020-06-07 20:26:36: [L:018] [XFW/XfwComponent] onLibLoaded: ../res_mods/mods/xfw_packages/xvm_lobby/as_lobby/xvm_lobbyprofile_ui.swf
    2020-06-07 20:26:41: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:28:37: [L:019] [XVM:LOBBY] processView: hangar
    2020-06-07 20:28:38: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:29:18: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:29:23: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:29:40: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:29:51: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:29:51: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:29:56: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown encoding: cp65001
    arg='xvm.formatDate('%Y-%m-%d')'
    2020-06-07 20:29:57: [ERROR] Traceback (most recent call last):
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 165, in process_python_macro
        return (func(), deterministic)
      File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 158, in <lambda>
        return (lambda: func(*args), deterministic)
      File "res_mods/configs/xvm/py_macro\xvm.py", line 62, in xvm_formatDate
        formatDate = formatDate.decode('utf8').encode(_defaultlocale)
    LookupError: unknown enco

     

  6.  Correction for Dispersion Circle... :hmm:

     

    @hook(VehicleGunRotator, 'setShotPosition')
    def setShotPosition(func, self, vehicleID, shotPos, shotVec, dispersionAngle, forceValueRefresh=False):
        if config.data['enabled'] and config.data['UseServerDispersion']:
            if self.__clientMode and self.__showServerMarker:
                return func(self, vehicleID, shotPos, shotVec, dispersionAngle, forceValueRefresh)
            markerPos, markerDir, markerSize, idealMarkerSize, collData = self.__getGunMarkerPosition(shotPos, shotVec, self.__dispersionAngles)
            self._avatar.inputHandler.updateGunMarker2(markerPos, markerDir, (markerSize, idealMarkerSize), SERVER_TICK_LENGTH, collData)
            return
        func(self, vehicleID, shotPos, shotVec, dispersionAngle, forceValueRefresh)

     

×
×
  • Create New...