Polar Fox Posted August 25, 2015 Share Posted August 25, 2015 Эти строки на что поменяли from tutorial.gui.Scaleform.battle import ScaleformLayout from tutorial.gui.Scaleform.battle.layout import BattleLayout 0.9.9 from tutorial.gui.Scaleform.battle import ScaleformLayout 0.9.10 from tutorial.gui.Scaleform.battle.legacy import ScaleformLayout @ Quote Link to comment Short link Share on other sites More sharing options...
wid Posted August 25, 2015 Share Posted August 25, 2015 (edited) А в этой. from tutorial.gui.Scaleform.battle.layout import BattleLayout Ошибка остается. Edited August 25, 2015 by wid @ Quote Link to comment Short link Share on other sites More sharing options...
Vampire_BY Posted August 26, 2015 Share Posted August 26, 2015 (edited) Как описать метод закрытия формы ? в плане выполнить действие когда форма закрывается Edited August 26, 2015 by DannyGreene @ Quote Link to comment Short link Share on other sites More sharing options...
GPCracker Posted August 26, 2015 Share Posted August 26, 2015 Как описать метод закрытия формы ? в плане выполнить действие когда форма закрываетсяTryClosing или как-то так... Поищи в скриптах у картохи 100% есть. @ Quote Link to comment Short link Share on other sites More sharing options...
Vampire_BY Posted August 26, 2015 Share Posted August 26, 2015 TryClosing или как-то так... Поищи в скриптах у картохи 100% есть. Ок, спс @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted August 28, 2015 Share Posted August 28, 2015 (edited) Как сменить цвет кнопки? почему в питоне ошибка Traceback (most recent call last): ERROR: File "TestWindow", line 49, in startF ERROR: File "TestWindow", line 34, in as_setText1 ERROR: Exception: PyGFxValue - Failed to invoke method as_Test1. ERROR: Traceback (most recent call last): ERROR: File "TestWindow", line 50, in startF ERROR: File "TestWindow", line 38, in as_setText2 ERROR: Exception: PyGFxValue - Failed to invoke method as_Test2. ERROR: Traceback (most recent call last): ERROR: File "TestWindow", line 51, in startF ERROR: File "TestWindow", line 42, in as_setText3 ERROR: Exception: PyGFxValue - Failed to invoke method as_Test3. код 'as' package { import flash.events.*; import flash.display.*; import scaleform.clik.core.UIComponent; import net.wg.infrastructure.base.AbstractWindowView; import net.wg.gui.components.controls.ResizableScrollPane; import net.wg.gui.components.controls.ScrollPane; import net.wg.gui.components.controls.SoundButton; import flash.text.TextField; import net.wg.gui.components.advanced.ContentTabBar; import scaleform.clik.core.UIComponent; public class TestWindow extends AbstractWindowView { public var textFieldTest1:TextField; public var textFieldTest2:TextField; public var textFieldTest3:TextField; public var soundButtonOk:SoundButton; public var soundButtonCancel:SoundButton; public var startF:Function; public var openURL:Function = null; public var openURLClik:Function = null; public function handleLinkClick(url_link:TextEvent) : void { this.openURL(url_link.text); } public function LinkClick(url_link:MouseEvent) : void { this.openURLClik(url_link); } public function as_Test1(param:String):void { this.textFieldTest1.htmlText = param; } public function as_Test2(param:String):void { this.textFieldTest2.htmlText = param } public function as_Test3(param:String):void { this.textFieldTest3.htmlText = param } public function as_Title(param:String):void { this.window.title = param } private function CancelClick(e:MouseEvent) : void { this.handleWindowClose(); } public function TestWindow() { super(); } override protected function configUI() : void { super.configUI(); this.textFieldTest1 = new TextField(); this.textFieldTest1.width = 500; this.textFieldTest1.height = 20; this.textFieldTest1.x = 5; this.textFieldTest1.y = 0; this.textFieldTest1.multiline = true; this.textFieldTest1.wordWrap = false; this.textFieldTest1.selectable = false; this.startF(); this.textFieldTest1.addEventListener(TextEvent.LINK, this.handleLinkClick); this.addChild(this.textFieldTest1); this.textFieldTest2 = new TextField(); this.textFieldTest2.width = 100; this.textFieldTest2.height = 20; this.textFieldTest2.x = 10; this.textFieldTest2.y = 380; this.textFieldTest2.multiline = false; this.textFieldTest2.wordWrap = false; this.textFieldTest2.selectable = false; this.startF(); this.textFieldTest2.addEventListener(TextEvent.LINK, this.handleLinkClick); this.addChild(this.textFieldTest2); this.textFieldTest3 = new TextField(); this.textFieldTest3.width = 100; this.textFieldTest3.height = 20; this.textFieldTest3.x = 430; this.textFieldTest3.y = 380; this.textFieldTest3.multiline = false; this.textFieldTest3.wordWrap = false; this.textFieldTest3.selectable = false; this.startF(); this.textFieldTest3.addEventListener(TextEvent.LINK, this.handleLinkClick); this.addChild(this.textFieldTest3); this.soundButtonOk = (this as UIComponent).addChild(App.utils.classFactory.getComponent("ButtonNormal", SoundButton, { width: 100, height: 22, x: 100, y: 378, label: "Перейти"})) as SoundButton; this.soundButtonOk.addEventListener(MouseEvent.CLICK, this.LinkClick); this.soundButtonCancel = (this as UIComponent).addChild(App.utils.classFactory.getComponent("ButtonNormal", SoundButton, { width: 100, height: 22, x: 300, y: 378, label: "Закрыть" } )) as SoundButton; this.soundButtonCancel.addEventListener(MouseEvent.CLICK, this.CancelClick); } override protected function onPopulate() : void { super.onPopulate(); this.width = 500; this.height = 400; this.startF(); this.window.useBottomBtns = true; } override protected function onDispose() : void { super.onDispose(); } } } 'py' # -*- coding: utf-8 -*- 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.shared.utils.key_mapping import getBigworldNameFromKey from gui.Scaleform.framework.entities.View import View from BigWorld import wg_openWebBrowser 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 def openURL(self, url): wg_openWebBrowser(url) def openURLClik(self, url): wg_openWebBrowser('http://www.koreanrandom.com/forum/topic/25477-/') def as_setText1(self): if self._isDAAPIInited(): return self.flashObject.as_Test1('<font color="#FFFFFF">Test Window Hello World!</font>') def as_setText2(self): if self._isDAAPIInited(): return self.flashObject.as_Test2('<font color="#FFFFFF">Ver 1.0</font>') def as_setText3(self): if self._isDAAPIInited(): return self.flashObject.as_Test3('<font color="#FFFFFF">By Ekspoint</font>') def as_setTitle(self): if self._isDAAPIInited(): return self.flashObject.as_Title(u'Информация об обновлении модпака') def startF(self): self.as_setText1() self.as_setText2() self.as_setText3() self.as_setTitle() _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_F9': g_windowsManager.window.loadView('TestWindow', 'TestWindow') return None from gui import InputHandler InputHandler.g_instance.onKeyDown += onhandleKeyEvent Edited August 27, 2015 by Dark_Knight_MiX @ Quote Link to comment Short link Share on other sites More sharing options...
SkepticalFox Posted August 28, 2015 Share Posted August 28, 2015 (edited) del Edited June 19, 2016 by ShadowHunterRUS @ Quote Link to comment Short link Share on other sites More sharing options...
GPCracker Posted August 28, 2015 Share Posted August 28, 2015 Как сменить цвет кнопки?Заюзать другой класс. В теме уже об этом писали, и приводили примеры и список классов с картинками даже. @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted August 28, 2015 Share Posted August 28, 2015 (edited) нужно вызывать startF в конце configUI всего один раз В onPopulate startF вообще не нужен спасибо, а как тогда в питон вывести текс window.title и label кнопок Edited August 28, 2015 by Dark_Knight_MiX @ Quote Link to comment Short link Share on other sites More sharing options...
Vampire_BY Posted September 1, 2015 Share Posted September 1, 2015 С обновления поплыли косяки. В новом патчи при нажатие F10 окно открываться но тухнет свет в ангаре xD что за? @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted September 1, 2015 Share Posted September 1, 2015 (edited) С обновления поплыли косяки. В новом патчи при нажатие F10 окно открываться но тухнет свет в ангаре xD что за? Тему читать надо: http://www.koreanrandom.com/forum/topic/25477-как-создать-формуокно-в-ангаре/?p=287951 или: http://www.koreanrandom.com/forum/topic/25477-как-создать-формуокно-в-ангаре/?p=288330 Edited September 1, 2015 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
Vampire_BY Posted September 1, 2015 Share Posted September 1, 2015 Тему читать надо: http://www.koreanrandom.com/forum/topic/25477-как-создать-формуокно-в-ангаре/?p=287951 или: http://www.koreanrandom.com/forum/topic/25477-как-создать-формуокно-в-ангаре/?p=288330 Что то этот момент провтыкал @ Quote Link to comment Short link Share on other sites More sharing options...
伝説の Posted September 2, 2015 Share Posted September 2, 2015 ### TestWindow.py from gui.WindowsManager import g_windowsManager В 0.9.10 нет gui.WindowsManager. @ Quote Link to comment Short link Share on other sites More sharing options...
GPCracker Posted September 2, 2015 Share Posted September 2, 2015 В 0.9.10 нет gui.WindowsManager.Если это вопрос, читайте последние страницы! Картоха переименовала класс, appLoader сейчас он называется, ЕМНИП. @ Quote Link to comment Short link Share on other sites More sharing options...
伝説の Posted September 2, 2015 Share Posted September 2, 2015 Если это вопрос, читайте последние страницы! Картоха переименовала класс, appLoader сейчас он называется, ЕМНИП.Вы где то видите знак вопроса в том посте?!... Как правильно импорт прописывается теперь? @ Quote Link to comment Short link Share on other sites More sharing options...
GPCracker Posted September 2, 2015 Share Posted September 2, 2015 (edited) Как правильно импорт прописывается теперь? Вопрос Ответ З.Ы. Метод getApp работает не совсем нормально, боевой интерфейс не подхватывает, но для ангара вроде норм работает. И вопрос, и ответ на предыдущей странице. Edited September 2, 2015 by GPCracker @ Quote Link to comment Short link Share on other sites More sharing options...
伝説の Posted September 2, 2015 Share Posted September 2, 2015 Вопрос Ответ З.Ы. Метод getApp работает не совсем нормально, боевой интерфейс не подхватывает, но для ангара вроде норм работает. Спс, но для подмены startBattle пришлось сделать так from gui.app_loader.loader import _AppLoader Override(_AppLoader, 'startBattle', base.startBattle) @ Quote Link to comment Short link Share on other sites More sharing options...
Vampire_BY Posted September 5, 2015 Share Posted September 5, 2015 (edited) В классе TestWindow в TestWindow.py изменим def __init__(self): with open('res_mods/config.xml', 'r') as f: self._config = f.read() View.__init__(self)и добавим метод def getCustomConfig(self): return self._config.copy()В TestWindow.as добавим public var customConfig:XML; public var getCustomConfig:Function = null; И изменим: override protected function onPopulate() : void { super.onPopulate(); this.customConfig = new XML(this.getCustomConfig()); this.width = this.customConfig.width; this.height = this.customConfig.height; this.window.title = this.customConfig.title; } Теперь проверим как это работает:Создадим в папке res_mods файл config.xml (кодировка UTF-8 (без BOM)) Содержимое файла: <config.xml> <title>Test Window</title> <width>600</width> <height>400</height> </config.xml> Кто нибудь сталкивался с ошибкой? def getCustomConfig(self): return self._config.copy() AttributeError: 'str' object has no attribute 'copy' Подумал тут может он файл не видит и по этому косяк Edited September 5, 2015 by DannyGreene 1 @ Quote Link to comment Short link Share on other sites More sharing options...
GPCracker Posted September 5, 2015 Share Posted September 5, 2015 Подумал тут может он файл не видит и по этому косякПотому что пора бы немного поботать питон. Ошибка значит что у строки (type 'str') нет атрибута copy. И вправду, откуда ему там взяться... Просто убери это copy и все. @ Quote Link to comment Short link Share on other sites More sharing options...
Vampire_BY Posted September 5, 2015 Share Posted September 5, 2015 (edited) Потому что пора бы немного поботать питон. Ошибка значит что у строки (type 'str') нет атрибута copy. И вправду, откуда ему там взяться... Просто убери это copy и все. Пробовал не помогло p.s Буду пытаться сделать по другому. Edited September 5, 2015 by DannyGreene 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
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.