Browse Source

新建阳春花蔓UI

leiyasi 1 year ago
parent
commit
fb99c97f18

+ 98 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Studio/UI_StudioActivityUI.cs

@@ -0,0 +1,98 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Studio
+{
+    public partial class UI_StudioActivityUI
+    {
+        public GComponent target;
+        public GLoader m_Bg;
+        public GComponent m_comValueBar;
+        public GButton m_btnBack;
+        public GLoader m_btnChageLine;
+        public GLoader m_loaBg;
+        public GTextField m_activityTitle;
+        public GList m_list;
+        public GButton m_btnReward;
+        public GTextField m_activityTipText;
+        public GTextField m_txtNum;
+        public const string URL = "ui://xz8kxrecp4yn5h";
+        public const string PACKAGE_NAME = "Studio";
+        public const string RES_NAME = "StudioActivityUI";
+        private static UI_StudioActivityUI _proxy;
+
+        public static UI_StudioActivityUI Create(GObject gObject = null)
+        {
+            var ui = new UI_StudioActivityUI();
+            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_StudioActivityUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_StudioActivityUI();
+            }
+            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_Bg = (GLoader)comp.GetChild("Bg");
+            m_comValueBar = (GComponent)comp.GetChild("comValueBar");
+            m_btnBack = (GButton)comp.GetChild("btnBack");
+            m_btnChageLine = (GLoader)comp.GetChild("btnChageLine");
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
+            m_activityTitle = (GTextField)comp.GetChild("activityTitle");
+            m_list = (GList)comp.GetChild("list");
+            m_btnReward = (GButton)comp.GetChild("btnReward");
+            m_activityTipText = (GTextField)comp.GetChild("activityTipText");
+            m_txtNum = (GTextField)comp.GetChild("txtNum");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_Bg = null;
+            m_comValueBar = null;
+            m_btnBack = null;
+            m_btnChageLine = null;
+            m_loaBg = null;
+            m_activityTitle = null;
+            m_list = null;
+            m_btnReward = null;
+            m_activityTipText = null;
+            m_txtNum = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Studio/UI_StudioActivityUI.cs.meta

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

+ 0 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Studio/UI_StudioFilingUI.cs

@@ -14,7 +14,6 @@ namespace UI.Studio
         public GButton m_btnChange;
         public GLoader m_btnChageLine;
         public GLoader m_loaBg;
-        public GTextField m_activityTitle;
         public GList m_list;
         public GButton m_btnReward;
         public GButton m_btnSuit;
@@ -78,7 +77,6 @@ namespace UI.Studio
             m_btnChange = (GButton)comp.GetChild("btnChange");
             m_btnChageLine = (GLoader)comp.GetChild("btnChageLine");
             m_loaBg = (GLoader)comp.GetChild("loaBg");
-            m_activityTitle = (GTextField)comp.GetChild("activityTitle");
             m_list = (GList)comp.GetChild("list");
             m_btnReward = (GButton)comp.GetChild("btnReward");
             m_btnSuit = (GButton)comp.GetChild("btnSuit");
@@ -98,7 +96,6 @@ namespace UI.Studio
             m_btnChange = null;
             m_btnChageLine = null;
             m_loaBg = null;
-            m_activityTitle = null;
             m_list = null;
             m_btnReward = null;
             m_btnSuit = null;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/ActivityThemeLuckyBox/ActivityThemeLuckyBoxView.cs

@@ -98,7 +98,7 @@ namespace GFGGame
         }
         private void OnBtnChapterClick()
         {
-            ViewManager.Show<StudioFilingView>(StudioDataManager.Instance.GetLuckyBoxActivityID());
+            ViewManager.Show<StudioActivityView>();
         }
         private void OnBtnLuckyBoxClick()
         {

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/ApproachView.cs

@@ -228,7 +228,7 @@ namespace GFGGame
                             StudioDataManager.Instance.npcFilingChapterId = studioCfg.id;
                             if (StudioDataManager.Instance.IsluckyBoxFilingChapter())
                             {
-                                ViewManager.Show<StudioFilingView>(studioCfg.id);
+                                ViewManager.Show<StudioActivityView>();
                             }
                             else
                             {

+ 214 - 0
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioActivityView.cs

@@ -0,0 +1,214 @@
+using System.Collections.Generic;
+using ET;
+using FairyGUI;
+using UI.Studio;
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class StudioActivityView : BaseWindow
+    {
+        private UI_StudioActivityUI _ui;
+        private ValueBarController _valueBarController;
+        private StudioCfg _studioCfg;
+        private List<StoryLevelCfg> _storyLevelCfgs;
+        private int _itemIndex = 0;
+
+        public override void Dispose()
+        {
+            if (_valueBarController != null)
+            {
+                _valueBarController.Dispose();
+                _valueBarController = null;
+            }
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_StudioActivityUI.PACKAGE_NAME;
+            _ui = UI_StudioActivityUI.Create();
+            this.viewCom = _ui.target;
+            isfullScreen = true;
+            isReturnView = true;
+            _valueBarController = new ValueBarController(_ui.m_comValueBar);
+
+            _ui.m_Bg.url = ResPathUtil.GetBgImgPath("bg_fhl");
+            _ui.m_btnChageLine.url = ResPathUtil.GetCommonGameResPath("zsx_fl");
+
+            _ui.m_list.itemRenderer = RenderListItem;
+
+            _ui.m_btnBack.onClick.Add(OnBtnBackClick);
+            _ui.m_btnReward.onClick.Add(OnBtnRewardClick);
+
+        }
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+            EventAgent.AddEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateView);
+            EventAgent.AddEventListener(ConstMessage.FILLING_CHANGE_CHAPTER, UpdateView);
+            EventAgent.AddEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnLimitChanged);
+            //EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
+
+        }
+
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+            EventAgent.RemoveEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateView);
+            EventAgent.RemoveEventListener(ConstMessage.FILLING_CHANGE_CHAPTER, UpdateView);
+            EventAgent.RemoveEventListener(ConstMessage.NOTICE_LIMIT_CHANGED, OnLimitChanged);
+            //EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
+            //EventAgent.RemoveEventListener(ConstMessage.STUDIO_FILING_UPDATE, UpdateView);
+
+        }
+
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _valueBarController.OnShown();
+
+            StudioDataManager.Instance.filingChapterId = StudioDataManager.Instance.GetLuckyBoxActivityID();
+
+            UpdateView();
+            UpdateItem();
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+            _valueBarController.OnHide();
+        }
+
+        private void RenderListItem(int index, GObject obj)
+        {
+            UI_ListLevelItem item = UI_ListLevelItem.Proxy(obj);
+            item.m_txtName.text = _storyLevelCfgs[index].name;
+            bool isFight = string.IsNullOrEmpty(_storyLevelCfgs[index].storyStartID);
+            string resBg = isFight ? "cyjd_di_1" : "cyjd_di_2";
+
+            if (isFight)
+            {
+                item.m_loaIcon.visible = false;
+                item.m_loaItem.visible = true;
+                StoryFightCfg storyFightCfg = StoryFightCfgArray.Instance.GetCfg(_storyLevelCfgs[index].fightID);
+                int itemId = DropOutCfgArray.Instance.GetCfgsByid(storyFightCfg.bonusRandomArr[0])[0].item;
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
+                item.m_loaItem.url = ResPathUtil.GetIconPath(itemCfg);
+                if (item.m_loaItem.data == null)
+                {
+                    item.m_loaItem.onClick.Add(OnLoaItemClick);
+                }
+                item.m_loaItem.data = index;
+            }
+            else
+            {
+                item.m_loaItem.visible = false;
+                item.m_loaIcon.visible = true;
+                item.m_loaIcon.url = string.Format("ui://Studio/{0}", _studioCfg.res);
+            }
+            item.m_grpLock.visible = index > 0 && !InstanceZonesDataManager.CheckLevelPass(_storyLevelCfgs[index - 1].id);
+            item.m_comFlower.m_c1.selectedIndex = InstanceZonesDataManager.GetStarCountHistory(_storyLevelCfgs[index].id);
+            if (item.m_loaBg.data == null)
+            {
+                item.m_loaBg.onClick.Add(OnListItemClick);
+            }
+            item.m_loaBg.data = index;
+            UI_ListLevelItem.ProxyEnd();
+        }
+
+        private void OnLoaItemClick(EventContext context)
+        {
+            GObject obj = context.sender as GObject;
+            int index = (int)obj.data;
+            StoryFightCfg storyFightCfg = StoryFightCfgArray.Instance.GetCfg(_storyLevelCfgs[index].fightID);
+            int itemId = DropOutCfgArray.Instance.GetCfgsByid(storyFightCfg.bonusRandomArr[0])[0].item;
+            GoodsItemTipsController.ShowItemTips(itemId);
+        }
+
+        private void OnListItemClick(EventContext context)
+        {
+            GObject obj = context.sender as GObject;
+            int index = (int)obj.data;
+            StoryLevelCfg storyLevelCfg = _storyLevelCfgs[index];
+            if (index > 0 && !InstanceZonesDataManager.CheckLevelPass(_storyLevelCfgs[index - 1].id))
+            {
+                PromptController.Instance.ShowFloatTextPrompt("需通关前置关卡");
+                return;
+            }
+
+            MainStoryDataManager.currentLevelCfgId = storyLevelCfg.id;
+            InstanceZonesController.ShowLevelView(storyLevelCfg.id, OnFinishFilingStoryLevel);
+        }
+
+        private void OnFinishFilingStoryLevel(int levelCfgId, bool firstPass, bool success)
+        {
+            //StudioDataManager.Instance.SetLuckyBoxActivityID(MainStoryDataManager.currentChapterCfgId);
+            ViewManager.Show<StudioActivityView>();
+        }
+
+        private void UpdateView()
+        {
+            _studioCfg = StudioCfgArray.Instance.GetCfg(StudioDataManager.Instance.filingChapterId);
+            RoleLimitData limitData = RoleLimitDataManager.GetLimitData(this._studioCfg.limit);
+            var limitCfg = LimitCfgArray.Instance.GetCfg(this._studioCfg.limit);
+            _ui.m_loaBg.url = ResPathUtil.GetStudioFilingPicPath(_studioCfg.res); //ResPathUtil.GetBgImgPath(_studioCfg.res);
+            _ui.m_txtNum.text = string.Format("剩余次数:{0}/{1}", limitData.TotalPlayMax - limitData.PlayTimes, limitData.MaxStorageCount);
+
+            _ui.m_activityTipText.SetVar("name", _studioCfg.name).FlushVars();
+            _ui.m_activityTitle.text = _studioCfg.name;
+
+
+            _storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(_studioCfg.type, _studioCfg.subType, StudioDataManager.Instance.filingChapterId);
+            _ui.m_list.numItems = _storyLevelCfgs.Count;
+
+            //UpdateRedDot();
+        }
+
+        private void UpdateItem()
+        {
+            for (int i = 0; i < _ui.m_list.numChildren; i++)
+            {
+                _ui.m_list.GetChildAt(i).visible = false;
+            }
+            _itemIndex = 0;
+            Timers.inst.Add(0.05f, _ui.m_list.numChildren, AddItemUpdate, 1);
+        }
+
+        private void AddItemUpdate(object param)
+        {
+            _ui.m_list.GetChildAt(_itemIndex).visible = true;
+            UI_ListLevelItem item = UI_ListLevelItem.Proxy(_ui.m_list.GetChildAt(_itemIndex));
+            item.m_Left.Play();
+            _itemIndex++;
+            UI_ListLevelItem.ProxyEnd();
+        }
+
+        protected void OnBtnBackClick()
+        {
+            Hide();
+        }
+
+        private void OnBtnRewardClick()
+        {
+            ViewManager.Show<StudioFilingRewardView>();
+        }
+
+        private void OnLimitChanged(EventContext context)
+        {
+            int limitId = (int)context.data;
+            if (this._studioCfg.limit != limitId)
+            {
+                return;
+            }
+            UpdateView();
+        }
+
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioActivityView.cs.meta

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

+ 6 - 16
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioFilingView.cs

@@ -119,24 +119,14 @@ namespace GFGGame
             _ui.m_btnChange.title = _studioCfg.name;
             _ui.m_txtNum.text = string.Format("剩余次数:{0}/{1}", limitData.TotalPlayMax - limitData.PlayTimes, limitData.MaxStorageCount);
 
-            // 如果是活动界面,不显示套装获取进度
-            if (StudioDataManager.Instance.IsluckyBoxFilingChapter())
-            {
-                _ui.m_type.SetSelectedIndex(1);
-                _ui.m_activityTipText.SetVar("name", _studioCfg.name).FlushVars();
-                _ui.m_activityTitle.text = _studioCfg.name;
-            }
-            else
-            {
-                _ui.m_type.SetSelectedIndex(0);
-                SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_studioCfg.suitId);
-                _ui.m_txtSuitName.text = suitCfg.name;
+            _ui.m_type.SetSelectedIndex(0);
+            SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_studioCfg.suitId);
+            _ui.m_txtSuitName.text = suitCfg.name;
 
-                DressUpMenuSuitDataManager.GetSuitProgressBySuitId(_studioCfg.suitId, out int count, out int totalCount);
-                _ui.m_txtSuitProgress.text = string.Format("({0}/{1})", count, totalCount);
+            DressUpMenuSuitDataManager.GetSuitProgressBySuitId(_studioCfg.suitId, out int count, out int totalCount);
+            _ui.m_txtSuitProgress.text = string.Format("({0}/{1})", count, totalCount);
 
-                _ui.m_suitIcon.url = ResPathUtil.GetIconPath(suitCfg.res, "png");
-            }
+            _ui.m_suitIcon.url = ResPathUtil.GetIconPath(suitCfg.res, "png");
 
             _storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(_studioCfg.type, _studioCfg.subType, StudioDataManager.Instance.filingChapterId);
             _ui.m_list.numItems = _storyLevelCfgs.Count;

BIN
GameClient/Assets/ResIn/UI/Studio/Studio_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/Studio/Studio_atlas0.png


BIN
GameClient/Assets/ResIn/UI/Studio/Studio_fui.bytes