| 
					
				 | 
			
			
				@@ -0,0 +1,123 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+using UnityEngine; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+using FairyGUI; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+using UI.OpenServerActivity; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+using System.Collections.Generic; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+using UI.CommonGame; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+namespace GFGGame 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public class OpenServerSuitAdditionView : BaseWindow 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private UI_OpenServerSuitAdditionUI _ui; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private int _activityType; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private int _activityId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private EffectUI _effectUI1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private EffectUI _effectUI2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public override void Dispose() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            EffectUIPool.Recycle(_effectUI1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _effectUI1 = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            EffectUIPool.Recycle(_effectUI2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _effectUI2 = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (_ui != null) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _ui.Dispose(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _ui = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            base.Dispose(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        protected override void Init() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            base.Init(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        protected override void OnInit() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            base.OnInit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            packageName = UI_OpenServerSuitAdditionUI.PACKAGE_NAME; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _ui = UI_OpenServerSuitAdditionUI.Create(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            viewCom = _ui.target; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.viewCom.Center(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.modal = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _ui.m_list.itemRenderer = ListItemRenderer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AddEffect(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        protected override void AddEventListener() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            base.AddEventListener(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        protected override void OnShown() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            base.OnShown(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _activityType = (int)(this.viewData as object[])[0]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            int levelID = (int)(this.viewData as object[])[1]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(_activityType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(_activityId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ActivityFightCfg fightCfg = ActivityFightCfgArray.Instance.GetCfg(activityOpenCfg.params3Arr[0]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _ui.m_list.numItems = fightCfg.activitySuitIdArr.Length; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            StudioDataManager.Instance.filingChapterId = levelCfg.chapterId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            float addition = StudioDataManager.Instance.GetAddition(ConstInstanceZonesType.PureFight); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            addition = addition / 10000 * 100; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _ui.m_txtPer.text = "(" + addition + "%)"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        protected override void OnHide() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            base.OnHide(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        protected override void RemoveEventListener() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            base.RemoveEventListener(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private void ListItemRenderer(int index, GObject item) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            UI_suitAdditionItem listItem = UI_suitAdditionItem.Proxy(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(_activityId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ActivityFightCfg fightCfg = ActivityFightCfgArray.Instance.GetCfg(activityOpenCfg.params3Arr[0]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            int suitId = fightCfg.activitySuitIdArr[index]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            listItem.m_txtName.text = suitCfg.name; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (listItem.m_list.data == null) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                listItem.m_list.itemRenderer = ListItemRewardRender; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            listItem.m_list.data = suitCfg.partsArr; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            listItem.m_list.numItems = suitCfg.partsArr.Length; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            listItem.m_list.ResizeToFit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            listItem.target.height = listItem.m_list.y + listItem.m_list.height; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            UI_suitAdditionItem.ProxyEnd(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private void ListItemRewardRender(int index, GObject obj) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            int itemId = (int)(obj.parent.data as int[])[index]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            UI_ComItem item = UI_ComItem.Proxy(obj); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            RarityIconController.UpdateRarityIcon(item.m_loaRarity, itemId, false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.target.data = itemCfg; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.m_QualityType.selectedIndex = itemCfg.rarity - 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            item.m_txtCount.text = "1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            UI_ComItem.ProxyEnd(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private void AddEffect() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //边框左上角特效 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderLeftTop, "ui_Activity", "Com_window_L_up"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //边框右下角特效 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderRightDowm, "ui_Activity", "Com_window_R_Down"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |