Jump to content
Korean Random

goofy67

User
  • Content Count

    67
  • Joined

  • Days Won

    2

Posts posted by goofy67


  1. from gui.WindowsManager import g_windowsManager
    
    def showMessageOnPanel(panel, key, msgText, color):
        if g_windowsManager.battleWindow is not None and panel in ('VehicleErrorsPanel', 'VehicleMessagesPanel', 'PlayerMessagesPanel'):
            g_windowsManager.battleWindow.call('battle.' + panel + '.ShowMessage', [key, msgText, color])
        return
    
    
    showMessageOnPanel('PlayerMessagesPanel', 0, 'мама папа', 'green')
    

     

    In 9.10 it looks like this:

    from gui.app_loader import g_appLoader
    
    def showMessageOnPanel(panel, key, msgText, color):
        if g_appLoader.getDefBattleApp() is not None and panel in ('VehicleErrorsPanel', 'VehicleMessagesPanel', 'PlayerMessagesPanel'):
            g_appLoader.getDefBattleApp().call('battle.' + panel + '.ShowMessage', [key, msgText, color])
        return
    
    showMessageOnPanel('PlayerMessagesPanel', 0, 'this is example text', 'green')
    • Upvote 5

  2. В тестовом патче 9.10 форма уже не открывается ( снова WG что то перекопали 

     

    Solved it:

     

    TestWindow.py (modified example from post #2):

    from gui.Scaleform.framework import g_entitiesFactories, ViewSettings
    from gui.Scaleform.framework import ViewTypes, ScopeTemplates
    from gui.Scaleform.daapi.view.meta.WindowViewMeta import *
    from gui.Scaleform.daapi import LobbySubView
    # from gui.WindowsManager import g_windowsManager
    from gui.app_loader import g_appLoader
    from gui.shared.utils.key_mapping import getBigworldNameFromKey
    from gui.Scaleform.framework.entities.View import View
    
    class TestWindow(LobbySubView, WindowViewMeta):
        def __init__(self):
    
            View.__init__(self)
        def _populate(self):
    
            View._populate(self)
        def onWindowClose(self):
    
            self.destroy()
        def onTryClosing(self):
    
            return True
    
    _alias = 'TestWindow'
    _url = 'TestWindow.swf'
    _type = ViewTypes.WINDOW
    _event = None
    _scope = ScopeTemplates.DEFAULT_SCOPE
    _settings = ViewSettings(_alias, TestWindow, _url, _type, _event, _scope)
    g_entitiesFactories.addSettings(_settings)
    
    def onhandleKeyEvent(event):
        key = getBigworldNameFromKey(event.key)
        if key == 'KEY_F10':
            # g_windowsManager.window.loadView('TestWindow', 'TestWindow')
            g_appLoader.getApp().loadView('TestWindow', 'TestWindow')
        return None
    
    from gui import InputHandler
    InputHandler.g_instance.onKeyDown += onhandleKeyEvent

    • Upvote 5

  3. import gui.ClientHangarSpace as chs
    from gui.ClientHangarSpace import ClientHangarSpace
    from Account import PlayerAccount
    
    chs._DEFAULT_HANGAR_SPACE_PATH_BASIC = "spaces/hangar_premium_15aug"
    
    old_onBecomePlayer = PlayerAccount.onBecomePlayer
    
    def new_onBecomePlayer(self):
        old_onBecomePlayer(self)
        ClientHangarSpace()
      
    
    PlayerAccount.onBecomePlayer = new_onBecomePlayer

    Does not work with activated Event-Hangar.


  4. Another question: I managed to get Buttons and Checkboxes to work and sending results back to python. Fine to this point. But how can I add dropdown-menus and radiobuttons?

     

    This:

     

        this.ddownMenu = (this as UIComponent).addChild(App.utils.classFactory.getComponent("DropdownMenu", DropdownMenu, {
        x: 10,
        y: 100,
        width: 200 } )) as DropdownMenu;

    adds an empty dropdown-menu, but how do I add values?


  5. I need a little help from you: I'm searching for a replacement of this sign (see picture) for the russian version of 'Fury'-hangar. Any hints?

     

    Google: Мне нужно немного помощи от вас: Я ищу для замены этого знака (см рисунок) для русской версии 'Fury'-ангар. Любые намеки?


  6. Да я сам на это попался,можно только догадываться почему автор так сделал по дефолту)))

     

    It was a mistake, should be 'normal' by default.

    • Upvote 2

  7. Is it allowed to post in english here?

     

    Just change the lines in python-scripts from

       if swf == 'Application.swf':

    to

       if swf == 'lobby.swf':

     

    That's it.

     

     

    Перевод Google:
    Разве это разрешено оставлять в английском здесь?
    Просто измените строки В Python-скриптов с
       if swf == 'Application.swf':
    для
       if swf == 'lobby.swf':
    Вот и все.

×
×
  • Create New...