Пример #1
0
 def __init__(self, mode, offset):
     Flash.__init__(self, 'crosshair_panel_{0:>s}.swf'.format(mode),
                    self.__FLASH_CLASS)
     self._posX = 0
     self._posY = 0
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.movie.backgroundAlpha = 0
     self._offset = offset
     self._isLoaded = False
     self.mode = mode
     self.__timeInterval = _TimeInterval(Aim._UPDATE_INTERVAL, '_update',
                                         weakref.proxy(self))
     from account_helpers.settings_core.SettingsCore import g_settingsCore
     self.settingsCore = weakref.proxy(g_settingsCore)
     self.__aimSettings = None
     self.__isColorBlind = self.settingsCore.getSetting('isColorBlind')
     self.settingsCore.interfaceScale.onScaleChanged += self.__refreshScale
     self.settingsCore.interfaceScale.onScaleChanged += self.onRecreateDevice
     self.__refreshScale(self.settingsCore.interfaceScale.get())
     self._reloadingHndl = getReloadingHandler()
Пример #2
0
 def __init__(self, swf):
     Flash.__init__(self, swf)
     self.addFsCallbacks({
         'WoTQuit': self.onQuit,
         'WoTLogoff': self.onLogoff
     })
     self.afterCreate()
Пример #3
0
 def __createFlashIfNeeded(self):
     if self.__flashObject is None:
         self.__flashObject = Flash(
             _LOGITECH_SWF_COLORED) if self.__isColored else Flash(
                 _LOGITECH_SWF_MONO)
         self.__flashObject.movie.wg_outputToLogitechLcd = True
     return
Пример #4
0
 def __init__(self, isVictory):
     Flash.__init__(self,
                    'Victory.swf' if isVictory else 'tutorialDefeat.swf',
                    path=SCALEFORM_SWF_PATH_V3)
     self._displayRoot = self.getMember('root.main')
     if self._displayRoot is not None:
         self._displayRoot.resync()
     return
Пример #5
0
 def __init__(self):
     Flash.__init__(self, self.__SWF_FILE_NAME, self.__FLASH_CLASS, [self.__FLASH_MC_NAME])
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = 0.0
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
Пример #6
0
 def __init__(self, component = None):
     Flash.__init__(self, 'gameLoading.swf', path=SCALEFORM_SWF_PATH_V3)
     self._displayRoot = self.getMember('root.main')
     if self._displayRoot is not None:
         self._displayRoot.resync()
         self._displayRoot.setLocale(getClientOverride())
         self._displayRoot.setVersion(getFullClientVersion())
         (width, height,) = GUI.screenResolution()
         self._displayRoot.updateStage(width, height)
Пример #7
0
 def __init__(self):
     Flash.__init__(self, SWF_FILE_NAME, self.__FLASH_CLASS, self.__FLASH_ARGS, self.__FLASH_PATH)
     self.component.wg_inputKeyMode = 2
     self.component.drawWithRestrictedViewPort = False
     self.movie.backgroundAlpha = 0
     self.__parentUI = weakref.proxy(g_appLoader.getDefBattleApp())
     self.__parentUIcomp = self.__parentUI.component
     self.__ownUI = None
     return
Пример #8
0
 def __init__(self, isColored, width, height):
     swf = 'keyboard.swf' if isColored else 'keyboardMono.swf'
     Flash.__init__(self, swf)
     EventSystemEntity.__init__(self)
     self.movie.wg_outputToLogitechLcd = True
     self.addListener(events.ShowViewEvent.SHOW_LOGIN, self.__showLogoScreen, EVENT_BUS_SCOPE.GLOBAL)
     self.addListener(events.ShowViewEvent.SHOW_LOBBY, self.__showStatsScreen, EVENT_BUS_SCOPE.GLOBAL)
     self.addListener(events.LoadEvent.LOAD_BATTLE_LOADING, self.__showBattleLoadingScreen, EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.LoadEvent.LOAD_TUTORIAL_LOADING, self.__showBattleLoadingScreen, EVENT_BUS_SCOPE.LOBBY)
Пример #9
0
 def __init__(self, swfFile, finishCallback=None):
     Flash.__init__(self, swfFile, path=SCALEFORM_SWF_PATH_V3)
     self._displayRoot = self.getMember('root.main')
     self.__finishCallback = finishCallback
     if self._displayRoot is not None:
         self._displayRoot.resync()
         g_guiResetters.add(self.onUpdateStage)
         self.onUpdateStage()
     return
 def __init__(self):
     Flash.__init__(self, MTVconfig['spotIndicatorSWF'], self.__FLASH_CLASS, [self.__FLASH_MC_NAME])
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = 0.0
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.flashSize = self.__FLASH_SIZE
Пример #11
0
 def __init__(self, isColored, width, height):
     swf = 'keyboard.swf' if isColored else 'keyboardMono.swf'
     Flash.__init__(self, swf)
     EventSystemEntity.__init__(self)
     self.movie.wg_outputToLogitechLcd = True
     self.addListener(VIEW_ALIAS.LOGIN, self.__showLogoScreen, EVENT_BUS_SCOPE.GLOBAL)
     self.addListener(VIEW_ALIAS.LOBBY, self.__showStatsScreen, EVENT_BUS_SCOPE.GLOBAL)
     self.addListener(VIEW_ALIAS.BATTLE_LOADING, self.__showBattleLoadingScreen, EVENT_BUS_SCOPE.LOBBY)
     self.addListener(VIEW_ALIAS.TUTORIAL_LOADING, self.__showBattleLoadingScreen, EVENT_BUS_SCOPE.LOBBY)
     connectionManager.onDisconnected += self.__onDisconnect
Пример #12
0
 def __init__(self, component=None):
     Flash.__init__(self, 'gameLoading.swf', path=SCALEFORM_SWF_PATH_V3)
     self._displayRoot = self.getMember('root.main')
     if self._displayRoot is not None:
         self._displayRoot.resync()
         self._displayRoot.setLocale(getClientOverride())
         self._displayRoot.setVersion(getClientVersion())
         width, height = GUI.screenResolution()
         self._displayRoot.updateStage(width, height)
     return
Пример #13
0
 def __init__(self):
     Flash.__init__(self, self.__SWF_FILE_NAME, self.__FLASH_CLASS,
                    [self.__FLASH_MC_NAME])
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = 0.0
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.flashSize = self.__FLASH_SIZE
Пример #14
0
 def __init__(self, component = None):
     Flash.__init__(self, 'gameLoading.swf', path=SCALEFORM_SWF_PATH_V3)
     self._displayRoot = self.getMember('root.main')
     if self._displayRoot is not None:
         self._displayRoot.resync()
         self._displayRoot.setLocale(getClientOverride())
         self._displayRoot.setVersion(getFullClientVersion())
         if constants.IS_KOREA:
             self._displayRoot.setInfo(MENU.LOADING_GAMEINFO)
         g_guiResetters.add(self.onUpdateStage)
         self.onUpdateStage()
Пример #15
0
 def __init__(self, component=None):
     Flash.__init__(self, 'gameLoading.swf', path=SCALEFORM_SWF_PATH_V3)
     self._displayRoot = self.getMember('root.main')
     if self._displayRoot is not None:
         self._displayRoot.resync()
         self._displayRoot.setLocale(getClientOverride())
         self._displayRoot.setVersion(getFullClientVersion())
         if constants.IS_KOREA:
             self._displayRoot.setInfo(MENU.LOADING_GAMEINFO)
         g_guiResetters.add(self.onUpdateStage)
         self.onUpdateStage()
Пример #16
0
 def __init__(self, hitsCount):
     names = tuple(map(lambda i: _DAMAGE_INDICATOR_MC_NAME.format(i), xrange(hitsCount)))
     Flash.__init__(self, _DAMAGE_INDICATOR_SWF, _DAMAGE_INDICATOR_COMPONENT, (names,))
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = 0.0
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.active(True)
Пример #17
0
 def __init__(self, isColored, width, height):
     swf = 'keyboard.swf' if isColored else 'keyboardMono.swf'
     Flash.__init__(self, swf)
     EventSystemEntity.__init__(self)
     self.movie.wg_outputToLogitechLcd = True
     self.addListener(events.ShowViewEvent.SHOW_LOGIN,
                      self.__showLogoScreen, EVENT_BUS_SCOPE.GLOBAL)
     self.addListener(events.ShowViewEvent.SHOW_LOBBY,
                      self.__showStatsScreen, EVENT_BUS_SCOPE.GLOBAL)
     self.addListener(events.LoadEvent.LOAD_BATTLE_LOADING,
                      self.__showBattleLoadingScreen, EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.LoadEvent.LOAD_TUTORIAL_LOADING,
                      self.__showBattleLoadingScreen, EVENT_BUS_SCOPE.LOBBY)
Пример #18
0
 def __init__(self):
     Flash.__init__(self, self.__SWF_FILE_NAME, self.__FLASH_CLASS, [self.__FLASH_MC_NAME])
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = 0.0
     self.movie.scaleMode = 'NoScale'
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.flashSize = self.__FLASH_SIZE
     self.component.relativeRadius = 0.5
     self.__dObject = getattr(self.movie, self.__FLASH_MC_NAME, None)
Пример #19
0
 def __init__(self, hitsCount):
     names = tuple(
         map(lambda i: _DAMAGE_INDICATOR_MC_NAME.format(i),
             xrange(hitsCount)))
     Flash.__init__(self, _DAMAGE_INDICATOR_SWF,
                    _DAMAGE_INDICATOR_COMPONENT, (names, ))
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = 0.0
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.active(True)
Пример #20
0
 def __init__(self):
     Flash.__init__(self, self.__SWF_FILE_NAME, self.__FLASH_CLASS,
                    [self.__FLASH_MC_NAME])
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = 0.0
     self.movie.scaleMode = 'NoScale'
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.flashSize = self.__FLASH_SIZE
     self.component.relativeRadius = 0.5
     self.__dObject = getattr(self.movie, self.__FLASH_MC_NAME, None)
Пример #21
0
 def __init__(self, parentUI, flash_name):
     Flash.__init__(self, flash_name)
     self.parentUI = parentUI
     self.movie.backgroundAlpha = 0.0
     self.component.wg_inputKeyMode = 2
     self.component.position.z = 0.5
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.flashSize = GUI.screenResolution()
     self.text = {}
     self.shadow = {}
     self.background = {}
Пример #22
0
 def __init__(self, isColored, width, height):
     swf = 'keyboard.swf' if isColored else 'keyboardMono.swf'
     Flash.__init__(self, swf)
     EventSystemEntity.__init__(self)
     self.movie.wg_outputToLogitechLcd = True
     self.addListener(VIEW_ALIAS.LOGIN, self.__showLogoScreen,
                      EVENT_BUS_SCOPE.GLOBAL)
     self.addListener(VIEW_ALIAS.LOBBY, self.__showStatsScreen,
                      EVENT_BUS_SCOPE.GLOBAL)
     self.addListener(VIEW_ALIAS.BATTLE_LOADING,
                      self.__showBattleLoadingScreen, EVENT_BUS_SCOPE.LOBBY)
     self.addListener(VIEW_ALIAS.TUTORIAL_LOADING,
                      self.__showBattleLoadingScreen, EVENT_BUS_SCOPE.LOBBY)
     connectionManager.onDisconnected += self.__onDisconnect
Пример #23
0
 def __init__(self, parentUI, flash_name):
     Flash.__init__(self, flash_name)
     self.parentUI = parentUI
     self.movie.backgroundAlpha = 0.0
     self.component.wg_inputKeyMode = 2
     self.component.position.z = 0.5
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.flashSize = GUI.screenResolution()
     self.text = {}
     self.shadow = {}
     self.background = {}
Пример #24
0
 def __init__(self, mode, offset):
     Flash.__init__(self, 'crosshair_panel_{0:>s}.swf'.format(mode), self.__FLASH_CLASS)
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.movie.backgroundAlpha = 0
     self.flashSize = GUI.screenResolution()
     self._offset = offset
     self._isLoaded = False
     self.mode = mode
     self.__timeInterval = _TimeInterval(Aim._UPDATE_INTERVAL, '_update', weakref.proxy(self))
     self.__isColorBlind = AccountSettings.getSettings('isColorBlind')
Пример #25
0
 def __init__(self, config):
     self.config = config
     Flash.__init__(self, config['swf_file_name'], config['flash_class'], [config['flash_mc_name']], config['swf_path'])
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = config['backgroundAlpha']
     self.movie.scaleMode = config['scaleMode']
     self.component.focus = config['focus']
     self.component.moveFocus = config['moveFocus']
     self.component.heightMode = config['heightMode']
     self.component.widthMode = config['widthMode']
     self.flashSize = config['flash_size']
     self.component.relativeRadius = config['relativeRadius']
     self.__dObject = getattr(self.movie, config['flash_mc_name'], None)
     return
Пример #26
0
 def __init__(self, swf):
     Flash.__init__(self, swf)
     component = self.component
     component.size = (2, 2)
     self.component = GUI.Window('')
     self.component.addChild(component, 'flash')
     self.component.script = self
     self.component.crossFocus = True
     self.component.dragFocus = True
     self.component.dropFocus = True
     self.component.focus = True
     self.component.moveFocus = True
     self.component.mouseButtonFocus = True
     self.movie.backgroundAlpha = 0.75
     ModalWindowsManager().add(self)
Пример #27
0
 def __init__(self, hitsCount):
     names = tuple(map(lambda i: _DAMAGE_INDICATOR_MC_NAME.format(i), xrange(hitsCount)))
     Flash.__init__(self, _DAMAGE_INDICATOR_SWF, _DAMAGE_INDICATOR_COMPONENT, (names,))
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = 0.0
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     ctrl = g_sessionProvider.shared.crosshair
     if ctrl is not None:
         ctrl.onCrosshairOffsetChanged += self.__onCrosshairOffsetChanged
         self.__onCrosshairOffsetChanged(*ctrl.getOffset())
     self.active(True)
     return
Пример #28
0
 def __init__(self, swf):
     Flash.__init__(self, swf)
     component = self.component
     component.size = (2, 2)
     self.component = GUI.Window('')
     self.component.addChild(component, 'flash')
     self.component.script = self
     self.component.crossFocus = True
     self.component.dragFocus = True
     self.component.dropFocus = True
     self.component.focus = True
     self.component.moveFocus = True
     self.component.mouseButtonFocus = True
     self.movie.backgroundAlpha = 0.75
     self.movie.wg_inputKeyMode = 2
     self.addFsCallbacks({'WoTLogoff': self.onLogoff})
Пример #29
0
 def __init__(self, hitsCount):
     names = tuple(map(lambda i: _DAMAGE_INDICATOR_MC_NAME.format(i), xrange(hitsCount)))
     Flash.__init__(self, _DAMAGE_INDICATOR_SWF, _DAMAGE_INDICATOR_COMPONENT, (names,))
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = 0.0
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     ctrl = g_sessionProvider.shared.crosshair
     if ctrl is not None:
         ctrl.onCrosshairOffsetChanged += self.__onCrosshairOffsetChanged
         self.__onCrosshairOffsetChanged(*ctrl.getOffset())
     self.active(True)
     return
Пример #30
0
 def __init__(self, config):
     self.config = config
     Flash.__init__(self, config['swf_file_name'], config['flash_class'],
                    [config['flash_mc_name']], config['swf_path'])
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = config['backgroundAlpha']
     self.movie.scaleMode = config['scaleMode']
     self.component.focus = config['focus']
     self.component.moveFocus = config['moveFocus']
     self.component.heightMode = config['heightMode']
     self.component.widthMode = config['widthMode']
     self.flashSize = config['flash_size']
     self.component.relativeRadius = config['relativeRadius']
     self.__dObject = getattr(self.movie, config['flash_mc_name'], None)
     return
Пример #31
0
 def __init__(self, swf):
     Flash.__init__(self, swf)
     component = self.component
     component.size = (2, 2)
     self.component = GUI.Window('')
     self.component.addChild(component, 'flash')
     self.component.script = self
     self.component.crossFocus = True
     self.component.dragFocus = True
     self.component.dropFocus = True
     self.component.focus = True
     self.component.moveFocus = True
     self.component.mouseButtonFocus = True
     self.movie.backgroundAlpha = 0.75
     self.movie.wg_inputKeyMode = 2
     self.addFsCallbacks({'WoTLogoff': self.onLogoff})
Пример #32
0
 def __init__(self, config):
     self.config = config
     Flash.__init__(
         self, config["swf_file_name"], config["flash_class"], [config["flash_mc_name"]], config["swf_path"]
     )
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.movie.backgroundAlpha = config["backgroundAlpha"]
     self.movie.scaleMode = config["scaleMode"]
     self.component.focus = config["focus"]
     self.component.moveFocus = config["moveFocus"]
     self.component.heightMode = config["heightMode"]
     self.component.widthMode = config["widthMode"]
     self.flashSize = config["flash_size"]
     self.component.relativeRadius = config["relativeRadius"]
     self.__dObject = getattr(self.movie, config["flash_mc_name"], None)
Пример #33
0
 def __init__(self, mode, offset):
     Flash.__init__(self, 'crosshair_panel_{0:>s}.swf'.format(mode),
                    self.__FLASH_CLASS)
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.movie.backgroundAlpha = 0
     self.flashSize = GUI.screenResolution()
     self._offset = offset
     self._isLoaded = False
     self.mode = mode
     self.__timeInterval = _TimeInterval(Aim._UPDATE_INTERVAL, '_update',
                                         weakref.proxy(self))
     self.__isColorBlind = AccountSettings.getSettings('isColorBlind')
Пример #34
0
 def __init__(self, parentUI):
     Flash.__init__(self, self.__SWF_FILE_NAME)
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_VehicleMarker
     self.component.drawWithRestrictedViewPort = False
     self.movie.backgroundAlpha = 0
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(weakref.proxy(self))
     self.__plugins = PluginsCollection(self)
     plugins = {'equipments': _EquipmentsMarkerPlugin}
     if isEventBattle():
         plugins.update({'flags': _FlagsMarkerPlugin,
          'repairs': _RepairsMarkerPlugin})
     self.__plugins.addPlugins(plugins)
     self.__ownUI = None
     self.__parentUI = parentUI
     self.__markers = dict()
     return
Пример #35
0
 def __init__(self, parentUI):
     Flash.__init__(self, _MARKERS_MANAGER_SWF)
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_VehicleMarker
     self.component.drawWithRestrictedViewPort = False
     self.movie.backgroundAlpha = 0
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(weakref.proxy(self))
     self.__plugins = PluginsCollection(self)
     plugins = {'equipments': _EquipmentsMarkerPlugin}
     if arena_info.hasFlags():
         plugins['flags'] = _FlagsMarkerPlugin
     if arena_info.hasRepairPoints():
         plugins['repairs'] = _RepairsMarkerPlugin
     if arena_info.hasResourcePoints():
         plugins['resources'] = _ResourceMarkerPlugin
     self.__plugins.addPlugins(plugins)
     self.__ownUI = None
     self.__parentUI = parentUI
     self.__markers = {}
Пример #36
0
 def __init__(self, parentUI):
     Flash.__init__(self, _MARKERS_MANAGER_SWF)
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_VehicleMarker
     self.component.drawWithRestrictedViewPort = False
     self.movie.backgroundAlpha = 0
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(weakref.proxy(self))
     self.__plugins = PluginsCollection(self)
     plugins = {'equipments': _EquipmentsMarkerPlugin}
     if arena_info.hasFlags():
         plugins['flags'] = _FlagsMarkerPlugin
     if arena_info.hasRepairPoints():
         plugins['repairs'] = _RepairsMarkerPlugin
     if arena_info.hasResourcePoints():
         plugins['resources'] = _ResourceMarkerPlugin
     self.__plugins.addPlugins(plugins)
     self.__ownUI = None
     self.__parentUI = parentUI
     self.__markers = {}
Пример #37
0
 def __init__(self, mode, offset):
     Flash.__init__(self, 'crosshair_panel_{0:>s}.swf'.format(mode), self.__FLASH_CLASS)
     self._posX = 0
     self._posY = 0
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_Aim
     self.component.focus = False
     self.component.moveFocus = False
     self.component.heightMode = 'PIXEL'
     self.component.widthMode = 'PIXEL'
     self.movie.backgroundAlpha = 0
     self._offset = offset
     self._isLoaded = False
     self.mode = mode
     self.__timeInterval = _TimeInterval(Aim._UPDATE_INTERVAL, '_update', weakref.proxy(self))
     from account_helpers.settings_core.SettingsCore import g_settingsCore
     self.settingsCore = weakref.proxy(g_settingsCore)
     self.__aimSettings = None
     self.__isColorBlind = self.settingsCore.getSetting('isColorBlind')
     self.settingsCore.interfaceScale.onScaleChanged += self.__refreshScale
     self.__refreshScale(self.settingsCore.interfaceScale.get())
     self._reloadingHndl = getReloadingHandler()
     return
Пример #38
0
 def close(self):
     ModalWindowsManager().remove(self)
     Flash.close(self)
Пример #39
0
 def __init__(self, swf):
     Flash.__init__(self, swf)
     self.addFsCallbacks({'WoTQuit': self.onQuit,
      'WoTLogoff': self.onLogoff})
     self.afterCreate()
Пример #40
0
 def close(self):
     Flash.close(self)
Пример #41
0
 def close(self):
     self.component.script = None
     Flash.close(self)
     return
Пример #42
0
 def __createFlashIfNeeded(self):
     if self.__flashObject is None:
         self.__flashObject = Flash(_LOGITECH_SWF_COLORED) if self.__isColored else Flash(_LOGITECH_SWF_MONO)
         self.__flashObject.movie.wg_outputToLogitechLcd = True
     return
Пример #43
0
class LogitechMonitorEntry(object):
    """
    LogitechMonitor still uses AS2, cause it's an old crap.
    Monitor lives from start to the client's end, cause we use same flash object for all screens
    We embed different logic in screens which works with same flash object
    """
    def __init__(self):
        super(LogitechMonitorEntry, self).__init__()
        self.__navigator = _ScreenNavigator()
        self.__flashObject = None
        self.__screen = None
        self.__screenName = None
        self.__frame = None
        self.__clearDeviceInfo()
        return

    @property
    def isInitialized(self):
        """
        :return: lcd was initialized and we've got notification and performed initial setup
        """
        return self.__width != 0 and self.__height != 0

    @property
    def isColored(self):
        return self.__isColored

    @property
    def component(self):
        if self.__flashObject:
            return self.__flashObject.component
        else:
            return None

    @property
    def screen(self):
        """
        :return: Returns screen name
        """
        return self.__screenName

    def activate(self):
        pass

    def close(self):
        if LcdKeyboard.g_instance:
            LcdKeyboard.g_instance.changeNotifyCallback = None
        self._stop()
        return

    def startScreen(self, screenName):
        if not screenName is not None:
            raise AssertionError
            self.isInitialized or LOG_WARNING(
                "Monitor isn't active yet. Ignore.", screenName)
            return
        elif screenName == self.__screenName:
            LOG_DEBUG('Requested screen is active already. Ignore', screenName)
            return
        else:
            self.__startScreen(screenName)
            return

    def changeView(self):
        """
        Switch to the next view inside screen if it has more than one
        """
        if self.__screen is not None:
            LOG_DEBUG('Changing view')
            self.__screen.as_changeViewS()
        else:
            LOG_WARNING("No active screen. Can't change view.")
        return

    def _start(self, isColored, width, height):
        LOG_DEBUG('Starting monitor', isColored, width, height)
        self.__isColored = isColored
        self.__width = width
        self.__height = height
        self.__navigator.start(weakref.proxy(self))
        g_keyEventHandlers.add(self.__handleKeyEvent)

    def _stop(self):
        self.__clearDeviceInfo()
        self.__navigator.stop()
        if self.__handleKeyEvent in g_keyEventHandlers:
            g_keyEventHandlers.remove(self.__handleKeyEvent)
        self.__stopCurrentScreen()
        self.__releaseFlash()

    def __onMonitorInitialized(self, isEnabled, isColored, width, height):
        """
        Currently it's fired only if device is created or released while callback is set
        :param isEnabled if device is initialized, otherwise it's released
        """
        if self.isInitialized == isEnabled and self.__isColored == isColored and self.__width == width and self.__height:
            LOG_DEBUG('Monitor is initialized already. Ignore.')
            return
        if isEnabled:
            LOG_DEBUG('Monitor is attahced', isColored, width, height)
            self._start(isColored, width, height)
        else:
            LOG_DEBUG('Monitor is detached')
            self._stop()
        needOption = isEnabled and isColored
        KeyboardSettings.hideGroup('logitech_keyboard', hide=not needOption)

    def __clearDeviceInfo(self):
        self.__isColored = True
        self.__width = 0
        self.__height = 0

    def __handleKeyEvent(self, event):
        cmdMap = CommandMapping.g_instance
        isDown, key, _, isRepeat = convertKeyEvent(event)
        if cmdMap.isFired(CommandMapping.CMD_LOGITECH_SWITCH_VIEW,
                          key) and isDown and not isRepeat:
            self.changeView()

    def __startScreen(self, screenName):
        currentFrame = self.__frame
        self.__stopCurrentScreen()
        screenInfo = _SCREENS[screenName]
        screenCls = screenInfo.colored(
        ) if self.__isColored else screenInfo.mono()
        frameName = screenInfo.frame
        LOG_DEBUG("Starting screen '{}' with frame '{}'".format(
            screenName, frameName))
        self.__screenName = screenName
        self.__screen = screenCls(frameName)
        self.__frame = frameName
        self.__createFlashIfNeeded()
        self.__screen.start(self.__flashObject)
        if currentFrame == frameName:
            LOG_DEBUG(
                "New screen is loaded with same frame. Forcing 'onLoaded' callback",
                frameName)
            self.__screen.loadedWithOldFrame()

    def __stopCurrentScreen(self):
        if self.__screen is not None:
            self.__frame = None
            self.__screen.stop()
            self.__screen = None
            self.__screenName = None
        return

    def __createFlashIfNeeded(self):
        if self.__flashObject is None:
            self.__flashObject = Flash(
                _LOGITECH_SWF_COLORED) if self.__isColored else Flash(
                    _LOGITECH_SWF_MONO)
            self.__flashObject.movie.wg_outputToLogitechLcd = True
        return

    def __releaseFlash(self):
        if self.__flashObject is not None:
            self.__flashObject.close()
            self.__flashObject = None
        return
Пример #44
0
class LogitechMonitorEntry(object):
    """
    LogitechMonitor still uses AS2, cause it's an old crap.
    Monitor lives from start to the client's end, cause we use same flash object for all screens
    We embed different logic in screens which works with same flash object
    """

    def __init__(self):
        super(LogitechMonitorEntry, self).__init__()
        self.__navigator = _ScreenNavigator()
        self.__flashObject = None
        self.__screen = None
        self.__screenName = None
        self.__frame = None
        self.__clearDeviceInfo()
        return

    @property
    def isInitialized(self):
        """
        :return: lcd was initialized and we've got notification and performed initial setup
        """
        return self.__width != 0 and self.__height != 0

    @property
    def isColored(self):
        return self.__isColored

    @property
    def component(self):
        if self.__flashObject:
            return self.__flashObject.component
        else:
            return None

    @property
    def screen(self):
        """
        :return: Returns screen name
        """
        return self.__screenName

    def activate(self):
        if LcdKeyboard.g_instance:
            LcdKeyboard.g_instance.changeNotifyCallback = self.__onMonitorInitialized
        else:
            LOG_DEBUG("Can't activate")

    def close(self):
        if LcdKeyboard.g_instance:
            LcdKeyboard.g_instance.changeNotifyCallback = None
        self._stop()
        return

    def startScreen(self, screenName):
        if not screenName is not None:
            raise AssertionError
            self.isInitialized or LOG_WARNING("Monitor isn't active yet. Ignore.", screenName)
            return
        elif screenName == self.__screenName:
            LOG_DEBUG('Requested screen is active already. Ignore', screenName)
            return
        else:
            self.__startScreen(screenName)
            return

    def changeView(self):
        """
        Switch to the next view inside screen if it has more than one
        """
        if self.__screen is not None:
            LOG_DEBUG('Changing view')
            self.__screen.as_changeViewS()
        else:
            LOG_WARNING("No active screen. Can't change view.")
        return

    def _start(self, isColored, width, height):
        LOG_DEBUG('Starting monitor', isColored, width, height)
        self.__isColored = isColored
        self.__width = width
        self.__height = height
        self.__navigator.start(weakref.proxy(self))
        g_keyEventHandlers.add(self.__handleKeyEvent)

    def _stop(self):
        self.__clearDeviceInfo()
        self.__navigator.stop()
        if self.__handleKeyEvent in g_keyEventHandlers:
            g_keyEventHandlers.remove(self.__handleKeyEvent)
        self.__stopCurrentScreen()
        self.__releaseFlash()

    def __onMonitorInitialized(self, isEnabled, isColored, width, height):
        """
        Currently it's fired only if device is created or released while callback is set
        :param isEnabled if device is initialized, otherwise it's released
        """
        if self.isInitialized == isEnabled and self.__isColored == isColored and self.__width == width and self.__height:
            LOG_DEBUG('Monitor is initialized already. Ignore.')
            return
        if isEnabled:
            LOG_DEBUG('Monitor is attahced', isColored, width, height)
            self._start(isColored, width, height)
        else:
            LOG_DEBUG('Monitor is detached')
            self._stop()
        needOption = isEnabled and isColored
        KeyboardSettings.hideGroup('logitech_keyboard', hide=not needOption)

    def __clearDeviceInfo(self):
        self.__isColored = True
        self.__width = 0
        self.__height = 0

    def __handleKeyEvent(self, event):
        cmdMap = CommandMapping.g_instance
        isDown, key, _, isRepeat = convertKeyEvent(event)
        if cmdMap.isFired(CommandMapping.CMD_LOGITECH_SWITCH_VIEW, key) and isDown and not isRepeat:
            self.changeView()

    def __startScreen(self, screenName):
        currentFrame = self.__frame
        self.__stopCurrentScreen()
        screenInfo = _SCREENS[screenName]
        screenCls = screenInfo.colored() if self.__isColored else screenInfo.mono()
        frameName = screenInfo.frame
        LOG_DEBUG("Starting screen '{}' with frame '{}'".format(screenName, frameName))
        self.__screenName = screenName
        self.__screen = screenCls(frameName)
        self.__frame = frameName
        self.__createFlashIfNeeded()
        self.__screen.start(self.__flashObject)
        if currentFrame == frameName:
            LOG_DEBUG("New screen is loaded with same frame. Forcing 'onLoaded' callback", frameName)
            self.__screen.loadedWithOldFrame()

    def __stopCurrentScreen(self):
        if self.__screen is not None:
            self.__frame = None
            self.__screen.stop()
            self.__screen = None
            self.__screenName = None
        return

    def __createFlashIfNeeded(self):
        if self.__flashObject is None:
            self.__flashObject = Flash(_LOGITECH_SWF_COLORED) if self.__isColored else Flash(_LOGITECH_SWF_MONO)
            self.__flashObject.movie.wg_outputToLogitechLcd = True
        return

    def __releaseFlash(self):
        if self.__flashObject is not None:
            self.__flashObject.close()
            self.__flashObject = None
        return
Пример #45
0
 def __init__(self):
     self.proxy = weakref.proxy(self)
     Flash.__init__(self, 'lobby.swf', path=SCALEFORM_SWF_PATH_V3)
Пример #46
0
 def __init__(self, garageNum):
     Flash.__init__(self,
                    TutorialGarage.GARAGE_SWF_NAMES[garageNum],
                    path=SCALEFORM_SWF_PATH_V3)
Пример #47
0
 def __init__(self):
     self.proxy = weakref.proxy(self)
     Flash.__init__(self, 'lobby.swf', path=SCALEFORM_SWF_PATH_V3)
Пример #48
0
 def __init__(self):
     self.proxy = weakref.proxy(self)
     Flash.__init__(self, 'Application.swf', path=SCALEFORM_SWF_PATH_V3)
Пример #49
0
 def close(self):
     self.component.script = None
     Flash.close(self)
     return
Пример #50
0
 def close(self):
     Flash.close(self)
Пример #51
0
 def __init__(self):
     self.proxy = weakref.proxy(self)
     Flash.__init__(self, 'Application.swf', path=SCALEFORM_SWF_PATH_V3)