Jump to content
Korean Random
SV_Kirov

Как создать форму(Окно) в ангаре

Recommended Posts

urllib2 с ftp никаких проблем не всплывало.

ХЗ. Может уже пофиксили. Но пару-тройку патчей назад не мог с локального FTP получить содержимое файла, через консоль все работало отлично, а в клиенте никак.

Share this post


Link to post

Short link
Share on other sites

Нашел в чем была проблемам (все из за того что я не внимательный)

 

p.s За то научился отслеживать  логи )) и исправлять свои косяки 

Edited by DannyGreene

Share this post


Link to post

Short link
Share on other sites

Я так понимаю вы находите примеры для модов в самом клиенте. Вот я например хочу сделать вызов формы по кнопки. 

 

Как мне найти flsh и py для кнопок выделенных на скриншотах

 

9tpx0o2egqxt.png   

t42naud1w9y3.png

Edited by DannyGreene

Share this post


Link to post

Short link
Share on other sites

посмотреть в mo файлы, затем поиском по as/py файлам

 

Например в файле menu.mo есть секция:

msgid "accountTypes/premium"
msgstr "Премиум:"
Скорее всего эта строка обнаружится где-то в *.as файлах файла common_i18n.swf

У меня это строка нашлась в скрипте MENU.as

public static const ACCOUNTTYPES_PREMIUM:String = "#menu:accountTypes/premium";

 

Чем ты открывал .mo гугал выдал только Poedit?

Edited by DannyGreene

Share this post


Link to post

Short link
Share on other sites

Так что нам дает это все? 

public static const ACCOUNTTYPES_PREMIUM:String = "#menu:accountTypes/premium";

В итоги оформления нет swc и исполняемого файла py тоже.  Я так понимаю поиск нужной части зависит от доли везения 

 

Kotyarko_O, спс 

 

Принцип найти нужную фразу в mo затем искать по остальным файлам?

Edited by DannyGreene

Share this post


Link to post

Short link
Share on other sites

Just downloaded and installed 9.10 Test Client:

from gui.WindowsManager import g_windowsManager

Get an error:

 

No module named WindowsManager

 

Any ideas?

Share this post


Link to post

Short link
Share on other sites

Чем ты открывал .mo гугал выдал только Poedit?

GetText конвертишь в *.po, если нет линуксы, прокатит MinGW или что-то подобное... Либо онлайн сервисы. *.po - обычный текстовый файл, редактируется блокнотом и потом тем же макаром пакуется обратно. Почитай про пакеты локализации, погугли GetText))

Онлайн сервис для этих целей))

Share this post


Link to post

Short link
Share on other sites

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

Edited by DannyGreene

Share this post


Link to post

Short link
Share on other sites

В тестовом патче 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

Share this post


Link to post

Short link
Share on other sites

Solved it:

Картоха как всегда. Переименовали пару классов.

Share this post


Link to post

Short link
Share on other sites

Картоха как всегда. Переименовали пару классов.

Сделала точно также как и в самолетах.

Скоро все моды с танков будут и в WoWP работать...

Жаль, что игра говно...

Share this post


Link to post

Short link
Share on other sites
Solved it:

 

Well, unfortunately not really...

When using the script with 9.10_CT and opening a window on login-screen, everything is fine.

But as soon as I open a window in lobby, the background (the garage) darkens like pressing the ESC-key, and on closing the test-window the lobby keeps darkened. I need to open an item from menu (like 'depot' or 'service record') and close it again to normalize the lobby.

 

There should be a way to prevent this, because some other windows (like 'exchange gold' or 'conver to free xp') that open in lobby do not have this issue.

Ideas?

Edited by goofy67

Share this post


Link to post

Short link
Share on other sites

There should be a way to prevent this, because some other windows (like 'exchange gold' or 'conver to free xp') that open in lobby do not have this issue. Ideas?

I belive that problem is due to window meta class / type / parameters issue... Check class you using. And it would be useful to check non-problematic classes you pointed.

Share this post


Link to post

Short link
Share on other sites

I've searched for 2 days now, and after posting a question I found a solution within minutes... :heh:

LobbySubView.__background_alpha__ = 0.0

Thanks anyway!

  • Upvote 2

Share this post


Link to post

Short link
Share on other sites

LobbySubView

I've thougth about this... inheritance! What about just do not inherit that class? I think it will no background at all this way... Sometimes i can not find rigth words to explain...

Changing base class parameter you change behavior of all derived classes, it's not good at all.

LobbySubView class is here, it inherits from View

from gui.Scaleform.framework.entities.View import View

 

class LobbySubView(View):

__background_alpha__ = 0.6

 

def seEnvironment(self, app):

app.setBackgroundAlpha(self.__background_alpha__)

super(LobbySubView, self).seEnvironment(app)

It just defines __background_alpha__, and override (super) one method, so you can just skip this base class and inherit from View directly...

I.e. "class TestWindow(View, WindowViewMeta)" instead of "class TestWindow(LobbySubView, WindowViewMeta):"

from gui.Scaleform.framework.entities.View import View

Or just define derived class variable __background_alpha__ - it will override LobbySubView.__background_alpha__ and it will transparent background...

But you should'n change "LobbySubView.__background_alpha__ = 0.0" directly, it could break something...

  • Upvote 2

Share this post


Link to post

Short link
Share on other sites

Thank you for that hint, it works fine now without "LobbySubView.__background_alpha__ = 0.0", but with this:

....

from gui.Scaleform.framework.entities.View import View

from gui.Scaleform.framework.entities.abstract.AbstractViewMeta import AbstractViewMeta

class TestWindow(View, AbstractViewMeta):

....

Share this post


Link to post

Short link
Share on other sites

Можно ли на прямую с ангара получить id клана? 

 

Разобрался ) 

Edited by DannyGreene

Share this post


Link to post

Short link
Share on other sites

Эти строки на что поменяли 

from tutorial.gui.Scaleform.battle import ScaleformLayout
from tutorial.gui.Scaleform.battle.layout import BattleLayout

по ним ошибку бьет.

*** ImportError: cannot import name gui_config

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...