Browse Source

搭配赛补充提交

zhangyuqian 1 year ago
parent
commit
53bf1aaf1f

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/MatchingCompetition/UI_ComRewardList.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.MatchingCompetition
+{
+    public partial class UI_ComRewardList
+    {
+        public GComponent target;
+        public GList m_listReward;
+        public const string URL = "ui://ri3cveycjw093y";
+        public const string PACKAGE_NAME = "MatchingCompetition";
+        public const string RES_NAME = "ComRewardList";
+        private static UI_ComRewardList _proxy;
+
+        public static UI_ComRewardList Create(GObject gObject = null)
+        {
+            var ui = new UI_ComRewardList();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ComRewardList Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComRewardList();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_listReward = (GList)comp.GetChild("listReward");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_listReward = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/MatchingCompetition/UI_ComRewardList.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fa1731df43f00fa49ac2735e20488e07
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 90 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/MatchingCompetition/UI_MatchingCompetitionRewardUI.cs

@@ -0,0 +1,90 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.MatchingCompetition
+{
+    public partial class UI_MatchingCompetitionRewardUI
+    {
+        public GComponent target;
+        public GGraph m_mask;
+        public GGraph m_holderBgCom;
+        public GGraph m_holderTitle;
+        public GGroup m_downTipsText;
+        public UI_ComRewardList m_comList;
+        public GGroup m_grp;
+        public Transition m_openViewAction;
+        public const string URL = "ui://ri3cveycjw093x";
+        public const string PACKAGE_NAME = "MatchingCompetition";
+        public const string RES_NAME = "MatchingCompetitionRewardUI";
+        private static UI_MatchingCompetitionRewardUI _proxy;
+
+        public static UI_MatchingCompetitionRewardUI Create(GObject gObject = null)
+        {
+            var ui = new UI_MatchingCompetitionRewardUI();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_MatchingCompetitionRewardUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_MatchingCompetitionRewardUI();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_mask = (GGraph)comp.GetChild("mask");
+            m_holderBgCom = (GGraph)comp.GetChild("holderBgCom");
+            m_holderTitle = (GGraph)comp.GetChild("holderTitle");
+            m_downTipsText = (GGroup)comp.GetChild("downTipsText");
+            m_comList = (UI_ComRewardList)UI_ComRewardList.Create(comp.GetChild("comList"));
+            m_grp = (GGroup)comp.GetChild("grp");
+            m_openViewAction = comp.GetTransition("openViewAction");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_mask = null;
+            m_holderBgCom = null;
+            m_holderTitle = null;
+            m_downTipsText = null;
+            m_comList.Dispose();
+            m_comList = null;
+            m_grp = null;
+            m_openViewAction = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/MatchingCompetition/UI_MatchingCompetitionRewardUI.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b5c5269a03a26f94698d3db4ed300df9
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 229 - 0
GameClient/Assets/Game/HotUpdate/Views/MatchingCompetition/MatchingCompetitionRewardView.cs

@@ -0,0 +1,229 @@
+using System.Collections;
+using UnityEngine;
+using UI.MatchingCompetition;
+using FairyGUI;
+using System.Collections.Generic;
+using System;
+
+namespace GFGGame
+{
+    public class MatchingCompetitionRewardView : BaseWindow
+    {
+        private UI_MatchingCompetitionRewardUI _ui;
+        private List<ItemData> _listItemDatas;
+
+        private Action onSuccess = null;
+
+        private List<EffectUI> _effects = new List<EffectUI>();
+
+        private const int maxHeight = 1030;
+
+        private EffectUI _effectUI1;
+        private EffectUI _effectUI2;
+        private int counTime = 0;  //定时器计数
+
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            _ui = UI_MatchingCompetitionRewardUI.Create();
+            this.viewCom = _ui.target;
+            //this.viewCom.Center();
+            //this.modal = true;
+            //viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
+            isfullScreen = true;
+
+            _ui.m_comList.m_listReward.itemRenderer = RenderListRewardItem;
+            _ui.m_mask.onClick.Add(this.Hide);
+        }
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _ui.m_mask.touchable = false;
+            if ((this.viewData as object[]).Length > 0)
+            {
+                _listItemDatas = (this.viewData as object[])[0] as List<ItemData>;
+                onSuccess = (this.viewData as object[])[1] as Action;
+            }
+            else
+            {
+                _listItemDatas = this.viewData as List<ItemData>;
+            }
+
+            List<ItemData> suitPart = new List<ItemData>(); ;
+            for (int i = _listItemDatas.Count - 1; i >= 0; i--)
+            {
+                SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_listItemDatas[i].id);
+                if (suitCfg != null)
+                {
+                    for (int j = 0; j < suitCfg.partsArr.Length; j++)
+                    {
+                        suitPart.Add(ItemUtil.createItemData(suitCfg.partsArr[j], _listItemDatas[i].num));
+                    }
+                    _listItemDatas.RemoveAt(i);
+                }
+            }
+            _listItemDatas.AddRange(suitPart);
+            //_ui.m_listReward.SetVirtual();  //有虚拟列表的时候,没有办法居中显示列表
+
+            _ui.m_downTipsText.visible = false;
+            _ui.m_comList.m_listReward.numItems = 0;
+            counTime = 0;
+            Timers.inst.Add(0.1f, 3, OnTimerUpdate, 1);
+            Timers.inst.Add(0.5f, 1, OnTimerClick);
+        }
+
+        private void OnTimerClick(object param)
+        {
+            _ui.m_mask.touchable = true;
+        }
+
+        private void OnTimerUpdate(object param)
+        {
+            counTime += 1;
+            if (counTime == 1)
+            {
+                _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderTitle, "ui_hd", "GXHD_Text");
+                _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderBgCom, "ui_hd", "TC_Quad_ALL");
+            }
+            else if (counTime == 2)
+            {
+                _ui.m_comList.m_listReward.numItems = _listItemDatas.Count;
+
+                _ui.m_comList.m_listReward.ResizeToFit();
+                if (_ui.m_comList.m_listReward.height > maxHeight)
+                {
+                    _ui.m_comList.m_listReward.height = maxHeight;
+                }
+            }
+            else if (counTime == 3)
+            {
+                _ui.m_downTipsText.visible = true;
+                Timers.inst.Remove(OnTimerUpdate);
+            }
+        }
+
+        protected override void OnHide()
+        {
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
+
+            Timers.inst.Remove(OnTimerUpdate);
+            Timers.inst.Remove(OnTimerClick);
+            _ui.m_mask.touchable = true;
+            for (int i = 0; i < _effects.Count; i++)
+            {
+                if (_effects[i] != null)
+                {
+                    EffectUIPool.Recycle(_effects[i]);
+                    _effects[i] = null;
+                }
+            }
+            _effects.Clear();
+
+            if (onSuccess != null)
+            {
+                onSuccess();
+            }
+            base.OnHide();
+            //_effects.Clear();
+            EventAgent.DispatchEvent(ConstMessage.REWARDVIEW_CLOTHER);
+            GetSuitItemController.TryShow(0);
+        }
+        private void RenderListRewardItem(int index, GObject obj)
+        {
+            // obj.data = _listItemDatas[index];
+            UI.CommonGame.UI_ComItem item = UI.CommonGame.UI_ComItem.Proxy(obj);
+            string name = "";
+            string iconRes = "";
+            string ext = "png";
+            int rarity = 0;
+            int id = 0;
+            bool isSuit = false;
+
+            SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_listItemDatas[index].id);
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_listItemDatas[index].id);
+
+            if (suitCfg != null)
+            {
+                name = suitCfg.name;
+                iconRes = suitCfg.res;
+                rarity = suitCfg.rarity;
+                id = suitCfg.id;
+                isSuit = true;
+            }
+            else
+            {
+                name = itemCfg.name;
+                ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
+                iconRes = itemCfg.res;
+                id = itemCfg.id;
+                isSuit = false;
+                //if (itemCfg.itemType == ConstItemType.DRESS_UP)
+                rarity = itemCfg.rarity;
+            }
+
+            item.m_txtName.text = name;
+            // item.m_txtCount.text = _listItemDatas[index].num==1?"": string.Format("{0}", _listItemDatas[index].num);
+            item.m_txtCount.text = string.Format("{0}", _listItemDatas[index].num);
+            item.m_loaIcon.url = ResPathUtil.GetIconPath(iconRes, ext);
+            if (rarity > 0)
+            {
+                item.m_QualityType.selectedIndex = rarity - 1;
+            }
+            else
+            {
+                item.m_QualityType.selectedIndex = 0;
+            }
+
+            RarityIconController.UpdateRarityIcon(item.m_loaRarity, id, false, isSuit);
+
+            item.m_imgOnceBonus.visible = _listItemDatas[index].isOnceBonus;
+            //特效("ui_ck", "ui_ck_zl");
+            int childIndex = _ui.m_comList.m_listReward.ItemIndexToChildIndex(index);
+            if (_effects.Count <= childIndex)
+            {
+                EffectUI _effectUI = EffectUIPool.CreateEffectUI(item.m_holderReware, "ui_hd", "GXHD_WuPin", 120);
+                _effects.Add(_effectUI);
+            }
+
+            if (item.target.data == null)
+            {
+                item.target.onClick.Add(OnClickListReward);
+            }
+            item.target.data = _listItemDatas[index];
+            UI.CommonGame.UI_ComItem.ProxyEnd();
+        }
+
+        private void OnClickListReward(EventContext context)
+        {
+            if (this.ShowTips)
+            {
+                ItemData data = (context.sender as GObject).data as ItemData;
+                GoodsItemTipsController.ShowItemTips(data.id);
+            }
+        }
+
+        private bool _showTips = true;
+        /// <summary>
+        /// 是否展示物品详情,默认展示
+        /// </summary>
+        private bool ShowTips
+        {
+            get { return _showTips; }
+            set { _showTips = value; }
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/MatchingCompetition/MatchingCompetitionRewardView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2006751c01500084daa70311f2396e6b
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MatchingCompetition/MatchingCompetitionSelectView.cs

@@ -97,7 +97,7 @@ namespace GFGGame
         {
             if(MatchingCompetitionDataManager.Instance.SpecialBonusList != null && MatchingCompetitionDataManager.Instance.SpecialBonusList.Count > 0)
             {
-                BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(MatchingCompetitionDataManager.Instance.SpecialBonusList)); ;
+                ViewManager.Show<MatchingCompetitionRewardView>(new object[] { ItemUtil.CreateItemDataList(MatchingCompetitionDataManager.Instance.SpecialBonusList),null});
                 MatchingCompetitionDataManager.Instance.SpecialBonusList = null;
             }
         }

BIN
GameClient/Assets/ResIn/UI/MatchingCompetition/MatchingCompetition_fui.bytes