Ejemplo n.º 1
0
 def viewLoadError(self, token, name, errorTxt):
     msg = 'Error during view {0} load. Token: {1}, error:{2}'
     msg = msg.format(name, token, errorTxt)
     LOG_ERROR(msg)
     item = None
     if token in self.__tokens:
         item = self.__tokens.pop(token)
     self.onViewLoadError(token, msg, item)
     if item is not None:
         settings = item.pyEntity.settings
         if constants.IS_DEVELOPMENT and settings.url != NO_IMPL_URL:
             g_entitiesFactories.addSettings(ViewSettings(NO_IMPL_ALIAS, View, NO_IMPL_URL, settings.type, None, ScopeTemplates.DEFAULT))
             LOG_WARNING('Try to load noImpl swf...')
             self.__loadViewForToken(NO_IMPL_ALIAS, item.name, token)
Ejemplo n.º 2
0
 def viewLoadError(self, alias, name, errorTxt):
     msg = 'Error during view {0} load. Name: {1}, error:{2}'
     msg = msg.format(alias, name, errorTxt)
     LOG_ERROR(msg)
     item = None
     if name in self.__nameToLoadingItem:
         item = self.__nameToLoadingItem.pop(name)
     self.onViewLoadError(name, msg, item)
     if item is not None:
         settings = item.pyEntity.settings
         if constants.IS_DEVELOPMENT and settings.url != NO_IMPL_URL:
             g_entitiesFactories.addSettings(ViewSettings(NO_IMPL_ALIAS, View, NO_IMPL_URL, settings.type, None, ScopeTemplates.DEFAULT_SCOPE))
             LOG_WARNING('Try to load noImpl swf...')
             self.__doLoadView(NO_IMPL_ALIAS, item.name)
    def processPopulate(self):
        if self._isDAAPIInited():
            if g_AccMngr.isLobby:
                self.flashObject.as_populateLobby()
            else:
                self.flashObject.as_populateLogin()

    def py_log(self, text):
        print("[AccountsManagerLoginButton]: %s" % text)

    def py_openAccMngr(self):
        g_appLoader.getDefLobbyApp().loadView("AccountsManager")

    def py_getTranslate(self):
        return {"tooltip_l10n": "Account manager"}


g_AccMngr = AccountsManagerButtonController()

g_entitiesFactories.addSettings(
    ViewSettings(
        "AccountsManagerLoginButton",
        AccountsManagerLoginButton,
        "AccountsManager/AccountsManagerLoginButton.swf",
        ViewTypes.WINDOW,
        None,
        ScopeTemplates.GLOBAL_SCOPE,
    )
)
Ejemplo n.º 4
0
from xfw import *
from xvm_main.python.logger import *
from xvm_main.python.xvm import l10n

import contacts
import view


#####################################################################
# initialization

g_entitiesFactories.addSettings(ViewSettings(
    VIEW.XVM_EDIT_CONTACT_DATA_ALIAS,
    view.XvmEditContactDataView,
    None,
    ViewTypes.COMPONENT,
    None,
    ScopeTemplates.DEFAULT_SCOPE))


#####################################################################
# handlers

@registerEvent(ContactsListPopover, '_populate')
def ContactsListPopover_populate(self):
    #log('ContactsListPopover_populate')
    contacts.initialize()

@overrideClassMethod(ContactConverter, 'makeVO')
def ContactConverter_makeVO(base, cls, contact, useBigIcons = False):
Ejemplo n.º 5
0
""" xvm (c) sirmax 2013-2014 """

import BigWorld
import BattleReplay
from gui.WindowsManager import g_windowsManager
from ConnectionManager import connectionManager
from gui.Scaleform.framework import g_entitiesFactories, ViewSettings, ViewTypes, ScopeTemplates
from gui.Scaleform.framework.entities.View import View

from logger import *

_alias = 'xvm'
_url = '../../../xvm/mods/xvm.swf'
_viewType = ViewTypes.SERVICE_LAYOUT
_scopeTemplate = ScopeTemplates.GLOBAL_SCOPE
_settings = ViewSettings(_alias, View, _url, _viewType, None, _scopeTemplate)
g_entitiesFactories.addSettings(_settings)

def AppStarted(event):
    #debug('AppStarted')
    app = g_windowsManager.window
    if app is not None:
        if BattleReplay.g_replayCtrl.autoStartBattleReplay() or connectionManager.isConnected():
            app.loadView(_alias)
        else:
            BigWorld.callback(0, lambda: app.loadView(_alias))
                        if hasattr(player, 'databaseID'):
                            playerID = player.databaseID
                        else:
                            playerID = player.arena.vehicles[player.playerVehicleID]['accountDBID']
                        if playerID != q['id']:
                            q['id'] = playerID
                        break
                BigWorld.wh_data.write_accounts()
                BigWorld.wh_data.renew_accounts()


BigWorld.wh_data = UserAccounts()

_aManagerAlias = 'AccountsManager'
_aManagerSettings = ViewSettings(_aManagerAlias, AccountsManager, 'AccountsManager.swf', ViewTypes.WINDOW, 'showAccountsManager', ScopeTemplates.DEFAULT_SCOPE)
g_entitiesFactories.addSettings(_aManagerSettings)

_aManagerSubAlias = 'AccountsManagerSubwindow'
_aManagerSubSettings = ViewSettings(_aManagerSubAlias, AccountsManagerSubwindow, 'AccountsManagerWindow.swf', ViewTypes.WINDOW, 'showAccountsManagerSubwindow', ScopeTemplates.DEFAULT_SCOPE)
g_entitiesFactories.addSettings(_aManagerSubSettings)


def inject_handle_key_event(event):
    is_down, key, mods, is_repeat = game.convertKeyEvent(event)
    if mods == Keys.MODIFIER_CTRL and key == Keys.KEY_B and is_down:
        loadWindow(_aManagerAlias)


# noinspection PyProtectedMember
hooked_update_all = Hangar._Hangar__updateAll
Ejemplo n.º 7
0
            files = glob.iglob('{}/*/{}/*.swf'.format(mods_dir, as_path))
            for m in files:
                m = '%s%s' % (_WOT_ROOT, m.replace('\\', '/').replace('//', '/'))
                # debug('[XFW] getMods: ' + m)
                name = os.path.basename(os.path.dirname(os.path.dirname(m)))
                if not m.lower().endswith('_ui.swf') and not m.lower().endswith('_view.swf'):
                    xfw_mods_info.update(name, {'swf_file_name':m})

            return xfw_mods_info.info

        except:
            err(traceback.format_exc())
        return None


g_entitiesFactories.addSettings(ViewSettings(
    CONST.XFW_VIEW_ALIAS,
    _XfwInjectorView,
    PATH.XFW_SWF_URL,
    ViewTypes.WINDOW,
    None,
    ScopeTemplates.GLOBAL_SCOPE))

g_entitiesFactories.addSettings(ViewSettings(
    CONST.XFW_COMPONENT_ALIAS,
    _XfwComponent,
    None,
    ViewTypes.COMPONENT,
    None,
    ScopeTemplates.DEFAULT_SCOPE))
from gui.Scaleform.framework import ViewTypes, ScopeTemplates, g_entitiesFactories, ViewSettings
from gui.Scaleform.framework.entities.View import View
from gui.Scaleform.framework.entities.abstract.AbstractViewMeta import AbstractViewMeta
from gui.app_loader import g_appLoader
from gui.shared import events, g_eventBus

class AccountsManagerLoginButton(View, AbstractViewMeta):
    def py_log(self, text):
        print('[AccountsManagerLoginButton]: %s' % text)

    def _populate(self):
        super(AccountsManagerLoginButton, self)._populate()

    def _dispose(self):
        super(AccountsManagerLoginButton, self)._dispose()

    def py_openAccMngr(self):
        g_appLoader.getApp().loadView('AccountsManager', 'AccountsManager')

    def py_getTranslate(self):
        return {
            'tooltip_l10n' : 'Менеджер аккаунтов'
        }


_btnAlias = 'AccountsManagerLoginButton'
_aManagerLoginButtonSettings = ViewSettings(_btnAlias, AccountsManagerLoginButton, 'AccountsManager/AccountsManagerLoginButton.swf', ViewTypes.WINDOW, None, ScopeTemplates.GLOBAL_SCOPE)
g_entitiesFactories.addSettings(_aManagerLoginButtonSettings)

g_eventBus.addListener(events.AppLifeCycleEvent.INITIALIZED, lambda *args : g_appLoader.getDefLobbyApp().loadView(_btnAlias))
Ejemplo n.º 9
0
	def onTryClosing(self):
		return True

	def onOkClicked(self):
		'''Called from ActionScript by DAAPI when user clicks ok button.'''
		logger.info("PYTHON: onOkClicked() called")

	def onCancelClicked(self):
		'''Called from ActionScript by DAAPI when user clicks cancel button.'''
		logger.info("PYTHON: onCancelClicked() called")

g_entitiesFactories.addSettings(
	ViewSettings(
		SettingsUIWindow.NAME,
		SettingsUIWindow,
		'tessu_mod/SettingsUI.swf',
		ViewTypes.WINDOW,
		None,
		ScopeTemplates.DEFAULT_SCOPE
	)
)

# HACK: get the settings ui window open somehow
def onhandleKeyEvent(event):
	key = getBigworldNameFromKey(event.key)
	if key == "KEY_F10":
		g_appLoader.getApp().loadView(SettingsUIWindow.NAME, SettingsUIWindow.NAME)
	return None
InputHandler.g_instance.onKeyDown += onhandleKeyEvent

# HACK: get GUI debug messages to appear to python.log
log_handlers = {
Ejemplo n.º 10
0
 def _start(self):
     g_entitiesFactories.addSettings(
         ViewSettings(CONSTANTS.VIEW_ALIAS, Flash_UI, CONSTANTS.FILE_NAME, ViewTypes.WINDOW, None, ScopeTemplates.GLOBAL_SCOPE))