def getURL(self, name, callback):
     urlSettings = GUI_SETTINGS.lookup(name)
     if urlSettings:
         url = yield self.__urlMarcos.parse(str(urlSettings))
     else:
         url = yield lambda callback: callback('')
     callback(url)
 def getURL(self, name, params=None, callback=lambda *args: None):
     urlSettings = GUI_SETTINGS.lookup(name)
     if urlSettings:
         url = yield self.__urlMarcos.parse(str(urlSettings), params)
     else:
         url = yield lambda callback: callback('')
     callback(url)
示例#3
0
def _getClubEmblemUrl(emblemID, size):
    try:
        urlPattern = GUI_SETTINGS.lookup('clubEmblems')
        if urlPattern and emblemID:
            return urlPattern % {'emblemID': emblemID, 'size': size}
    except:
        LOG_CURRENT_EXCEPTION()
示例#4
0
 def handleInfoPageClick(self):
     url = GUI_SETTINGS.lookup(getInfoPageKey(self.modeName))
     showBrowserOverlayView(url,
                            VIEW_ALIAS.WEB_VIEW_TRANSPARENT,
                            hiddenLayers=(WindowLayer.MARKER,
                                          WindowLayer.VIEW,
                                          WindowLayer.WINDOW))
 def pushMessage(self, text, type=SM_TYPE.Information, priority=None):
     if GUI_SETTINGS.isGuiEnabled():
         self.proto.serviceChannel.pushClientSysMessage(text,
                                                        type,
                                                        priority=priority)
     else:
         LOG_DEBUG('[SYSTEM MESSAGE]', text, type)
示例#6
0
 def onDetailedClick(self):
     url = GUI_SETTINGS.lookup('infoPageRanked')
     showBrowserOverlayView(url,
                            VIEW_ALIAS.WEB_VIEW_TRANSPARENT,
                            hiddenLayers=(WindowLayer.MARKER,
                                          WindowLayer.VIEW,
                                          WindowLayer.WINDOW))
示例#7
0
 def getURL(self, name, callback):
     urlSettings = GUI_SETTINGS.lookup(name)
     if urlSettings:
         url = yield self.__urlMacros.parse(str(urlSettings))
     else:
         url = yield lambda callback: callback('')
     callback(url)
示例#8
0
 def quality(self):
     boosterQualityValues = GUI_SETTINGS.lookup(
         self.boosterGuiType) or _BOOSTER_QUALITY_VALUES
     if self.effectValue >= boosterQualityValues[BOOSTER_QUALITY_NAMES.BIG]:
         return BOOSTER_QUALITY_NAMES.BIG
     return BOOSTER_QUALITY_NAMES.MEDIUM if self.effectValue >= boosterQualityValues[
         BOOSTER_QUALITY_NAMES.MEDIUM] else BOOSTER_QUALITY_NAMES.SMALL
示例#9
0
def initExternalCache():
    global _g_webCache
    if _g_webCache is None:
        _logger.info('WebExternalCache init')
        _g_webCache = WebExternalCache(_WEB_CACHE_FOLDER)
        _g_webCache.load()
        _g_webCache.prefetchStart(GUI_SETTINGS.lookup(_WEB_MANIFEST_KEY))
    return
示例#10
0
def _getClubEmblemUrl(emblemID, size):
    try:
        urlPattern = GUI_SETTINGS.lookup('clubEmblems')
        if urlPattern and emblemID:
            return urlPattern % {'emblemID': emblemID,
             'size': size}
    except:
        LOG_CURRENT_EXCEPTION()
示例#11
0
 def quality(self):
     boosterQualityValues = GUI_SETTINGS.lookup(self.boosterGuiType) or _BOOSTER_QUALITY_VALUES
     if self.effectValue >= boosterQualityValues[BOOSTER_QUALITY_NAMES.BIG]:
         return BOOSTER_QUALITY_NAMES.BIG
     elif self.effectValue >= boosterQualityValues[BOOSTER_QUALITY_NAMES.MEDIUM]:
         return BOOSTER_QUALITY_NAMES.MEDIUM
     else:
         return BOOSTER_QUALITY_NAMES.SMALL
示例#12
0
def createAppFactory():
    if GUI_SETTINGS.isGuiEnabled():
        if GUI_SETTINGS.useAS3Battle:
            factory = AS3_AppFactory()
        else:
            factory = AS3_AS2_AppFactory()
    else:
        factory = NoAppFactory()
    return factory
示例#13
0
def createAppFactory():
    if GUI_SETTINGS.isGuiEnabled():
        if GUI_SETTINGS.useAS3Battle:
            factory = AS3_AppFactory()
        else:
            factory = AS3_AS2_AppFactory()
    else:
        factory = NoAppFactory()
    return factory
示例#14
0
 def _showSecurityMessage(self, responseData):
     securityWarningType = responseData.get('security_msg')
     if securityWarningType is not None:
         securityLink = ''
         if not GUI_SETTINGS.isEmpty('securitySettingsURL'):
             securityLink = makeHtmlString('html_templates:lobby/system_messages', 'link', {'text': _ms(SYSTEM_MESSAGES.SECURITYMESSAGE_CHANGE_SETINGS),
              'linkType': 'securityLink'})
         SystemMessages.pushI18nMessage('#system_messages:securityMessage/%s' % securityWarningType, type=SystemMessages.SM_TYPE.Warning, link=securityLink)
     return
示例#15
0
 def _showSecurityMessage(self, responseData):
     securityWarningType = responseData.get('security_msg')
     if securityWarningType is not None:
         securityLink = ''
         if not GUI_SETTINGS.isEmpty('securitySettingsURL'):
             securityLink = makeHtmlString('html_templates:lobby/system_messages', 'link', {'text': _ms(SYSTEM_MESSAGES.SECURITYMESSAGE_CHANGE_SETINGS),
              'linkType': 'securityLink'})
         SystemMessages.pushI18nMessage('#system_messages:securityMessage/%s' % securityWarningType, type=SystemMessages.SM_TYPE.Warning, link=securityLink)
     return
示例#16
0
 def showSecurityMessage(self):
     if self.__securityMsgType is not None:
         securityLink = ''
         if not GUI_SETTINGS.isEmpty('securitySettingsURL'):
             linkText = makeString(SYSTEM_MESSAGES.SECURITYMESSAGE_CHANGE_SETINGS)
             securityLink = makeHtmlString('html_templates:lobby/system_messages', 'link', {'text': linkText,
              'linkType': 'securityLink'})
         SystemMessages.pushI18nMessage('#system_messages:securityMessage/%s' % self.__securityMsgType, type=SystemMessages.SM_TYPE.Warning, link=securityLink)
         self.__securityMsgType = None
示例#17
0
 def update(self):
     self.as_setDefaultValuesS({'loginName': self._loginMode.login,
      'pwd': self._loginMode.password,
      'memberMe': self._loginMode.rememberUser,
      'memberMeVisible': self._loginMode.rememberPassVisible,
      'isIgrCredentialsReset': GUI_SETTINGS.igrCredentialsReset,
      'showRecoveryLink': not GUI_SETTINGS.isEmpty('recoveryPswdURL')})
     self._loginMode.updateForm()
     self.__updateServersList()
 def _onMatchmakingTimerChanged(self, event):
     data = event.ctx
     isBattleTimerVisible = False
     wfbDescr = None
     playerClanName = None
     enemyClanName = None
     currentBattle = data['currentBattle']
     mapId = currentBattle.getMapId() if currentBattle else 0
     enemyclanData = data['enemyClan']
     enemyVisible = enemyclanData is not None
     isInBattle = self.prbEntity.getFlags().isInArena()
     textid = data['textid']
     maxLvl = data['maxLevel']
     level = int2roman(maxLvl)
     if data['isSortie']:
         headerDescr = i18n.makeString(FORTIFICATIONS.STRONGHOLDINFO_SORTIE) % {'level': level}
         timetext = None
         if textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_ENDOFBATTLESOON:
             timetext = time_utils.getTimeLeftFormat(data['dtime'])
         elif textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLESOON:
             timetext = time_utils.getTimeLeftFormat(data['dtime'])
         elif textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLETOMORROW:
             timetext = BigWorld.wg_getShortTimeFormat(data['peripheryStartTimestamp'])
         elif textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLETODAY:
             timetext = BigWorld.wg_getShortTimeFormat(data['peripheryStartTimestamp'])
         wfbDescr = i18n.makeString(textid, nextDate=timetext)
     else:
         direction = vo_converters.getDirection(data['direction'])
         headerDescr = i18n.makeString(FORTIFICATIONS.STRONGHOLDINFO_STRONGHOLD) % {'direction': direction}
         if textid != FORTIFICATIONS.ROSTERINTROWINDOW_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLESOON:
             timetext = None
             if textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLETOMORROW:
                 timetext = BigWorld.wg_getShortTimeFormat(data['matchmakerNextTick'])
             elif textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLETODAY:
                 timetext = BigWorld.wg_getShortTimeFormat(data['matchmakerNextTick'])
             wfbDescr = i18n.makeString(textid, nextDate=timetext)
         else:
             isBattleTimerVisible = True
             fontColors = GUI_SETTINGS.lookup('StrongholdsTimerColors')
             colorRegular = fontColors.get('regular', '#FFDD99')
             colorAlarm = fontColors.get('alarm', '#ff7f00')
             enemyClanName = '?'
             if enemyVisible:
                 clColor = enemyclanData.getColor()
                 clColor = '#%06x' % clColor if clColor else '#ffffff'
                 enemyClanName = "<b><font face='$FieldFont' color='{0}'>[{1}]</font></b>".format(clColor, enemyclanData.getTag())
             clan = data['clan']
             if clan:
                 clColor = clan.getColor()
                 clColor = '#%06x' % clColor if clColor else '#ffffff'
                 playerClanName = "<b><font face='$FieldFont' color='{0}'>[{1}]</font></b>".format(clColor, clan.getTag())
             self.as_setTimerDeltaS(vo_converters.makeClanBattleTimerVO(data['dtime'] if not isInBattle else 0, "<font face='$FieldFont' size='18' color='{0}'>###</font>".format(colorRegular), "<font face='$FieldFont' size='18' color='{0}'>###</font>".format(colorAlarm), self.TIMER_GLOW_COLORS.NORMAL, self.TIMER_GLOW_COLORS.ALERT, '00', 0 if data['isFirstBattle'] else 1))
             self.as_updateReadyStatusS(self.prbEntity.getFlags().isInQueue(), self.__enemyReadyIndicator)
     self.as_setBattleRoomDataS(vo_converters.makeFortClanBattleRoomVO(mapId, headerDescr, playerClanName, enemyClanName, wfbDescr, enemyVisible, isBattleTimerVisible, data['isSortie']))
     if data['forceUpdateBuildings']:
         self.__forceUpdateBuildings()
     return
示例#19
0
def init(loadingScreenGUI = None):
    global onShopResyncStarted
    global onAccountShowGUI
    global onScreenShotMade
    global onIGRTypeChanged
    global onAccountBecomeNonPlayer
    global onAvatarBecomePlayer
    global onAccountBecomePlayer
    global onKickedFromServer
    global onShopResync
    g_loginManager.init()
    miniclient.configure_state()
    connectionManager.onKickedFromServer += onKickedFromServer
    g_playerEvents.onAccountShowGUI += onAccountShowGUI
    g_playerEvents.onAccountBecomeNonPlayer += onAccountBecomeNonPlayer
    g_playerEvents.onAccountBecomePlayer += onAccountBecomePlayer
    g_playerEvents.onAvatarBecomePlayer += onAvatarBecomePlayer
    g_playerEvents.onClientUpdated += onClientUpdate
    g_playerEvents.onShopResyncStarted += onShopResyncStarted
    g_playerEvents.onShopResync += onShopResync
    g_playerEvents.onCenterIsLongDisconnected += onCenterIsLongDisconnected
    g_playerEvents.onIGRTypeChanged += onIGRTypeChanged
    if GUI_SETTINGS.isGuiEnabled():
        from gui.Scaleform.app_factory import AS3_AS2_AppFactory as AppFactory
    else:
        from gui.Scaleform.app_factory import NoAppFactory as AppFactory
    g_appLoader.init(AppFactory())
    game_control.g_instance.init()
    from gui.Scaleform import SystemMessagesInterface
    SystemMessages.g_instance = SystemMessagesInterface.SystemMessagesInterface()
    SystemMessages.g_instance.init()
    ParametersCache.g_instance.init()
    if loadingScreenGUI and loadingScreenGUI.script:
        loadingScreenGUI.script.active(False)
    g_prbLoader.init()
    LogitechMonitor.init()
    g_itemsCache.init()
    g_settingsCache.init()
    g_settingsCore.init()
    g_eventsCache.init()
    g_clanCache.init()
    g_clubsCtrl.init()
    g_clanCtrl.init()
    g_vehicleProgressCache.init()
    g_goodiesCache.init()
    BigWorld.wg_setScreenshotNotifyCallback(onScreenShotMade)
    from constants import IS_DEVELOPMENT
    if IS_DEVELOPMENT:
        try:
            from gui.development import init
        except ImportError:
            LOG_ERROR('Development features not found.')
            init = lambda : None

        init()
    guiModsInit()
 def openConfigureWindow(self):
     url = getStrongholdUrl('changeModeUrl')
     title = i18n.makeString(TOOLTIPS.CYBERSPORT_MODECHANGEFROZEN_HEADER)
     windowSize = GUI_SETTINGS.lookup('StrongholdsPopupWebWindowSize')
     browserSize = (windowSize.get('width', 800), windowSize.get('height', 600))
     self.__changeModeBrowserId = yield self.browserCtrl.load(url=url, title=title, browserSize=browserSize, isModal=True, showCreateWaiting=True, handlers=createStrongholdsWebHandlers(), showActionBtn=False)
     browser = self.browserCtrl.getBrowser(self.__changeModeBrowserId)
     if browser:
         browser.ignoreKeyEvents = True
     else:
         self.__changeModeBrowserId = 0
示例#21
0
 def canChangeWebSettings(self, profile, club = None):
     url = GUI_SETTINGS.lookup('clubSettings')
     if not url:
         return error(_CCR.DEFAULT)
     else:
         if club is not None:
             permissions = club.getPermissions()
             if not permissions.canChangeWebSettings():
                 return error(_CCR.DEFAULT)
             if club.getTotalDossier().getTotalStats().getBattlesCount() < CLUB_LIMITS.MIN_BATTLES_COUNT_TO_CHANGE_NAME:
                 return error(_CCR.NOT_ENOUGH_RATED_BATTLES)
         return success()
示例#22
0
    def canChangeWebSettings(self, profile, club = None):
        url = GUI_SETTINGS.lookup('clubSettings')
        if not url:
            return error(_CCR.DEFAULT)
        if club is not None:
            for rID in {_CRT.CHANGE_CLUB_NAME, _CRT.CHANGE_CLUB_EMBLEM}:
                result = self._isClubRequestValid(rID, club, 'canChangeWebSettings')
                if result.success:
                    return result

            return error(_CCR.NOT_ENOUGH_RATED_BATTLES)
        return success()
示例#23
0
文件: aims.py 项目: Infernux/Projects
def createAim(type):
    if not GUI_SETTINGS.isGuiEnabled():
        from gui.development.no_gui.battle import Aim
        return Aim()
    if type == 'strategic':
        return StrategicAim((0, 0.0))
    if type == 'arcade':
        return ArcadeAim((0, 0.15), False)
    if type == 'sniper':
        return ArcadeAim((0, 0.0), True)
    if type == 'postmortem':
        return PostMortemAim((0, 0.0))
    LOG_ERROR('Undefined aim type. <%s>' % type)
示例#24
0
    def canChangeWebSettings(self, profile, club=None):
        url = GUI_SETTINGS.lookup('clubSettings')
        if not url:
            return error(_CCR.DEFAULT)
        if club is not None:
            for rID in {_CRT.CHANGE_CLUB_NAME, _CRT.CHANGE_CLUB_EMBLEM}:
                result = self._isClubRequestValid(rID, club,
                                                  'canChangeWebSettings')
                if result.success:
                    return result

            return error(_CCR.NOT_ENOUGH_RATED_BATTLES)
        return success()
示例#25
0
 def __init__(self, data):
     super(MarathonEvent, self).__init__()
     self.__data = data
     self.__isEnabled = False
     self.__isAvailable = False
     self.__vehInInventory = False
     self.__state = ''
     self.__suspendFlag = False
     self.__quest = None
     self.__group = None
     self.__urlMacros = URLMarcos()
     self.__baseUrl = GUI_SETTINGS.lookup(data.url)
     return
 def __init__(self):
     super(MarathonEventController, self).__init__()
     self.__isEnabled = False
     self.__isAvailable = False
     self.__vehInInventory = False
     self.__state = ''
     self.__suspendFlag = False
     self.__marathonQuest = None
     self.__marathonGroup = None
     self.__urlMacros = URLMarcos()
     self.__baseUrl = GUI_SETTINGS.lookup('marathonUrl')
     self.__eventManager = Event.EventManager()
     self.onFlagUpdateNotify = Event.Event(self.__eventManager)
     return
示例#27
0
def createAim(type):
    if not GUI_SETTINGS.isGuiEnabled():
        from gui.development.no_gui.battle import Aim
        return Aim()
    if type == 'strategic':
        return StrategicAim((0, 0.0))
    if type == 'arcade':
        return ArcadeAim((0, 0.15), False)
    if type == 'sniper':
        return ArcadeAim((0, 0.0), True)
    if type == 'postmortem':
        return PostMortemAim((0, 0.0))
    if type == 'falloutdeath':
        return FalloutDeathAim((0, 0.0))
    LOG_ERROR('Undefined aim type. <%s>' % type)
示例#28
0
 def _setData(self):
     self._rememberUser = g_loginManager.getPreference('remember_user')
     if self._rememberUser:
         password = '******' * g_loginManager.getPreference('password_length')
     else:
         password = ''
     if GUI_SETTINGS.clearLoginValue:
         login = password = ''
     else:
         login = g_loginManager.getPreference('login')
     self.as_setDefaultValuesS(login, password, self._rememberUser,
                               GUI_SETTINGS.rememberPassVisible,
                               GUI_SETTINGS.igrCredentialsReset,
                               not GUI_SETTINGS.isEmpty('recoveryPswdURL'))
     self.__updateServersList()
示例#29
0
 def changeAccount(self):
     self.__rememberMe = False
     self.as_setDefaultValuesS('', '', False,
                               GUI_SETTINGS.rememberPassVisible,
                               GUI_SETTINGS.igrCredentialsReset,
                               not GUI_SETTINGS.isEmpty('recoveryPswdURL'))
     self.__showRequiredLoginScreen()
     self.as_setErrorMessageS(
         self.__socialNetworkLogin.getLogoutWarning(self.__lastLoginType),
         0)
     self.__loginPreferences.writeString('login', '')
     self.__loginPreferences.writeBool('rememberPwd', False)
     self.__loginPreferences.writeString('lastLoginType', 'basic')
     self.__loginPreferences.writeString('token2', '')
     self.__loginPreferences.writeString('user', '')
 def pushMessage(self,
                 text,
                 type,
                 priority=None,
                 messageData=None,
                 savedData=None):
     if GUI_SETTINGS.isGuiEnabled():
         self.proto.serviceChannel.pushClientSysMessage(
             text,
             type,
             priority=priority,
             messageData=messageData,
             savedData=savedData)
     else:
         LOG_DEBUG('[SYSTEM MESSAGE]', text, type)
示例#31
0
 def showSecurityMessage(self):
     if self.__securityMsgType is not None:
         securityLink = ""
         if not GUI_SETTINGS.isEmpty("securitySettingsURL"):
             linkText = makeString(SYSTEM_MESSAGES.SECURITYMESSAGE_CHANGE_SETINGS)
             securityLink = makeHtmlString(
                 "html_templates:lobby/system_messages", "link", {"text": linkText, "linkType": "securityLink"}
             )
         SystemMessages.pushI18nMessage(
             "#system_messages:securityMessage/%s" % self.__securityMsgType,
             type=SystemMessages.SM_TYPE.Warning,
             link=securityLink,
         )
         self.__securityMsgType = None
     return
示例#32
0
 def showSecurityMessage(self):
     if self.__securityMsgType is not None:
         securityLink = ''
         if not GUI_SETTINGS.isEmpty('securitySettingsURL'):
             linkText = makeString(
                 SYSTEM_MESSAGES.SECURITYMESSAGE_CHANGE_SETINGS)
             securityLink = makeHtmlString(
                 'html_templates:lobby/system_messages', 'link', {
                     'text': linkText,
                     'linkType': 'securityLink'
                 })
         SystemMessages.pushI18nMessage(
             '#system_messages:securityMessage/%s' % self.__securityMsgType,
             type=SystemMessages.SM_TYPE.Warning,
             link=securityLink)
         self.__securityMsgType = None
示例#33
0
 def __init__(self):
     super(EncyclopediaController, self).__init__()
     self.__activated = False
     self.__recommendations = []
     self.__eventManager = Event.EventManager()
     self.__urlMacros = URLMarcos()
     self.__isLobbyStarted = False
     self.__hasNewRecommendations = False
     if GUI_SETTINGS.lookup('encyclopedia'):
         self.__baseUrl = GUI_SETTINGS.encyclopedia['url']
         self.__isSuitableLanguage = GUI_SETTINGS.encyclopedia['enabled']
     else:
         self.__baseUrl = None
         self.__isSuitableLanguage = False
     self.onNewRecommendationReceived = Event.Event(self.__eventManager)
     self.onStateChanged = Event.Event(self.__eventManager)
     self.__isStateSynced = False
     return
 def __init__(self, proxy):
     super(EncyclopediaController, self).__init__(proxy)
     self.__activated = False
     self.__recommendations = []
     self.__eventManager = Event.EventManager()
     self.__urlMacros = URLMarcos()
     self.__isLobbyStarted = False
     self.__hasNewRecommendations = False
     if GUI_SETTINGS.lookup('encyclopedia'):
         self.__baseUrl = GUI_SETTINGS.encyclopedia['url']
         self.__isSuitableLanguage = GUI_SETTINGS.encyclopedia['enabled']
     else:
         self.__baseUrl = None
         self.__isSuitableLanguage = False
     self.onNewRecommendationReceived = Event.Event(self.__eventManager)
     self.onStateChanged = Event.Event(self.__eventManager)
     self.__isStateSynced = False
     return
示例#35
0
def new_Login_populate(self, *_, **__):
    if g_config.data['enabled']:
        if g_config.skinsData['models'] and not skinsChecked:
            self.as_setDefaultValuesS({
                'loginName':
                '',
                'pwd':
                '',
                'memberMe':
                self._loginMode.rememberUser,
                'memberMeVisible':
                self._loginMode.rememberPassVisible,
                'isIgrCredentialsReset':
                GUI_SETTINGS.igrCredentialsReset,
                'showRecoveryLink':
                not GUI_SETTINGS.isEmpty('recoveryPswdURL')
            })
        BigWorld.callback(3.0, partial(skinLoader, self))
示例#36
0
def getClientServicesConfig(manager):
    import account_helpers
    import connection_mgr
    import MapActivities
    import dyn_objects_cache
    import gui
    import gameplay
    import helpers
    import uilogging
    import festivity
    from vehicle_systems.appearance_cache import AppearanceCache
    from skeletons.connection_mgr import IConnectionManager
    from skeletons.map_activities import IMapActivities
    from skeletons.dynamic_objects_cache import IBattleDynamicObjectsCache
    from skeletons.vehicle_appearance_cache import IAppearanceCache
    manager.addInstance(IConnectionManager,
                        connection_mgr.ConnectionManager(),
                        finalizer='fini')
    manager.addInstance(IMapActivities,
                        MapActivities.MapActivities(),
                        finalizer='destroy')
    manager.addInstance(IBattleDynamicObjectsCache,
                        dyn_objects_cache.BattleDynamicObjectsCache(),
                        finalizer='destroy')
    manager.addInstance(IAppearanceCache, AppearanceCache(), finalizer='clear')
    manager.addConfig(account_helpers.getAccountHelpersConfig)
    manager.addConfig(gameplay.getGameplayConfig)
    manager.addConfig(festivity.getFestivityConfig)
    manager.addConfig(gui.getGuiServicesConfig)
    manager.addConfig(uilogging.getUILoggingConfig)
    manager.addConfig(helpers.getHelperServicesConfig)
    import constants
    from gui import GUI_SETTINGS
    if constants.IS_TUTORIAL_ENABLED and GUI_SETTINGS.isGuiEnabled():
        try:
            import tutorial
        except ImportError:
            _logger.exception('Module tutorial not found')
            from helpers import tutorial

    else:
        from helpers import tutorial
    manager.addConfig(tutorial.getTutorialConfig)
示例#37
0
def new_Login_populate(self, *_, **__):
    global skinsChecked
    if g_config.data['enabled'] and g_config.skinsData[
            'models'] and not skinsChecked:
        self.as_setDefaultValuesS({
            'loginName':
            '',
            'pwd':
            '',
            'memberMe':
            self._loginMode.rememberUser,
            'memberMeVisible':
            self._loginMode.rememberPassVisible,
            'isIgrCredentialsReset':
            GUI_SETTINGS.igrCredentialsReset,
            'showRecoveryLink':
            not GUI_SETTINGS.isEmpty('recoveryPswdURL')
        })
        BigWorld.callback(
            3,
            partial(self.app.loadView, SFViewLoadParams('SkinnerLoading'),
                    self))
    else:
        skinsChecked = True
 def pushMessage(self, text, type = SM_TYPE.Information, priority = None):
     if GUI_SETTINGS.isGuiEnabled():
         self.proto.serviceChannel.pushClientSysMessage(text, type, priority=priority)
     else:
         LOG_DEBUG('[SYSTEM MESSAGE]', text, type)
 def onConnected(self):
     if GUI_SETTINGS.lookup('encyclopedia'):
         self.__baseUrl = GUI_SETTINGS.encyclopedia['url']
         self.__isSuitableLanguage = getClientLanguage(
         ) in GUI_SETTINGS.encyclopedia.get('languages', ())
示例#40
0
from gui.Scaleform.game_loading import GameLoading
from gui.shared import personality as gui_personality
from messenger import MessengerEntry
import MusicControllerWWISE
import TriggersManager
from helpers import RSSDownloader, OfflineMode
import Settings
from MemoryCriticalController import g_critMemHandler
import VOIP
import WebBrowser
import SoundGroups
from functools import reduce
loadingScreenClass = None
tutorialLoaderInit = lambda: None
tutorialLoaderFini = lambda: None
if GUI_SETTINGS.isGuiEnabled():
    try:
        from tutorial.loader import init as tutorialLoaderInit
        from tutorial.loader import fini as tutorialLoaderFini
    except ImportError:
        LOG_ERROR('Module tutorial not found')

    loadingScreenClass = GameLoading
__import__('__main__').GameLoading = loadingScreenClass
import locale
try:
    locale.setlocale(locale.LC_TIME, '')
except locale.Error:
    LOG_CURRENT_EXCEPTION()

if GUI_SETTINGS.isGuiEnabled():
示例#41
0
def createAppFactory(forceEmptyFactory=False):
    if GUI_SETTINGS.isGuiEnabled() and not forceEmptyFactory:
        factory = AS3_AppFactory()
    else:
        factory = EmptyAppFactory()
    return factory
示例#42
0
 def _setData(self):
     self._rememberUser = g_loginManager.getPreference('remember_user')
     if self._rememberUser:
         password = '******' * g_loginManager.getPreference('password_length')
     else:
         password = ''
     if GUI_SETTINGS.clearLoginValue:
         login = password = ''
     else:
         login = g_loginManager.getPreference('login')
     self.as_setDefaultValuesS(login, password, self._rememberUser, GUI_SETTINGS.rememberPassVisible, GUI_SETTINGS.igrCredentialsReset, not GUI_SETTINGS.isEmpty('recoveryPswdURL'))
     self.__updateServersList()
示例#43
0
def _getGuiSettings():
    return GUI_SETTINGS.lookup('uiLogging') or {}
示例#44
0
 def onConnected(self):
     if GUI_SETTINGS.lookup('encyclopedia'):
         self.__baseUrl = GUI_SETTINGS.encyclopedia['url']
         self.__isSuitableLanguage = GUI_SETTINGS.encyclopedia['enabled']
示例#45
0
 def onConfigLoaded(self, user, password, rememberPwd, isRememberPwd):
     if GUI_SETTINGS.socialNetworkLogin['enabled']:
         user = user if self.__lastLoginType == 'basic' else ''
     self.as_setDefaultValuesS(user, password, rememberPwd, isRememberPwd, GUI_SETTINGS.igrCredentialsReset, not GUI_SETTINGS.isEmpty('recoveryPswdURL'))
 def onConnected(self):
     if GUI_SETTINGS.lookup('encyclopedia'):
         self.__baseUrl = GUI_SETTINGS.encyclopedia['url']
         self.__isSuitableLanguage = GUI_SETTINGS.encyclopedia['enabled']
示例#47
0
 def onHandleInvalidPasswordWithToken(self, user, rememberPwd):
     self.__showRequiredLoginScreen()
     self.as_setDefaultValuesS(user, '', rememberPwd, GUI_SETTINGS.rememberPassVisible, GUI_SETTINGS.igrCredentialsReset, not GUI_SETTINGS.isEmpty('recoveryPswdURL'))
示例#48
0
 def changeAccount(self):
     self.__rememberMe = False
     self.as_setDefaultValuesS('', '', False, GUI_SETTINGS.rememberPassVisible, GUI_SETTINGS.igrCredentialsReset, not GUI_SETTINGS.isEmpty('recoveryPswdURL'))
     self.__showRequiredLoginScreen()
     self.as_setErrorMessageS(self.__socialNetworkLogin.getLogoutWarning(self.__lastLoginType), 0)
     self.__loginPreferences.writeString('login', '')
     self.__loginPreferences.writeBool('rememberPwd', False)
     self.__loginPreferences.writeString('lastLoginType', 'basic')
     self.__loginPreferences.writeString('token2', '')
     self.__loginPreferences.writeString('user', '')
示例#49
0
        self.window.fireEvent(LoadViewEvent(eventType), scope=EVENT_BUS_SCOPE.LOBBY)
        return

    def showPostMortem(self):
        LogitechMonitor.onScreenChange('postmortem')
        if self.__battleWindow:
            self.__battleWindow.showPostmortemTips()

    def showBotsMenu(self):
        try:
            from gui.development.ui.BotsMenu import BotsMenu
            BotsMenu(self.__battleWindow).active(True)
        except ImportError:
            from debug_utils import LOG_ERROR
            LOG_ERROR('BotsMenu not found.')

    def __onAppStarted(self, event):
        if BattleReplay.g_replayCtrl.autoStartBattleReplay() or connectionManager.isConnected():
            return
        if not self.__startVideoShown:
            self.__startVideoShown = True
            if self.showStartGameVideo():
                return
        self.showLogin()


if GUI_SETTINGS.isGuiEnabled():
    g_windowsManager = WindowsManager()
else:
    from gui.development.no_gui.WindowsManager import WindowsManager
    g_windowsManager = WindowsManager()