def needToLoadHangar(self):
     res = False
     aliasToLoad = [PREBATTLE_ALIASES.TRAINING_LIST_VIEW_PY, PREBATTLE_ALIASES.TRAINING_ROOM_VIEW_PY]
     inView = None
     if g_appLoader is not None and g_appLoader.getApp() is not None and g_appLoader.getApp().containerManager is not None:
         inView = g_appLoader.getApp().containerManager.getView(ViewTypes.LOBBY_SUB)
     if inView is not None:
         if inView.alias in aliasToLoad:
             res = True
     return res
Exemple #2
0
 def onAppInitialized(self, event):
     #log('onAppInitialized: ' + str(event.ctx.ns))
     if event.ctx.ns == APP_NAME_SPACE.SF_BATTLE:
         self.xvm_battle_swf_initialized = False
         app = g_appLoader.getApp(event.ctx.ns)
         if app is not None and app.loaderManager is not None:
             app.loaderManager.onViewLoaded += self.onViewLoaded
    def userMenu(self, cmd, ctx):
        context = {'dbID': cmd.spa_id,
         'userName': cmd.user_name,
         'customItems': cmd.custom_items,
         'excludedItems': cmd.excluded_items}
        callback = ctx.get('callback')
        browserView = ctx.get('browser_view')
        app = g_appLoader.getApp()
        try:
            browserView.as_showContextMenuS(CONTEXT_MENU_HANDLER_TYPE.CUSTOM_USER, context)
            cmHandler = app.contextMenuManager.getCurrentHandler()
        except AttributeError as ex:
            raise WebCommandException('Failed to show context menu: %s' % ex)

        if cmHandler is not None and isinstance(cmHandler, CustomUserCMHandler):
            webBrowser = self.browserController.getBrowser(ctx.get('browser_id'))
            webBrowser.allowMouseWheel = False

            def onSelectedCallback(optionId):
                callback({'menu_type': 'user_menu',
                 'selected_item': optionId,
                 'spa_id': cmd.spa_id})
                webBrowser.allowMouseWheel = True

            cmHandler.onSelected += onSelectedCallback
        else:
            return {'menu_type': 'user_menu',
             'selected_item': None,
             'spa_id': cmd.spa_id}
        return
Exemple #4
0
 def onAppDestroyed(self, event):
     trace('onAppDestroyed: {}'.format(event.ns))
     if event.ns == APP_NAME_SPACE.SF_LOBBY:
         self.hangarDispose()
     app = g_appLoader.getApp(event.ns)
     if app is not None and app.loaderManager is not None:
         app.loaderManager.onViewLoaded -= self.onViewLoaded
Exemple #5
0
 def onAppInitialized(self, event):
     #log('onAppInitialized: ' + str(event.ctx.ns))
     if event.ctx.ns == APP_NAME_SPACE.SF_BATTLE:
         self.xvm_battle_swf_initialized = False
         app = g_appLoader.getApp(event.ctx.ns)
         if app is not None and app.loaderManager is not None:
             app.loaderManager.onViewLoaded += self.onViewLoaded
Exemple #6
0
 def onAppDestroyed(self, event):
     trace('onAppDestroyed: {}'.format(event.ns))
     if event.ns == APP_NAME_SPACE.SF_LOBBY:
         self.hangarDispose()
     app = g_appLoader.getApp(event.ns)
     if app is not None and app.loaderManager is not None:
         app.loaderManager.onViewLoaded -= self.onViewLoaded
Exemple #7
0
def handleSoundCommand(command, ctx):
    """
    Plays sound effect by id
    """
    app = g_appLoader.getApp()
    if app and app.soundManager:
        app.soundManager.playEffectSound(command.sound_id)
 def _updateWithCurrent(self):
     battle = g_appLoader.getApp(appNS=APP_NAME_SPACE.SF_BATTLE)
     if battle is not None and hasattr(battle, 'fragCorrelation'):
         score = battle.fragCorrelation.getCurrentScore()
         if score is not None:
             ally, enemy = score
             self.__updateFrags(ally, enemy)
     return
Exemple #9
0
 def onAppInitialized(self, event):
     trace('onAppInitialized: {}'.format(event.ns))
     app = g_appLoader.getApp(event.ns)
     if app is not None and app.loaderManager is not None:
         app.loaderManager.onViewLoaded += self.onViewLoaded
     # initialize XVM services if game restarted after crash or in replay
     if event.ns == APP_NAME_SPACE.SF_BATTLE:
         self.initializeXvmServices()
Exemple #10
0
    def getGuiRoot(self):
        try:
            root = g_appLoader.getApp()
        except AttributeError:
            LOG_CURRENT_EXCEPTION()
            root = None

        return root
Exemple #11
0
    def getGuiRoot(self):
        try:
            root = g_appLoader.getApp()
        except AttributeError:
            LOG_CURRENT_EXCEPTION()
            root = None

        return root
 def __init__(self, parent, content):
     if parent is None:
         app = g_appLoader.getApp()
         view = app.containerManager.getViewByKey(ViewKey(VIEW_ALIAS.LOBBY))
         if view is not None:
             parent = view.getParentWindow()
     super(RewardWindowBase, self).__init__(parent=parent, content=content)
     return
 def browser(self, cmd, ctx):
     app = g_appLoader.getApp()
     if app is not None and app.containerManager is not None:
         browserView = app.containerManager.getView(ViewTypes.LOBBY_SUB, criteria={POP_UP_CRITERIA.VIEW_ALIAS: ctx.get('browser_alias')})
         if browserView is not None:
             browserView.onCloseView()
             return
     raise WebCommandException('Unable to find BrowserView!')
     return
Exemple #14
0
 def _initialize(self, tooltipData):
     super(_BackportTooltipContent, self)._initialize()
     toolTipMgr = g_appLoader.getApp().getToolTipMgr()
     if toolTipMgr is not None:
         if tooltipData.isSpecial:
             toolTipMgr.onCreateTypedTooltip(tooltipData.specialAlias, tooltipData.specialArgs, _STATE_TYPE_INFO)
         else:
             toolTipMgr.onCreateComplexTooltip(tooltipData.tooltip, _STATE_TYPE_INFO)
     return
 def load(self,
          url=None,
          title=None,
          showActionBtn=True,
          showWaiting=True,
          browserID=None,
          isAsync=False,
          browserSize=None,
          isDefault=True,
          callback=None,
          showCloseBtn=False,
          useBrowserWindow=True):
     url = yield self.__urlMacros.parse(url or GUI_SETTINGS.browser.url)
     suffix = yield self.__urlMacros.parse(GUI_SETTINGS.browser.params)
     concatenator = '&' if '?' in url else '?'
     if suffix not in url:
         url = concatenator.join([url, suffix])
     size = browserSize or BROWSER.SIZE
     webBrowserID = browserID
     if browserID is None:
         browserID = self.__browserIDGenerator.next()
         webBrowserID = browserID
     elif type(browserID) is not int:
         webBrowserID = self.__browserIDGenerator.next()
     ctx = {
         'url': url,
         'title': title,
         'showActionBtn': showActionBtn,
         'showWaiting': showWaiting,
         'browserID': browserID,
         'size': size,
         'isAsync': isAsync,
         'showCloseBtn': showCloseBtn,
         'showWindow': useBrowserWindow
     }
     texture = browserID not in self.__browsers and browserID not in self.__pendingBrowsers and self._BROWSER_TEXTURE
     app = g_appLoader.getApp()
     if not app:
         raise AssertionError('Application can not be None')
         browser = WebBrowser(webBrowserID,
                              app,
                              texture,
                              size,
                              url,
                              handlers=self.__filters)
         self.__browsers[browserID] = browser
         if self.__isCreatingBrowser():
             self.__pendingBrowsers[browserID] = ctx
         else:
             self.__createBrowser(ctx)
     elif browserID in self.__pendingBrowsers:
         self.__pendingBrowsers[browserID] = ctx
     elif browserID in self.__browsers:
         self.__browsers[browserID].navigate(url)
     callback(browserID)
     return
Exemple #16
0
 def isRunning(self):
     app = g_appLoader.getApp()
     if app:
         from gui.Scaleform.daapi.settings.views import VIEW_ALIAS
         view = app.containerManager.getView(ViewTypes.DEFAULT)
         if view and view.settings.alias == VIEW_ALIAS.LOGIN and view._isCreated() and connectionManager.isDisconnected():
             LOG_DEBUG('Disconnect action. Player came to login')
             self._completed = True
             self._running = False
     return self._running
Exemple #17
0
 def isRunning(self):
     app = g_appLoader.getApp()
     if app:
         from gui.Scaleform.daapi.settings.views import VIEW_ALIAS
         view = app.containerManager.getView(ViewTypes.DEFAULT)
         if view and view.settings.alias == VIEW_ALIAS.LOGIN and view._isCreated() and connectionManager.isDisconnected():
             LOG_DEBUG('Disconnect action. Player came to login')
             self._completed = True
             self._running = False
     return self._running
 def __destroyChangeModeWindow(self):
     if self.browserCtrl.getBrowser(self.__changeModeBrowserId):
         app = g_appLoader.getApp()
         if app is not None and app.containerManager is not None:
             windowAlias = getViewName(VIEW_ALIAS.BROWSER_WINDOW_MODAL, self.__changeModeBrowserId)
             window = app.containerManager.getView(ViewTypes.WINDOW, criteria={POP_UP_CRITERIA.UNIQUE_NAME: windowAlias})
             if window:
                 window.destroy()
     self.__changeModeBrowserId = 0
     return
Exemple #19
0
 def _isLinkedSetViewOnScene(self):
     app = g_appLoader.getApp()
     if app is not None and app.containerManager is not None:
         lobbySubContainer = app.containerManager.getContainer(ViewTypes.LOBBY_SUB)
         if lobbySubContainer is not None:
             searchCriteria = {POP_UP_CRITERIA.VIEW_ALIAS: VIEW_ALIAS.LOBBY_MISSIONS}
             lobbyMissions = lobbySubContainer.getView(criteria=searchCriteria)
             if lobbyMissions:
                 return lobbyMissions.getCurrentTabAlias() == QUESTS_ALIASES.MISSIONS_CATEGORIES_VIEW_PY_ALIAS
     return False
    def load(
        self,
        url=None,
        title=None,
        showActionBtn=True,
        showWaiting=True,
        browserID=None,
        isAsync=False,
        browserSize=None,
        background=None,
        isDefault=True,
        callback=None,
        showCloseBtn=False,
    ):
        url = url or GUI_SETTINGS.browser.url
        suffix = yield self.__urlMacros.parse(GUI_SETTINGS.browser.params)
        concatenator = "&" if "?" in url else "?"
        if suffix not in url:
            url = concatenator.join([url, suffix])
        size = browserSize or BROWSER.SIZE
        background = background or BROWSER.BACKGROUND
        if browserID is None:
            browserID = self.__browserIDGenerator.next()
        if browserID not in self.__browsers:
            texture = self._BROWSER_TEXTURE if isDefault else self._ALT_BROWSER_TEXTURE
            app = g_appLoader.getApp()
            if not app:
                raise AssertionError("Application can not be None")
                self.__browsers[browserID] = WebBrowser(browserID, app, texture, size, url, backgroundUrl=background)
                self.onBrowserAdded(browserID)
            ctx = {
                "url": url,
                "title": title,
                "showActionBtn": showActionBtn,
                "showWaiting": showWaiting,
                "browserID": browserID,
                "size": size,
                "isDefault": isDefault,
                "isAsync": isAsync,
                "showCloseBtn": showCloseBtn,
            }

            def browserCallback(*args):
                self.__clearCallback(browserID)
                self.__showBrowser(browserID, ctx)

            self.__browsersCallbacks[browserID] = isAsync and (None, browserCallback)
            self.__browsers[browserID].onLoadEnd += browserCallback
        else:
            self.__browsersCallbacks[browserID] = (browserCallback, None)
            self.__browsers[browserID].onLoadStart += browserCallback
        callback(browserID)
        return
Exemple #21
0
    def onAppInitialized(self, event):
        if self._initialized_apps.get(event.ctx.ns, None) is not None:
            return
        self._initialized_apps[event.ctx.ns] = True

        trace('onAppInitialized: {}'.format(event.ctx.ns))

        app = g_appLoader.getApp(event.ctx.ns)
        if app is not None and app.loaderManager is not None:
            app.loaderManager.onViewLoaded += self.onViewLoaded
        # initialize XVM services if game restarted after crash or in replay
        if event.ctx.ns == APP_NAME_SPACE.SF_BATTLE:
            self.initializeXvmServices()
Exemple #22
0
 def _doActivate(self):
     LOG_DEBUG_DEV_BOOTCAMP('Activating StateInGarage')
     weave(self.__weaver, self)
     from bootcamp.Bootcamp import g_bootcamp
     g_bootcamp.setBootcampHangarSpace()
     app = g_appLoader.getApp(APP_NAME_SPACE.SF_LOBBY)
     if app is not None and app.initialized:
         self.__onSfAppInited()
     else:
         g_eventBus.addListener(AppLifeCycleEvent.INITIALIZED,
                                self.__onSfAppInited,
                                EVENT_BUS_SCOPE.GLOBAL)
     return
Exemple #23
0
 def __init__(self, *args, **kwargs):
     app = g_appLoader.getApp()
     view = app.containerManager.getViewByKey(ViewKey(VIEW_ALIAS.LOBBY))
     if view is not None:
         parent = view.getParentWindow()
     else:
         parent = None
     super(BuyVehicleWindow,
           self).__init__(content=BuyVehicleView(*args, **kwargs),
                          wndFlags=WindowFlags.DIALOG,
                          decorator=None,
                          parent=parent)
     return
Exemple #24
0
 def load(self, url=None, title=None, showActionBtn=True, showWaiting=True, browserID=None, isAsync=False, browserSize=None, isDefault=True, callback=None, showCloseBtn=False, useBrowserWindow=True, isModal=False, showCreateWaiting=False, handlers=None, showBrowserCallback=None, isSolidBorder=False):
     if showCreateWaiting:
         Waiting.show('browser/init')
     url = yield self.__urlMacros.parse(url or GUI_SETTINGS.browser.url)
     suffix = yield self.__urlMacros.parse(GUI_SETTINGS.browser.params)
     concatenator = '&' if '?' in url else '?'
     if suffix not in url:
         url = concatenator.join([url, suffix])
     size = browserSize or BROWSER.SIZE
     webBrowserID = browserID
     if browserID is None:
         browserID = self.__browserIDGenerator.next()
         webBrowserID = browserID
     elif type(browserID) is not int:
         webBrowserID = self.__browserIDGenerator.next()
     ctx = {'url': url,
      'title': title,
      'showActionBtn': showActionBtn,
      'showWaiting': showWaiting,
      'browserID': browserID,
      'size': size,
      'isAsync': isAsync,
      'showCloseBtn': showCloseBtn,
      'showWindow': useBrowserWindow,
      'alias': VIEW_ALIAS.BROWSER_WINDOW_MODAL if isModal else VIEW_ALIAS.BROWSER_WINDOW,
      'showCreateWaiting': showCreateWaiting,
      'handlers': handlers,
      'showBrowserCallback': showBrowserCallback,
      'isSolidBorder': isSolidBorder}
     if browserID not in self.__browsers and browserID not in self.__pendingBrowsers:
         texture = self._BROWSER_TEXTURE
         app = g_appLoader.getApp()
         if app is None:
             raise SoftException('Application can not be None')
         browser = WebBrowser(webBrowserID, app, texture, size, url, handlers=self.__filters)
         self.__browsers[browserID] = browser
         if self.__isCreatingBrowser():
             _logger.debug('CTRL: Queueing a browser creation: %r - %s', browserID, url)
             self.__pendingBrowsers[browserID] = ctx
         else:
             self.__createBrowser(ctx)
     elif browserID in self.__pendingBrowsers:
         _logger.debug('CTRL: Re-queuing a browser creation, overriding: %r - %s', browserID, url)
         self.__pendingBrowsers[browserID] = ctx
     elif browserID in self.__browsers:
         _logger.debug('CTRL: Re-navigating an existing browser: %r - %s', browserID, url)
         browser = self.__browsers[browserID]
         browser.navigate(url)
         browser.changeTitle(title)
     callback(browserID)
     return
Exemple #25
0
 def showTooltip(self, intCD, itemType):
     toolTipMgr = g_appLoader.getApp().getToolTipMgr()
     if itemType == BOX_TYPE:
         header = i18n.makeString(TOOLTIPS.VEHICLEPREVIEW_BOXTOOLTIP_HEADER)
         body = i18n.makeString(TOOLTIPS.VEHICLEPREVIEW_BOXTOOLTIP_BODY)
         tooltip = '{HEADER}%s{/HEADER}{BODY}%s{/BODY}' % (header, body)
         toolTipMgr.onCreateComplexTooltip(tooltip, 'INFO')
         return
     try:
         rawItem = [ item for item in self.__packItems if item.id == intCD and item.type == itemType ][0]
         item = lookupItem(rawItem, self.itemsCache, self.goodiesCache)
         showItemTooltip(toolTipMgr, rawItem, item)
     except IndexError:
         return
def _handlerCloseBrowserWindow(onBrowserClose, command, ctx):
    if 'browser_id' in ctx:
        windowAlias = getViewName(ctx['browser_alias'], ctx['browser_id'])
        app = g_appLoader.getApp()
        if app is not None and app.containerManager is not None:
            browserWindow = app.containerManager.getView(
                ViewTypes.WINDOW,
                criteria={POP_UP_CRITERIA.UNIQUE_NAME: windowAlias})
            if browserWindow is not None:
                browserWindow.destroy()
            else:
                raise WebCommandException("Browser window can't be found!")
    if onBrowserClose is not None:
        onBrowserClose()
    return
    def _guessCurrentScreen(self):
        app = g_appLoader.getApp()
        if app is not None:
            if hasattr(app, 'containerManager'):
                view = app.containerManager.getView(ViewTypes.DEFAULT)
                if view is not None:
                    alias = view.settings.alias
                    for ets in _EVENT_TO_SCREEN:
                        if alias in ets.eventTypes:
                            LOG_DEBUG('Guessed current screen', ets.screen)
                            return ets.screen

            if app.appNS is APP_NAME_SPACE.SF_BATTLE:
                return _LogitechScreen.BATTLE
        return
    def _guessCurrentScreen(self):
        app = g_appLoader.getApp()
        if app is not None:
            if hasattr(app, 'containerManager'):
                view = app.containerManager.getView(ViewTypes.DEFAULT)
                if view is not None:
                    alias = view.settings.alias
                    for ets in _EVENT_TO_SCREEN:
                        if alias in ets.eventTypes:
                            LOG_DEBUG('Guessed current screen', ets.screen)
                            return ets.screen

            if app.appNS is APP_NAME_SPACE.SF_BATTLE:
                return _LogitechScreen.BATTLE
        return
def showWebShop(url=None, customPath=None):
    app = g_appLoader.getApp()
    if url is None:
        url = getWebShopURL()
        if customPath is not None:
            url = urlparse.urljoin(url, customPath)
    if app is not None and app.containerManager is not None:
        viewKey = ViewKey(VIEW_ALIAS.LOBBY_STORE)
        browserWindow = app.containerManager.getViewByKey(viewKey)
        if browserWindow is not None:
            browserWindow.destroy()
    g_eventBus.handleEvent(events.LoadViewEvent(VIEW_ALIAS.LOBBY_STORE,
                                                ctx={'url': url}),
                           scope=EVENT_BUS_SCOPE.LOBBY)
    return
    def load(self, url = None, title = None, showActionBtn = True, showWaiting = True, browserID = None, isAsync = False, browserSize = None, background = None, isDefault = True, callback = None, showCloseBtn = False):
        url = url or GUI_SETTINGS.browser.url
        suffix = yield self.__urlMacros.parse(GUI_SETTINGS.browser.params)
        concatenator = '&' if '?' in url else '?'
        if suffix not in url:
            url = concatenator.join([url, suffix])
        size = browserSize or BROWSER.SIZE
        background = background or BROWSER.BACKGROUND
        if browserID is None:
            browserID = self.__browserIDGenerator.next()
        if browserID not in self.__browsers:
            texture = self._BROWSER_TEXTURE if isDefault else self._ALT_BROWSER_TEXTURE
            app = g_appLoader.getApp()
            if not app:
                raise AssertionError('Application can not be None')
                self.__browsers[browserID] = WebBrowser(browserID, app, texture, size, url, backgroundUrl=background)
                self.onBrowserAdded(browserID)
            ctx = {'url': url,
             'title': title,
             'showActionBtn': showActionBtn,
             'showWaiting': showWaiting,
             'browserID': browserID,
             'size': size,
             'isDefault': isDefault,
             'isAsync': isAsync,
             'showCloseBtn': showCloseBtn}

            def browserCallback(*args):
                self.__clearCallback(browserID)
                self.__showBrowser(browserID, ctx)

            def browserAsyncCallback(url, isLoaded):
                self.__clearCallback(browserID)
                if isLoaded:
                    self.__showBrowser(browserID, ctx)
                else:
                    LOG_WARNING('Browser async request url was not loaded!', url)

            self.__browsersCallbacks[browserID] = isAsync and (None, browserCallback)
            self.__browsers[browserID].onLoadEnd += browserAsyncCallback
        else:
            self.__browsersCallbacks[browserID] = (browserCallback, None)
            self.__browsers[browserID].onLoadStart += browserCallback
        callback(browserID)
        return
    def browser(self, cmd, ctx):
        if 'browser_id' in ctx:
            windowAlias = getViewName(ctx['browser_alias'], ctx['browser_id'])
            app = g_appLoader.getApp()
            if app is not None and app.containerManager is not None:
                supportedBrowserViewTypes = (ViewTypes.WINDOW, ViewTypes.OVERLAY)
                browserWindow = None
                for viewType in supportedBrowserViewTypes:
                    browserWindow = app.containerManager.getView(viewType, criteria={POP_UP_CRITERIA.UNIQUE_NAME: windowAlias})
                    if browserWindow is not None:
                        break

                if browserWindow is not None:
                    browserWindow.destroy()
                else:
                    raise WebCommandException('Browser window could not be found! May be alias "{}" is wrong or probably browser has unsupported viewType.'.format(windowAlias))
        self._onBrowserClose()
        return
 def load(self, url = None, title = None, showActionBtn = True, showWaiting = True, browserID = None, isAsync = False, browserSize = None, isDefault = True, callback = None, showCloseBtn = False, useBrowserWindow = True):
     url = yield self.__urlMacros.parse(url or GUI_SETTINGS.browser.url)
     suffix = yield self.__urlMacros.parse(GUI_SETTINGS.browser.params)
     concatenator = '&' if '?' in url else '?'
     if suffix not in url:
         url = concatenator.join([url, suffix])
     size = browserSize or BROWSER.SIZE
     webBrowserID = browserID
     if browserID is None:
         browserID = self.__browserIDGenerator.next()
         webBrowserID = browserID
     elif type(browserID) is not int:
         webBrowserID = self.__browserIDGenerator.next()
     ctx = {'url': url,
      'title': title,
      'showActionBtn': showActionBtn,
      'showWaiting': showWaiting,
      'browserID': browserID,
      'size': size,
      'isAsync': isAsync,
      'showCloseBtn': showCloseBtn,
      'showWindow': useBrowserWindow}
     texture = browserID not in self.__browsers and browserID not in self.__pendingBrowsers and self._BROWSER_TEXTURE
     app = g_appLoader.getApp()
     if not app:
         raise AssertionError('Application can not be None')
         browser = WebBrowser(webBrowserID, app, texture, size, url, handlers=self.__filters)
         self.__browsers[browserID] = browser
         if self.__isCreatingBrowser():
             self.__pendingBrowsers[browserID] = ctx
         else:
             self.__createBrowser(ctx)
     elif browserID in self.__pendingBrowsers:
         self.__pendingBrowsers[browserID] = ctx
     elif browserID in self.__browsers:
         self.__browsers[browserID].navigate(url)
     callback(browserID)
     return
    def load(self, url = None, title = None, showActionBtn = True, showWaiting = True, browserID = None, isAsync = False, browserSize = None, background = None, isDefault = True, callback = None, showCloseBtn = False):
        url = url or GUI_SETTINGS.browser.url
        suffix = yield self.__urlMacros.parse(GUI_SETTINGS.browser.params)
        concatenator = '&' if '?' in url else '?'
        if suffix not in url:
            url = concatenator.join([url, suffix])
        size = browserSize or BROWSER.SIZE
        background = background or BROWSER.BACKGROUND
        if browserID is None:
            browserID = self.__browserIDGenerator.next()
        if browserID not in self.__browsers:
            texture = self._BROWSER_TEXTURE if isDefault else self._ALT_BROWSER_TEXTURE
            app = g_appLoader.getApp()
            assert app, 'Application can not be None'
            self.__browsers[browserID] = WebBrowser(browserID, app, texture, size, url, backgroundUrl=background)
            self.onBrowserAdded(browserID)
        ctx = {'url': url,
         'title': title,
         'showActionBtn': showActionBtn,
         'showWaiting': showWaiting,
         'browserID': browserID,
         'size': size,
         'isDefault': isDefault,
         'isAsync': isAsync,
         'showCloseBtn': showCloseBtn}

        def browserCallback(*args):
            self.__clearCallback(browserID)
            self.__showBrowser(browserID, ctx)

        if isAsync:
            self.__browsersCallbacks[browserID] = (None, browserCallback)
            self.__browsers[browserID].onLoadEnd += browserCallback
        else:
            self.__browsersCallbacks[browserID] = (browserCallback, None)
            self.__browsers[browserID].onLoadStart += browserCallback
        callback(browserID)
Exemple #34
0
 def goToBattle(self):
     g_appLoader.getApp().loadView(SFViewLoadParams(CONSTANTS.VIEW_ALIAS))
def onhandleKeyEvent(event):
	key = getBigworldNameFromKey(event.key)
	if key == "KEY_F10":
		g_appLoader.getApp().loadView(SettingsUIWindow.NAME, SettingsUIWindow.NAME)
	return None
 def py_openAccMngr(self):
     g_appLoader.getApp().loadView('AccountsManager', 'AccountsManager')
Exemple #37
0
 def _finalize(self):
     toolTipMgr = g_appLoader.getApp().getToolTipMgr()
     if toolTipMgr is not None:
         toolTipMgr.hide()
     return
def _getLobby():
    return g_appLoader.getApp(app_settings.APP_NAME_SPACE.SF_LOBBY)
Exemple #39
0
def getCmpConfiguratorMainView():
    cmpConfiguratorMain = g_appLoader.getApp().containerManager.getView(ViewTypes.LOBBY_SUB, {POP_UP_CRITERIA.VIEW_ALIAS: VIEW_ALIAS.VEHICLE_COMPARE_MAIN_CONFIGURATOR})
    return cmpConfiguratorMain
Exemple #40
0
def _getTutorialManager():
    return g_appLoader.getApp().tutorialManager
Exemple #41
0
 def onAppInitialized(self, event):
     trace('onAppInitialized: {}'.format(event.ns))
     app = g_appLoader.getApp(event.ns)
     if app is not None and app.loaderManager is not None:
         app.loaderManager.onViewLoaded += self.onViewLoaded
def loadWindow(alias):
    g_appLoader.getApp().loadView(alias, alias)
Exemple #43
0
 def goToBattle(self):
     g_appLoader.getApp().loadView(ViewLoadParams(CONSTANTS.VIEW_ALIAS))
Exemple #44
0
 def onAppInitialized(self, event):
     trace('onAppInitialized: {}'.format(event.ns))
     app = g_appLoader.getApp(event.ns)
     if app is not None and app.loaderManager is not None:
         app.loaderManager.onViewLoaded += self.onViewLoaded
Exemple #45
0
def onhandleKeyEvent(event):
    key = getBigworldNameFromKey(event.key)
    if key == "KEY_F10":
        g_appLoader.getApp().loadView(SettingsUIWindow.NAME,
                                      SettingsUIWindow.NAME)
    return None