Jump to content
Korean Random
Armagomen_UA

Нужна помощь с переводом кода из AS2 в AS3

Recommended Posts

Всем привет, на носу 0.9.15.1 и не для кого не секрет что все старые флэшки работать не будут. Так вот прошу помощи с переводом кода в AS3

В основном задача простая перекинуть текстовые поля с моего кода(1й спойлер) в новый(2й спойлер) тоесть добавить в новый FragCorrelationBar. То что нужно перенести выделено жирным под спойлером. + скрыть ненужные родные поля, все кроме маркеров и фона.

'Исходный код откуда надо выдернуть, доп инфо под спойлером'

 

   htmlText - Обязательно, динамические поля с обратной связью. Каждое поле отдельно общается с моим питон скриптом. Это важный момент.

   из питона информация выходит в виде. 

   g_appLoader.getDefBattleApp().call('armagomen.allyFrags', [allyFragsText])

   g_appLoader.getDefBattleApp().call('armagomen.allyFrags', [enemyFragsText])

   и так далее на каждое поле независимый вызов.

 

   var __alliedHP = null;
   var __enemyHP = null;
   var __damage = null;
   var __mainGun = null;
   var __alliedHpBar = null;
   var __enemyHpBar = null;
   var __angle = null;
   var __teamFrags = null;
   var __enemyFrags = null;
   var __teamRemainHalth = null;
   var __enemyRemainHalth = null;
   var __differenceHalth = null;

                     +

в ас2 обратный колбак устанавливался так. как его сделать на ас3?

gfx.io.GameDelegate.addCallBack("armagomen.alliedHPText",this,"update__alliedHPField"); для каждого поля свой вызов.

class net.wargaming.ingame.TeamsCounter extends net.wargaming.ingame.base.BaseTeamCounter
{
   var _isShown = false;
   var _isShownInvalid = false;
   var _playerTeamInvalid = false;
   var _enemyTeamInvalid = false;
   var __alliedHP = null;
   var __enemyHP = null;
   var __damage = null;
   var __mainGun = null;
   var __alliedHpBar = null;
   var __enemyHpBar = null;
   var __angle = null;
   var __teamFrags = null;
   var __enemyFrags = null;
   var __teamRemainHalth = null;
   var __enemyRemainHalth = null;
   var __differenceHalth = null;
   function TeamsCounter()
   {
      super();
      this.stop();
      this.updateColors();
      this.create__damageField();
      this.create__mainGunField();
      this.create__alliedHPField();
      this.create__enemyHPField();
      this.create__alliedHpBarField();
      this.create__enemyHpBarField();
      this.create__angleField();
      this.create__teamFragsField();
      this.create__enemyFragsField();
      this.create__teamRemainHalthField();
      this.create__enemyRemainHalthField();
      this.create__differenceHalthField();
   }
   function showVehiclesCounter(isShown)
   {
      this._isShown = isShown;
      this._isShownInvalid = true;
      this.invalidate();
   }
   function setTeamNames(alliedName, enemyName)
   {
      this.m_alliedTeamTF.text = alliedName;
      this.m_enemyTeamTF.text = enemyName;
   }
   function updateFrags(allied, enemy)
   {
      this.__allied = allied;
      this.__enemy = enemy;
      this.updateColors();
   }
   function updatePlayerTeam()
   {
      this._playerTeam = arguments;
      this._playerTeamInvalid = true;
      if(this.initialized)
      {
         this.invalidate();
      }
   }
   function updateEnemyTeam()
   {
      this._enemyTeam = arguments;
      this._enemyTeamInvalid = true;
      this.invalidate();
   }
   function draw()
   {
      if(this.alliedMarkers.__get__visible() == undefined)
      {
         this.invalidate();
         return undefined;
      }
      if(this._isShownInvalid)
      {
         this._isShownInvalid = false;
         this.alliedMarkers.__set__visible(this._isShown);
         this.enemyMarkers.__set__visible(this._isShown);
         if(!this._isShown)
         {
            this.alliedMarkers.clear();
            this.enemyMarkers.clear();
         }
      }
      var _loc2_ = false;
      if(this._playerTeamInvalid)
      {
         this._playerTeamInvalid = false;
         this.alliedMarkers.__set__dataProvider(this.createObjects(this._playerTeam,this.alliedMarkers.__get__markerType(),this.alliedMarkers.__get__align()));
         _loc2_ = true;
      }
      if(this._enemyTeamInvalid)
      {
         this._enemyTeamInvalid = false;
         this.enemyMarkers.__set__dataProvider(this.createObjects(this._enemyTeam,this.enemyMarkers.__get__markerType(),this.enemyMarkers.__get__align()));
         _loc2_ = true;
      }
      if(_loc2_)
      {
         this.updateColors();
      }
   }
   function createObjects(arr, markerType, align)
   {
      var _loc4_ = [];
      var _loc5_ = 0;
      var _loc6_ = net.wargaming.managers.ColorSchemeManager.__get__instance().getScheme(markerType);
      var _loc7_ = _loc6_.aliasColor;
      var _loc8_ = _loc6_.adjust;
      if(_loc7_ == null)
      {
         _loc7_ = "green";
      }
      while(arr.length)
      {
         _loc4_.push({vehicleId:arr.shift(),vehicleClass:arr.shift(),isAlive:arr.shift(),index:_loc5_,alias:_loc7_,align:align,adjustFilter:_loc8_});
         _loc5_ = _loc5_ + 1;
      }
      return _loc4_;
   }
   function updateColors()
   {
      var _loc2_ = "draw";
      this.m_alliedTeamFragsTF.text = this.__allied.toString();
      this.m_enemyTeamFragsTF.text = this.__enemy.toString();
   }
   function configUI()
   {
      super.configUI();
      this.updateColors();
      gfx.io.GameDelegate.call("battle.populateFragCorrelationBar",[]);
   }
   function update__damageField(_text)
   {
      this.__damage.htmlText = _text;
   }
   function update__mainGunField(_text)
   {
      this.__mainGun.htmlText = _text;
   }
   function update__alliedHPField(_text)
   {
      this.__alliedHP.htmlText = _text;
   }
   function update__enemyHPField(_text)
   {
      this.__enemyHP.htmlText = _text;
   }
   function update__alliedHpBarField(_text)
   {
      this.__alliedHpBar.htmlText = _text;
   }
   function update__enemyHpBarField(_text)
   {
      this.__enemyHpBar.htmlText = _text;
   }
   function update__angleField(_text)
   {
      this.__angle.htmlText = _text;
   }
   function update__teamFragsField(_text)
   {
      this.__teamFrags.htmlText = _text;
   }
   function update__enemyFragsField(_text)
   {
      this.__enemyFrags.htmlText = _text;
   }
   function update__teamRemainHalthField(_text)
   {
      this.__teamRemainHalth.htmlText = _text;
   }
   function update__enemyRemainHalthField(_text)
   {
      this.__enemyRemainHalth.htmlText = _text;
   }
   function update__differenceHalthField(_text)
   {
      this.__differenceHalth.htmlText = _text;
   }
   function create__damageField()
   {
      this.__damage = _root.fragsContainer.TeamsCounterUI.createTextField("Damage",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),-465,0,200,30);
      this.__damage.selectable = false;
      this.__damage.antiAliasType = "advanced";
      this.__damage.html = true;
      this.__damage.border = false;
      this.__damage.filters = [new flash.filters.DropShadowFilter(1,90,0,1,5,5,1)];
      this.__damage.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.damageText",this,"update__damageField");
   }
   function create__mainGunField()
   {
      this.__mainGun = _root.fragsContainer.TeamsCounterUI.createTextField("mainGun",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),265,0,200,30);
      this.__mainGun.selectable = false;
      this.__mainGun.antiAliasType = "advanced";
      this.__mainGun.html = true;
      this.__mainGun.border = false;
      this.__mainGun.filters = [new flash.filters.DropShadowFilter(1,90,0,1,5,5,1)];
      this.__mainGun.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.mainGunText",this,"update__mainGunField");
   }
   function create__alliedHPField()
   {
      this.__alliedHP = _root.fragsContainer.TeamsCounterUI.createTextField("alliedHP",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),-267,0,60,30);
      this.__alliedHP.selectable = false;
      this.__alliedHP.antiAliasType = "advanced";
      this.__alliedHP.html = true;
      this.__alliedHP.border = false;
      this.__alliedHP.filters = [new flash.filters.DropShadowFilter(1,90,0,1,5,5,0.7)];
      this.__alliedHP.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.alliedHPText",this,"update__alliedHPField");
   }
   function create__enemyHPField()
   {
      this.__enemyHP = _root.fragsContainer.TeamsCounterUI.createTextField("enemyHP",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),207,0,60,30);
      this.__enemyHP.selectable = false;
      this.__enemyHP.antiAliasType = "advanced";
      this.__enemyHP.html = true;
      this.__enemyHP.border = false;
      this.__enemyHP.filters = [new flash.filters.DropShadowFilter(1,90,0,1,5,5,0.7)];
      this.__enemyHP.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.enemyHPText",this,"update__enemyHPField");
   }
   function create__alliedHpBarField()
   {
      this.__alliedHpBar = _root.fragsContainer.TeamsCounterUI.createTextField("alliedHpBar",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),-208,0,170,30);
      this.__alliedHpBar.selectable = false;
      this.__alliedHpBar.antiAliasType = "advanced";
      this.__alliedHpBar.html = true;
      this.__alliedHpBar.border = false;
      this.__alliedHpBar.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.alliedHpBar",this,"update__alliedHpBarField");
   }
   function create__enemyHpBarField()
   {
      this.__enemyHpBar = _root.fragsContainer.TeamsCounterUI.createTextField("enemyHpBar",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),38,0,170,30);
      this.__enemyHpBar.selectable = false;
      this.__enemyHpBar.antiAliasType = "advanced";
      this.__enemyHpBar.html = true;
      this.__enemyHpBar.border = false;
      this.__enemyHpBar.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.enemyHpBar",this,"update__enemyHpBarField");
   }
   function create__angleField()
   {
      this.__angle = _root.fragsContainer.TeamsCounterUI.createTextField("angle",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),-16,0,32,30);
      this.__angle.selectable = false;
      this.__angle.antiAliasType = "advanced";
      this.__angle.html = true;
      this.__angle.border = false;
      this.__angle.filters = [new flash.filters.DropShadowFilter(0.5,90,0,1,2,2,0.5)];
      this.__angle.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.angleText",this,"update__angleField");
   }
   function create__teamFragsField()
   {
      this.__teamFrags = _root.fragsContainer.TeamsCounterUI.createTextField("teamFrags",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),-40,0,30,30);
      this.__teamFrags.selectable = false;
      this.__teamFrags.antiAliasType = "advanced";
      this.__teamFrags.html = true;
      this.__teamFrags.border = false;
      this.__teamFrags.filters = [new flash.filters.DropShadowFilter(0.5,90,0,1,2,2,0.5)];
      this.__teamFrags.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.allyFrags",this,"update__teamFragsField");
   }
   function create__enemyFragsField()
   {
      this.__enemyFrags = _root.fragsContainer.TeamsCounterUI.createTextField("enemyFrags",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),10,0,30,30);
      this.__enemyFrags.selectable = false;
      this.__enemyFrags.antiAliasType = "advanced";
      this.__enemyFrags.html = true;
      this.__enemyFrags.border = false;
      this.__enemyFrags.filters = [new flash.filters.DropShadowFilter(0.5,90,0,1,2,2,0.5)];
      this.__enemyFrags.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.enemyFrags",this,"update__enemyFragsField");
   }
   function create__teamRemainHalthField()
   {
      this.__teamRemainHalth = _root.fragsContainer.TeamsCounterUI.createTextField("teamRemainHalth",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),-270,45,1,1);
      this.__teamRemainHalth.selectable = false;
      this.__teamRemainHalth.antiAliasType = "advanced";
      this.__teamRemainHalth.multiline = true;
      this.__teamRemainHalth.wordWrap = false;
      this.__teamRemainHalth.autoSize = true;
      this.__teamRemainHalth.html = true;
      this.__teamRemainHalth.border = false;
      this.__teamRemainHalth.filters = [new flash.filters.DropShadowFilter(3,90,0,1,4,4,2)];
      this.__teamRemainHalth.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.remainHalthTeam",this,"update__teamRemainHalthField");
   }
   function create__enemyRemainHalthField()
   {
      this.__enemyRemainHalth = _root.fragsContainer.TeamsCounterUI.createTextField("enemyRemainHalth",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),17,45,1,1);
      this.__enemyRemainHalth.selectable = false;
      this.__enemyRemainHalth.antiAliasType = "advanced";
      this.__enemyRemainHalth.multiline = true;
      this.__enemyRemainHalth.wordWrap = false;
      this.__enemyRemainHalth.autoSize = true;
      this.__enemyRemainHalth.html = true;
      this.__enemyRemainHalth.border = false;
      this.__enemyRemainHalth.filters = [new flash.filters.DropShadowFilter(3,90,0,1,4,4,2)];
      this.__enemyRemainHalth.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.remainHalthEnemy",this,"update__enemyRemainHalthField");
   }
   function create__differenceHalthField()
   {
      this.__differenceHalth = _root.fragsContainer.TeamsCounterUI.createTextField("differenceHalth",_root.fragsContainer.TeamsCounterUI.getNextHighestDepth(),-25,27,51,30);
      this.__differenceHalth.selectable = false;
      this.__differenceHalth.antiAliasType = "advanced";
      this.__differenceHalth.html = true;
      this.__differenceHalth.border = false;
      this.__differenceHalth.filters = [new flash.filters.DropShadowFilter(1,90,0,1,5,5,1)];
      this.__differenceHalth.htmlText = "";
      gfx.io.GameDelegate.addCallBack("armagomen.differenceHealth",this,"update__differenceHalthField");
   }
}
 

 

Готовое решение задачи.

Edited by Armagomen_dev
  • Downvote 2

Share this post


Link to post

Short link
Share on other sites

Спасибо, попробую завтра только одно не понял. 

 

 

Создть расширенную реализацию этого класса закинуть в battle.swf и подменить импорт FragCorrelationBar на свой FragCorrelationBar_new

Зачем ?  

Edited by Armagomen_dev
  • Downvote 2

Share this post


Link to post

Short link
Share on other sites

AS3 как-бы...

Это что получается еще батл с собой тягать ?  Тогда будет конфликт с ХВМ.

 

как записать это.

gfx.io.GameDelegate.addCallBack("armagomen.differenceHealth",this,"update__differenceHalthField");

Как бы без этого я не передам ему данные. у меня 12 полей которые паралельно передают разные данные.

 

МОД

Edited by Armagomen_dev

Share this post


Link to post

Short link
Share on other sites

 

 

Еще есть вариант отключить этот FragCorrelationBar из питона присвоив ему visible=false и подгрузить свою флешку.
 Зачем мне это делать я в родную просто новые поля добавляю как и раньше. Я же не отключал её и не подменивал до этого, меня больше интересует вопрос с колбаком из флэша, ему же надо задать параметр для приема из питона, а ты в пример не написал это.

Share this post


Link to post

Short link
Share on other sites

Как бы без этого я не передам ему данные. у меня 12 полей которые паралельно передают разные данные.

DAAPI. Для AS3 - только оно. Как оно работает - я описывал тут. Внимание, в связи с переделками картохи часть того, что там описано, работать не будет. Хотя не думаю, что они прям все перелопатят.

Share this post


Link to post

Short link
Share on other sites

 

 

package NewBattlePanel
 

Не работает твой код. Даже поля не появляются хотя флэшку мою он кушает на ура без всяких лишних телодвижений. Фоновую картинку подменил нормально.

Share this post


Link to post

Short link
Share on other sites

Не работает твой код.

А это не весь код.

Там еще загрузчик был.

Edited by ShadowHunterRUS

Share this post


Link to post

Short link
Share on other sites

Чтото с твоим кодом ничего не получается, буду ждать как Гамбитер освободится. Не совсем то что мне нужно ты даеш. От части то да на 50% не то :)

Share this post


Link to post

Short link
Share on other sites

Чтото с твоим кодом ничего не получается

post-16296-0-18090700-1466964311_thumb.jpg

Не совсем то что мне нужно ты даеш.

Так я и не совсем понимаю, что именно тебе нужно... Edited by ShadowHunterRUS

Share this post


Link to post

Short link
Share on other sites

Так я и не совсем понимаю, что именно тебе нужно...

Нужно не новую флэшку создать, а добавить в родную флэшку дополнительные поля, а родные скрыть(написал подробно в 1м посте). + настроить колбак с моим скриптом питона. Я наверно не правильно выразился в 1м посте. Тоесть в тот код который под 2м спойлером нужно добавить поля которые жырным текстом выделены. С колбаком.

 

Даю старую флэшку и новую, я там начал добавлять но чтото у меня не выходит.

Просто сам не понимаю как в нее перекинуть параметры. В as не силен. Я и ссылку на страницу мода дал думал поймешь по видео и скриншоту о чем речь.

Teams_HP.zip

Edited by Armagomen_dev

Share this post


Link to post

Short link
Share on other sites
В AS3 такое делать не рекомендуется.

 Я не за советом сюда пришол рекомендуется или нет, если не умеете в готовом флэше редактировать зачем тогда голову морочить, и опять же вы создаете в 4й раз не то что нужно, мне не статические поля нужны в которые написал и забыл. А если не умеете то не пытайтесь советовать. Пусть лучше тот кто умеет скажет как сделать именно то что мне нужно.

Edited by Armagomen_dev

Share this post


Link to post

Short link
Share on other sites

мне не статические поля нужны в которые написал и забыл.

И в чем проблема?

Немного DAAPI и они становятся динамичными.

NewFragCorrelationBar_as3.zip

post-16296-0-63982700-1467015541_thumb.jpg

 

А если не умеете то не пытайтесь советовать.

Попытка не пытка. Извините, что потревожил вас своими советами. Edited by ShadowHunterRUS

Share this post


Link to post

Short link
Share on other sites
И в чем проблема? Немного DAAPI и они становятся динамичными.

 

проблема в том что вы даже не удосужились разобраться как устроен мой ас2 скрипт с коротого нужно перенести (только мои функции оставьте стандартные в покое), и пытаетесь мне подсунуть то что мне не подходит. Там все не так просто. Если бы это были просто обычное текстовые поля, я бы это сам сделал. Но там сделано чрез 3 функции. И я не использую стандартную инфу которую клиент дает. В вашем же случае вы берете стандарт и чтото с ним делаете мне это не подходит еще раз говорю.

 

 

 

Попытка не пытка. Извините, что потревожил вас своими советами.

Просто вы советуете не разобравшись и абы что лишь бы что то посоветовать. Мне нужно перенести именно все скрипты, а ни просто создать новые поля.

 

'Приблизительно такого вида должен получится итог.'

package net.wg.gui.battle.random.views.fragCorrelationBar
{
   import net.wg.infrastructure.base.meta.impl.FragCorrelationBarMeta;
   import net.wg.infrastructure.base.meta.IFragCorrelationBarMeta;
   import net.wg.infrastructure.helpers.statisticsDataController.intarfaces.IBattleComponentDataController;
   import net.wg.data.constants.InvalidationType;
   import flash.text.TextField;
   import flash.display.Sprite;
   import net.wg.infrastructure.interfaces.IColorScheme;
   import net.wg.infrastructure.managers.IColorSchemeManager;
   import net.wg.infrastructure.events.ColorSchemeEvent;
   import net.wg.infrastructure.interfaces.IDAAPIDataClass;
   import net.wg.data.VO.daapi.DAAPIVehiclesDataVO;
   import net.wg.data.VO.daapi.DAAPIVehiclesStatsVO;
   import net.wg.data.VO.daapi.DAAPIVehicleStatusVO;
   import net.wg.data.constants.PersonalStatus;
   import flash.filters.DropShadowFilter;
   import scaleform.gfx.TextFieldEx;
   
   import net.wg.infrastructure.managers.IEnvironmentManager;
	
   
   
   public class FragCorrelationBar extends FragCorrelationBarMeta implements IFragCorrelationBarMeta, IBattleComponentDataController
   {
      
      private static const INVALID_FRAGS:uint = InvalidationType.SYSTEM_FLAGS_BORDER << 1;
      
      private static const INVALID_COLOR_SCHEME:uint = InvalidationType.SYSTEM_FLAGS_BORDER << 2;
       
      public var __alliedHP:TextField = null;
      
      public var __enemyHP:TextField = null;
      
      public var __damage:TextField = null;
      
      public var __mainGun:TextField = null;
      
      public var __alliedHpBar:TextField = null;
      
      public var __enemyHpBar:TextField = null;
      
      public var __angle:TextField = null;
      
      public var __teamFrags:TextField = null;
      
      public var __enemyFrags:TextField = null;
      
      public var __teamRemainHalth:TextField = null;
      
      public var __enemyRemainHalth:TextField = null;
      
      public var __differenceHalth:TextField = null;
      
      public var allyTeamFragsField:TextField = null;
      
      public var enemyTeamFragsField:TextField = null;
      
      public var greenBackground:Sprite = null;
      
      public var redBackground:Sprite = null;
      
      public var purpleBackground:Sprite = null;
      
      public var teamFragsSeparatorField:TextField = null;
      
      private var _allyTeamFragsStr:String = "0";
      
      private var _enemyTeamFragsStr:String = "0";
      
      private var _lastTeamSeparatorState:int;
      
      private var _currentTeamSeparatorState:int;
      
      private var _winColorScheme:IColorScheme = null;
      
      private var _loseColorScheme:IColorScheme = null;
      
      private var _allyVehicleMarkersList:net.wg.gui.battle.random.views.fragCorrelationBar.VehicleMarkersList;
      
      private var _enemyVehicleMarkersList:net.wg.gui.battle.random.views.fragCorrelationBar.VehicleMarkersList;
      
      private var _colorSchemeMgr:IColorSchemeManager;
      
      private var _rightBg:Sprite = null;
      
      private const FRAG_CORRELATION_WIN:String = "FragCorrelationWin";
      
      private const FRAG_CORRELATION_LOSE:String = "FragCorrelationLoose";
      
      private const RED:String = "red";
      
      private const FRAG_EQUAL:int = 0;
      
      private const FRAG_WIN:int = 1;
      
      private const FRAG_LOSE:int = 2;
      
      private const SEPARATOR_STR:String = ":";
      
      public function FragCorrelationBar()
      {
         this._lastTeamSeparatorState = this.FRAG_EQUAL;
         this._currentTeamSeparatorState = this.FRAG_EQUAL;
         this._colorSchemeMgr = App.colorSchemeMgr;
         super();
         this.create__damageField();
         this.create__mainGunField();
         this.create__alliedHPField();
         this.create__enemyHPField();
         this.create__alliedHpBarField();
         this.create__enemyHpBarField();
         this.create__angleField();
         this.create__teamFragsField();
         this.create__enemyFragsField();
         this.create__teamRemainHalthField();
         this.create__enemyRemainHalthField();
         this.create__differenceHalthField();
         this._rightBg = this.redBackground;
         TextFieldEx.setNoTranslate(this.allyTeamFragsField,true);
         TextFieldEx.setNoTranslate(this.enemyTeamFragsField,true);
         TextFieldEx.setNoTranslate(this.teamFragsSeparatorField,true);
         this._winColorScheme = this._colorSchemeMgr.getScheme(this.FRAG_CORRELATION_WIN);
         this._loseColorScheme = this._colorSchemeMgr.getScheme(this.FRAG_CORRELATION_LOSE);
         this._allyVehicleMarkersList = new net.wg.gui.battle.random.views.fragCorrelationBar.VehicleMarkersList(this,false,this._winColorScheme.aliasColor);
         this._enemyVehicleMarkersList = new net.wg.gui.battle.random.views.fragCorrelationBar.VehicleMarkersList(this,true,this._loseColorScheme.aliasColor);
      }
      
      override protected function draw() : void
      {
         super.draw();
         this.__alliedHP.visible = true;
         this.__enemyHP.visible = true;
         this.__damage.visible = true;
         this.__mainGun.visible = true;
         this.__alliedHpBar.visible = true;
         this.__enemyHpBar.visible = true;
         this.__angle.visible = true;
         this.__teamFrags.visible = true;
         this.__enemyFrags.visible = true;
         this.__teamRemainHalth.visible = true;
         this.__enemyRemainHalth.visible = true;
         this.__differenceHalth.visible = true;
         if(isInvalid(INVALID_COLOR_SCHEME))
         {
            this.greenBackground.filters = [this._winColorScheme.adjustOffset];
            this._rightBg.visible = false;
            this._rightBg = this._loseColorScheme.aliasColor == this.RED?this.redBackground:this.purpleBackground;
            this._rightBg.filters = [this._loseColorScheme.adjustOffset];
            this._rightBg.visible = this._currentTeamSeparatorState == this.FRAG_LOSE;
         }
         if(isInvalid(INVALID_FRAGS))
         {
            this.allyTeamFragsField.text = this._allyTeamFragsStr;
            this.enemyTeamFragsField.text = this._enemyTeamFragsStr;
            if(this._currentTeamSeparatorState != this._lastTeamSeparatorState)
            {
               this._lastTeamSeparatorState = this._currentTeamSeparatorState;
               this.greenBackground.visible = this._currentTeamSeparatorState == this.FRAG_WIN;
               this._rightBg.visible = this._currentTeamSeparatorState == this.FRAG_LOSE;
               this.teamFragsSeparatorField.visible = this._currentTeamSeparatorState == this.FRAG_EQUAL;
            }
         }
      }
      
      override protected function configUI() : void
      {
         super.configUI();
         this.__alliedHP.visible = true;
         this.__enemyHP.visible = true;
         this.__damage.visible = true;
         this.__mainGun.visible = true;
         this.__alliedHpBar.visible = true;
         this.__enemyHpBar.visible = true;
         this.__angle.visible = true;
         this.__teamFrags.visible = true;
         this.__enemyFrags.visible = true;
         this.__teamRemainHalth.visible = true;
         this.__enemyRemainHalth.visible = true;
         this.__differenceHalth.visible = true;
         this.greenBackground.visible = false;
         this.redBackground.visible = false;
         this.purpleBackground.visible = false;
         this.teamFragsSeparatorField.text = this.SEPARATOR_STR;
         this.teamFragsSeparatorField.cacheAsBitmap = true;
         this._colorSchemeMgr.addEventListener(ColorSchemeEvent.SCHEMAS_UPDATED,this.onColorSchemasUpdatedHandler);
      }
      
      private function onColorSchemasUpdatedHandler(param1:ColorSchemeEvent) : void
      {
         this._winColorScheme = this._colorSchemeMgr.getScheme(this.FRAG_CORRELATION_WIN);
         this._loseColorScheme = this._colorSchemeMgr.getScheme(this.FRAG_CORRELATION_LOSE);
         this._allyVehicleMarkersList.color = this._winColorScheme.aliasColor;
         this._enemyVehicleMarkersList.color = this._loseColorScheme.aliasColor;
         invalidate(INVALID_COLOR_SCHEME);
      }
      
      override protected function onDispose() : void
      {
         this.__alliedHP = null;
         this.__enemyHP = null;
         this.__damage = null;
         this.__mainGun = null;
         this.__alliedHpBar = null;
         this.__enemyHpBar = null;
         this.__angle = null;
         this.__teamFrags = null;
         this.__enemyFrags = null;
         this.__teamRemainHalth = null;
         this.__enemyRemainHalth = null;
         this.__differenceHalth = null;
         this._colorSchemeMgr.removeEventListener(ColorSchemeEvent.SCHEMAS_UPDATED,this.onColorSchemasUpdatedHandler);
         this._colorSchemeMgr = null;
         this.allyTeamFragsField = null;
         this.enemyTeamFragsField = null;
         this.greenBackground = null;
         this.redBackground = null;
         this.purpleBackground = null;
         this.teamFragsSeparatorField = null;
         this._winColorScheme.dispose();
         this._winColorScheme = null;
         this._loseColorScheme.dispose();
         this._loseColorScheme = null;
         this._allyVehicleMarkersList.dispose();
         this._allyVehicleMarkersList = null;
         this._enemyVehicleMarkersList.dispose();
         this._enemyVehicleMarkersList = null;
         this._rightBg = null;
         super.onDispose();
      }
      
      public function addVehiclesInfo(param1:IDAAPIDataClass) : void
      {
         var _loc2_:DAAPIVehiclesDataVO = DAAPIVehiclesDataVO(param1);
         if(_loc2_.rightVehicleInfos)
         {
            this._enemyVehicleMarkersList.addVehiclesInfo(_loc2_.rightVehicleInfos,_loc2_.rightCorrelationIDs);
         }
         if(_loc2_.leftVehicleInfos)
         {
            this._allyVehicleMarkersList.addVehiclesInfo(_loc2_.leftVehicleInfos,_loc2_.leftCorrelationIDs);
         }
      }
      
      public function setVehicleStats(param1:IDAAPIDataClass) : void
      {
         var _loc2_:DAAPIVehiclesStatsVO = DAAPIVehiclesStatsVO(param1);
         if(_loc2_.totalStats)
         {
            this.updateFrags(_loc2_.totalStats.leftScope,_loc2_.totalStats.rightScope);
         }
      }
      
      private function updateFrags(param1:int, param2:int) : void
      {
         this._allyTeamFragsStr = param1.toString();
         this._enemyTeamFragsStr = param2.toString();
         if(param1 == param2)
         {
            this._currentTeamSeparatorState = this.FRAG_EQUAL;
         }
         else if(param1 > param2)
         {
            this._currentTeamSeparatorState = this.FRAG_WIN;
         }
         else
         {
            this._currentTeamSeparatorState = this.FRAG_LOSE;
         }
         invalidate(INVALID_FRAGS);
      }
      
      public function setVehiclesData(param1:IDAAPIDataClass) : void
      {
         var _loc2_:DAAPIVehiclesDataVO = DAAPIVehiclesDataVO(param1);
         if(_loc2_.rightVehicleInfos)
         {
            this._enemyVehicleMarkersList.updateMarkers(_loc2_.rightVehicleInfos,_loc2_.rightCorrelationIDs);
         }
         if(_loc2_.leftVehicleInfos)
         {
            this._allyVehicleMarkersList.updateMarkers(_loc2_.leftVehicleInfos,_loc2_.leftCorrelationIDs);
         }
      }
      
      public function updateVehicleStatus(param1:IDAAPIDataClass) : void
      {
         var _loc2_:DAAPIVehicleStatusVO = DAAPIVehicleStatusVO(param1);
         if(_loc2_.isEnemy)
         {
            this._enemyVehicleMarkersList.updateVehicleStatus(_loc2_.vehicleID,_loc2_.status,_loc2_.rightCorrelationIDs);
         }
         else
         {
            this._allyVehicleMarkersList.updateVehicleStatus(_loc2_.vehicleID,_loc2_.status,_loc2_.leftCorrelationIDs);
         }
         if(_loc2_.totalStats)
         {
            this.updateFrags(_loc2_.totalStats.leftScope,_loc2_.totalStats.rightScope);
         }
      }
      
      public function updateVehiclesInfo(param1:IDAAPIDataClass) : void
      {
         var _loc2_:DAAPIVehiclesDataVO = DAAPIVehiclesDataVO(param1);
         if(_loc2_.leftVehicleInfos)
         {
            this._allyVehicleMarkersList.updateVehiclesInfo(_loc2_.leftVehicleInfos,_loc2_.leftCorrelationIDs);
         }
         if(_loc2_.rightVehicleInfos)
         {
            this._enemyVehicleMarkersList.updateVehiclesInfo(_loc2_.rightVehicleInfos,_loc2_.rightCorrelationIDs);
         }
      }
      
      public function updatePersonalStatus(param1:uint, param2:uint) : void
      {
         if(PersonalStatus.IS_VEHICLE_COUNTER_SHOWN == param1)
         {
            this._allyVehicleMarkersList.isVehicleCounterShown = this._enemyVehicleMarkersList.isVehicleCounterShown = true;
         }
         else if(PersonalStatus.IS_VEHICLE_COUNTER_SHOWN == param2)
         {
            this._allyVehicleMarkersList.isVehicleCounterShown = this._enemyVehicleMarkersList.isVehicleCounterShown = false;
         }
      }
      
      function update__damageField(param1:*) : void
      {
         this.__damage.htmlText = param1;
      }
      
      function update__mainGunField(param1:*) : void
      {
         this.__mainGun.htmlText = param1;
      }
      
      function update__alliedHPField(param1:*) : void
      {
         this.__alliedHP.htmlText = param1;
      }
      
      function update__enemyHPField(param1:*) : void
      {
         this.__enemyHP.htmlText = param1;
      }
      
      function update__alliedHpBarField(param1:*) : void
      {
         this.__alliedHpBar.htmlText = param1;
      }
      
      function update__enemyHpBarField(param1:*) : void
      {
         this.__enemyHpBar.htmlText = param1;
      }
      
      function update__angleField(param1:*) : void
      {
         this.__angle.htmlText = param1;
      }
      
      function update__teamFragsField(param1:*) : void
      {
         this.__teamFrags.htmlText = param1;
      }
      
      function update__enemyFragsField(param1:*) : void
      {
         this.__enemyFrags.htmlText = param1;
      }
      
      function update__teamRemainHalthField(param1:*) : void
      {
         this.__teamRemainHalth.htmlText = param1;
      }
      
      function update__enemyRemainHalthField(param1:*) : void
      {
         this.__enemyRemainHalth.htmlText = param1;
      }
      
      function update__differenceHalthField(param1:*) : void
      {
         this.__differenceHalth.htmlText = param1;
      }
      
      function create__damageField() : void
      {
         this.__damage = new TextField();
         this.__damage.x = -465;
         this.__damage.y = 0;
         this.__damage.width = 200;
         this.__damage.height = 30;
         this.__damage.selectable = false;
         this.__damage.AntiAliasType.ADVANCED;
         this.__damage.html = true;
         this.__damage.border = true;
         this.__damage.filters = [new DropShadowFilter(1,90)];
         this.__damage.htmlText = "";
         addChild(this.__damage);
		 IEnvironmentManager.addCallBack("armagomen.damageText", "update__damageField");

      }
      
      function create__mainGunField() : void
      {
         this.__mainGun = new TextField();
         this.__mainGun.x = 265;
         this.__mainGun.y = 0;
         this.__mainGun.width = 200;
         this.__mainGun.height = 30;
         this.__mainGun.selectable = false;
         this.__mainGun.AntiAliasType.ADVANCED;
         this.__mainGun.html = true;
         this.__mainGun.border = true;
         this.__mainGun.filters = [new DropShadowFilter(1,90)];
         this.__mainGun.htmlText = "";
         addChild(this.__mainGun);
		 IEnvironmentManager.addCallBack("armagomen.mainGunText", "update__mainGunField");

      }
      
      function create__alliedHPField() : void
      {
         this.__alliedHP = new TextField();
         this.__alliedHP.x = -267;
         this.__alliedHP.y = 0;
         this.__alliedHP.width = 60;
         this.__alliedHP.height = 30;
         this.__alliedHP.selectable = false;
         this.__alliedHP.AntiAliasType.ADVANCED;
         this.__alliedHP.html = true;
         this.__alliedHP.border = true;
         this.__alliedHP.filters = [new DropShadowFilter(1,90)];
         this.__alliedHP.htmlText = "";
         addChild(this.__alliedHP);
		 IEnvironmentManager.addCallBack("armagomen.alliedHPText", "update__alliedHPField");

      }
      
      function create__enemyHPField() : void
      {
         this.__enemyHP = new TextField();
         this.__enemyHP.x = 207;
         this.__enemyHP.y = 0;
         this.__enemyHP.width = 60;
         this.__enemyHP.height = 30;
         this.__enemyHP.selectable = false;
         this.__enemyHP.AntiAliasType.ADVANCED;
         this.__enemyHP.html = true;
         this.__enemyHP.border = true;
         this.__enemyHP.filters = [new DropShadowFilter(1,90)];
         this.__enemyHP.htmlText = "";
         addChild(this.__enemyHP);
		 IEnvironmentManager.addCallBack("armagomen.enemyHPText", "update__enemyHPField");

      }
      
      function create__alliedHpBarField() : void
      {
         this.__alliedHpBar = new TextField();
         this.__alliedHpBar.x = -208;
         this.__alliedHpBar.y = 0;
         this.__alliedHpBar.width = 170;
         this.__alliedHpBar.height = 30;
         this.__alliedHpBar.selectable = false;
         this.__alliedHpBar.AntiAliasType.ADVANCED;
         this.__alliedHpBar.html = true;
         this.__alliedHpBar.border = true;
         this.__alliedHpBar.filters = [new DropShadowFilter(1,90)];
         this.__alliedHpBar.htmlText = "";
         addChild(this.__alliedHpBar);
		 IEnvironmentManager.addCallBack("armagomen.alliedHpBar", "update__alliedHpBarField");

      }
      
      function create__enemyHpBarField() : void
      {
         this.__enemyHpBar = new TextField();
         this.__enemyHpBar.x = 38;
         this.__enemyHpBar.y = 0;
         this.__enemyHpBar.width = 170;
         this.__enemyHpBar.height = 30;
         this.__enemyHpBar.selectable = false;
         this.__enemyHpBar.AntiAliasType.ADVANCED;
         this.__enemyHpBar.html = true;
         this.__enemyHpBar.border = true;
         this.__enemyHpBar.filters = [new DropShadowFilter(1,90)];
         this.__enemyHpBar.htmlText = "";
         addChild(this.__enemyHpBar);
		 IEnvironmentManager.addCallBack("armagomen.enemyHpBar", "update__enemyHpBarField");

      }
      
      function create__angleField() : void
      {
         this.__angle = new TextField();
         this.__angle.x = -16;
         this.__angle.y = 0;
         this.__angle.width = 32;
         this.__angle.height = 30;
         this.__angle.selectable = false;
         this.__angle.AntiAliasType.ADVANCED;
         this.__angle.html = true;
         this.__angle.border = true;
         this.__angle.filters = [new DropShadowFilter(1,90)];
         this.__angle.htmlText = "";
         addChild(this.__angle);
		 IEnvironmentManager.addCallBack("armagomen.angleText", "update__angleField");

      }
      
      function create__teamFragsField() : void
      {
         this.__teamFrags = new TextField();
         this.__teamFrags.x = -40;
         this.__teamFrags.y = 0;
         this.__teamFrags.width = 30;
         this.__teamFrags.height = 30;
         this.__teamFrags.selectable = false;
         this.__teamFrags.AntiAliasType.ADVANCED;
         this.__teamFrags.html = true;
         this.__teamFrags.border = true;
         this.__teamFrags.filters = [new DropShadowFilter(0.5,90,0,1,2,2,0.5)];
         this.__teamFrags.htmlText = "";
         addChild(this.__teamFrags);
		 IEnvironmentManager.addCallBack("armagomen.allyFrags", "update__teamFragsField");

      }
      
      function create__enemyFragsField() : void
      {
         this.__enemyFrags = new TextField();
         this.__enemyFrags.x = 10;
         this.__enemyFrags.y = 0;
         this.__enemyFrags.width = 30;
         this.__enemyFrags.height = 30;
         this.__enemyFrags.selectable = false;
         this.__enemyFrags.AntiAliasType.ADVANCED;
         this.__enemyFrags.html = true;
         this.__enemyFrags.border = true;
         this.__enemyFrags.filters = [new DropShadowFilter(0.5,90,0,1,2,2,0.5)];
         this.__enemyFrags.htmlText = "";
         addChild(this.__enemyFrags);
		 IEnvironmentManager.addCallBack("armagomen.enemyFrags", "update__enemyFragsField");

      }
      
      function create__teamRemainHalthField() : void
      {
         this.__teamRemainHalth = new TextField();
         this.__teamRemainHalth.x = -270;
         this.__teamRemainHalth.y = 45;
         this.__teamRemainHalth.width = 1;
         this.__teamRemainHalth.height = 1;
         this.__teamRemainHalth.selectable = false;
         this.__teamRemainHalth.AntiAliasType.ADVANCED;
         this.__teamRemainHalth.multiline = true;
         this.__teamRemainHalth.wordWrap = false;
         this.__teamRemainHalth.autoSize = true;
         this.__teamRemainHalth.html = true;
         this.__teamRemainHalth.border = true;
         this.__teamRemainHalth.filters = [new DropShadowFilter(3,90,0,1,4,4,2)];
         this.__teamRemainHalth.htmlText = "";
         addChild(this.__teamRemainHalth);
		 IEnvironmentManager.addCallBack("armagomen.remainHalthTeam", "update__teamRemainHalthField");

      }
      
      function create__enemyRemainHalthField() : void
      {
         this.__enemyRemainHalth = new TextField();
         this.__enemyRemainHalth.x = 17;
         this.__enemyRemainHalth.y = 45;
         this.__enemyRemainHalth.width = 1;
         this.__enemyRemainHalth.height = 1;
         this.__enemyRemainHalth.selectable = false;
         this.__enemyRemainHalth.AntiAliasType.ADVANCED;
         this.__enemyRemainHalth.multiline = true;
         this.__enemyRemainHalth.wordWrap = false;
         this.__enemyRemainHalth.autoSize = true;
         this.__enemyRemainHalth.html = true;
         this.__enemyRemainHalth.border = true;
         this.__enemyRemainHalth.filters = [new DropShadowFilter(3,90,0,1,4,4,2)];
         this.__enemyRemainHalth.htmlText = "";
         addChild(this.__enemyRemainHalth);
		 IEnvironmentManager.addCallBack("armagomen.remainHalthEnemy", "update__enemyRemainHalthField");

      }
      
      function create__differenceHalthField() : void
      {
         this.__differenceHalth = new TextField();
         this.__differenceHalth.x = -25;
         this.__differenceHalth.y = 27;
         this.__differenceHalth.width = 1;
         this.__differenceHalth.height = 1;
         this.__differenceHalth.selectable = false;
         this.__differenceHalth.AntiAliasType.ADVANCED;
         this.__differenceHalth.multiline = true;
         this.__differenceHalth.wordWrap = false;
         this.__differenceHalth.html = true;
         this.__differenceHalth.border = true;
         this.__differenceHalth.filters = [new DropShadowFilter(1,90)];
         this.__differenceHalth.htmlText = "";
         addChild(this.__differenceHalth);
		 IEnvironmentManager.addCallBack("armagomen.differenceHealth", "update__differenceHalthField");

      }
      
      public function setPersonalStatus(param1:uint) : void
      {
         var _loc2_:Boolean = PersonalStatus.isVehicleCounterShown(param1);
         this._allyVehicleMarkersList.isVehicleCounterShown = this._enemyVehicleMarkersList.isVehicleCounterShown = _loc2_;
      }
      
      public function updateInvitationsStatuses(param1:IDAAPIDataClass) : void
      {
      }
      
      public function updatePlayerStatus(param1:IDAAPIDataClass) : void
      {
      }
      
      public function updateUserTags(param1:IDAAPIDataClass) : void
      {
      }
      
      public function updateVehiclesStats(param1:IDAAPIDataClass) : void
      {
      }
      
      public function setUserTags(param1:IDAAPIDataClass) : void
      {
      }
      
      public function setArenaInfo(param1:IDAAPIDataClass) : void
      {
      }
   }
}

Edited by Armagomen_dev

Share this post


Link to post

Short link
Share on other sites
зачем колбэк, когда есть DAAPI?

 

потому что DAAPI мне не подходит.

 

 

643 строки кода..

ну и что смущает ? Да 643 но пока он не работает. Я приблизительно накидал.

 

 

 

а почему ваши текстовые поля необычные?

потому что я их из питона постоянно перезаписываю, а ваш вариант каким образом мне перезаписать? Вы отталкивались в примере от вгшного питона и способа.

У меня они выводятся по другому, У меня приходит не значение а HTML строка.

 

<font face="$TitleFont" size="20" color="#E0E06D"><img src="img://gui/maps/icons/achievement/32x32/mainGun.png" width="26" height="26" vspace="-7">+6240</font>

Edited by Armagomen_dev

Share this post


Link to post

Short link
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...