浏览代码

添加读取配置时计算词牌,服装数量

leiyasi 1 年之前
父节点
当前提交
a05324743e

+ 55 - 2
GameClient/Assets/Editor/Excel/Scanner/ItemApproachScanner.cs

@@ -2,6 +2,7 @@
 using UnityEngine;
 using GFGGame;
 using System;
+using System.Linq;
 
 namespace GFGEditor
 {
@@ -23,8 +24,12 @@ namespace GFGEditor
             Dictionary<SuitCfg, List<int>> suitDic = new Dictionary<SuitCfg, List<int>>();
             Dictionary<ItemCfg, List<int>> syntheticSuitDic = new Dictionary<ItemCfg, List<int>>();
             int suitPartTotalCount = 0;
+            int clothingPartsCount = 0;
+            int cardCount = 0;
             foreach (ItemCfg cfg in dataArray)
             {
+                HandleItemAndDressUpTable(cfg, ref clothingPartsCount);
+                HandleItemAndCardTable(cfg, ref cardCount);
                 HandleItemAndSuitTable(cfg, suitDic);
                 HandleItemApproch(cfg, actions);
                 HandleItemSyntheticSuit(cfg, syntheticSuitDic);
@@ -52,6 +57,8 @@ namespace GFGEditor
                     SQLiteHelper.Instance.UpdateValues(nameof(SuitCfgArray), names, values, nameof(a.Key.id), a.Key.id.ToString());
                 }
                 globalCfg.suitPartTotalCount = suitPartTotalCount;
+                globalCfg.ClothingPartsCount = clothingPartsCount;
+                globalCfg.CardCount = cardCount;
                 UpdateGlobalCfg(globalCfg);
 
                 //材料对应的套装id
@@ -74,8 +81,10 @@ namespace GFGEditor
 
         private static void UpdateGlobalCfg(GlobalCfg globalCfg)
         {
-            var names = new string[] { nameof(globalCfg.suitPartTotalCount) };
-            var values = new string[] { globalCfg.suitPartTotalCount.ToString() };
+            var names = new string[] 
+            { nameof(globalCfg.suitPartTotalCount), nameof(globalCfg.ClothingPartsCount), nameof(globalCfg.CardCount) };
+            var values = new string[] 
+            { globalCfg.suitPartTotalCount.ToString(), globalCfg.ClothingPartsCount.ToString(), globalCfg.CardCount.ToString() };
             SQLiteHelper.Instance.UpdateValues(nameof(GlobalCfgArray), names, values, nameof(globalCfg.id), globalCfg.id.ToString());
         }
 
@@ -130,6 +139,50 @@ namespace GFGEditor
             itemCfg.isHide = suitCfg.isHide;
         }
 
+        private static void HandleItemAndDressUpTable(ItemCfg itemCfg, ref int count)
+        {
+            if (itemCfg.isHide > 0)
+            {
+                return;
+            }
+            if (itemCfg.itemType == ConstItemType.DRESS_UP)
+            {
+                // 服装
+                bool isDressUp = Array.IndexOf(DressUpMenuItemDataManager.dressUpGuideSubType, itemCfg.subType) >= 0;
+                if (isDressUp)
+                {
+                    ++count;
+                    return;
+                }
+                // 饰品
+                bool isAccessories = Array.IndexOf(DressUpMenuItemDataManager.dressUpGuideAccessoriesType, itemCfg.subType) >= 0;
+                if (isAccessories)
+                {
+                    ++count;
+                    return;
+                }
+                // 特殊
+                bool isSpecial = itemCfg.subType > ConstDressUpItemType.TE_SHU;
+                if (isSpecial)
+                {
+                    ++count;
+                    return;
+                }
+            }
+        }
+
+        private static void HandleItemAndCardTable(ItemCfg itemCfg, ref int count)
+        {
+            if (itemCfg.isHide > 0)
+            {
+                return;
+            }
+            if (itemCfg.itemType == ConstItemType.CARD)
+            {
+                ++count;
+            }
+        }
+
         private static void HandleItemApproch(ItemCfg cfg, GetApproachCall[] actions)
         {
             if (cfg.id == 3000001 || cfg.id == 3000002 || cfg.id == 3000003)

+ 12 - 2
GameClient/Assets/Game/HotUpdate/Data/CardDataManager.cs

@@ -313,6 +313,11 @@ namespace GFGGame
 
             for (int i = 0; i < itemCfgs.Count; i++)
             {
+                if (itemCfgs[i].isHide > 0)
+                {
+                    continue;
+                }
+
                 if (mainScore == 0 || itemCfgs[i].mainScore == mainScore)
                 {
                     result.Add(itemCfgs[i].id);
@@ -324,14 +329,19 @@ namespace GFGGame
 
         public static void GetTotalProgress(out int haveCount, out int totalCount, int mainScore = 0)
         {
-            List<ItemCfg> itemCfgs = ItemCfgArray.Instance.GetCfgsByitemType(ConstItemType.CARD);
-            totalCount = itemCfgs.Count;
+            totalCount = GlobalCfgArray.globalCfg.CardCount;
 
             if (mainScore != 0)
             {
+                List<ItemCfg> itemCfgs = ItemCfgArray.Instance.GetCfgsByitemType(ConstItemType.CARD);
                 totalCount = 0;
                 for (int i = 0; i < itemCfgs.Count; i++)
                 {
+                    if (itemCfgs[i].isHide > 0)
+                    {
+                        continue;
+                    }
+
                     if (itemCfgs[i].mainScore == mainScore)
                     {
                         ++totalCount;

+ 36 - 23
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuItemDataManager.cs

@@ -623,12 +623,12 @@ namespace GFGGame
             }
         }
 
-        private static int[] dressUpGuideSubType = {
+        public static int[] dressUpGuideSubType = {
             ConstDressUpItemType.FA_XING, ConstDressUpItemType.LIAN_YI_QUN , ConstDressUpItemType.NEI_DA,
             ConstDressUpItemType.WAI_TAO,ConstDressUpItemType.SHANG_YI,ConstDressUpItemType.XIA_ZHUANG,ConstDressUpItemType.WA_ZI,
             ConstDressUpItemType.XIE_ZI,ConstDressUpItemType.SHOU_CHI_WU, ConstDressUpItemType.ZHUANG_RONG};
 
-        private static int[] dressUpGuideAccessoriesType = {
+        public static int[] dressUpGuideAccessoriesType = {
             ConstDressUpItemType.TOU_SHI, ConstDressUpItemType.ER_SHI , ConstDressUpItemType.JING_SHI,
             ConstDressUpItemType.MIAN_BU,ConstDressUpItemType.YAO_SHI,ConstDressUpItemType.SHOU_SHI,ConstDressUpItemType.PI_BO};
         
@@ -644,7 +644,7 @@ namespace GFGGame
             List<int> result = new List<int>();
             List<ItemCfg> itemCfgs = new List<ItemCfg>();
            
-
+            // 全部
             if (subType == 0)
             {
                 // 除饰品外的散件
@@ -658,7 +658,18 @@ namespace GFGGame
                 {
                     itemCfgs.AddRange(ItemCfgArray.Instance.GetCfgsByitemTypeAndsubType(ConstItemType.DRESS_UP, dressUpGuideAccessoriesType[i]));
                 }
+
+                // 特殊
+                ItemTypeCfg[] itemTypeCfg = ItemTypeCfgArray.Instance.dataArray;
+                for (int i = 0; i < itemTypeCfg.Length; i++)
+                {
+                    if (itemTypeCfg[i].type > ConstDressUpItemType.TE_SHU)
+                    {
+                        itemCfgs.AddRange(ItemCfgArray.Instance.GetCfgsByitemTypeAndsubType(ConstItemType.DRESS_UP, itemTypeCfg[i].type));
+                    }
+                }
             }
+            // 指定子类型
             else
             {
                 if(subType == ConstDressUpItemType.TE_SHU)
@@ -709,7 +720,10 @@ namespace GFGGame
 
             for (int i = 0; i < itemCfgs.Count; i++)
             {
-                result.Add(itemCfgs[i].id);
+                if(itemCfgs[i].isHide <= 0)
+                {
+                    result.Add(itemCfgs[i].id);
+                }
             }
 
             return result;
@@ -745,37 +759,36 @@ namespace GFGGame
         }
 
 
-        public static void GetTotalProgress(out int haveCount, out int totalCount, int subType = 0)
+        public static void GetTotalProgress(out int haveCount, out int totalCount)
         {
-            List<int> itemCfgs = GetAllDressUpGuideIdListBySubType(subType);
-            totalCount = itemCfgs.Count;
+            totalCount = GlobalCfgArray.globalCfg.ClothingPartsCount;
             haveCount = 0;
 
-            if (subType == 0)
+            // 除饰品外的散件
+            for (int i = 0; i < dressUpGuideSubType.Length; i++)
             {
-                // 除饰品外的散件
-                for (int i = 0; i < dressUpGuideSubType.Length; i++)
+                if (_itemDatasBySubTypeDic.ContainsKey(dressUpGuideSubType[i]))
                 {
-                    if (_itemDatasBySubTypeDic.ContainsKey(dressUpGuideSubType[i]))
-                    {
-                        haveCount += _itemDatasBySubTypeDic[dressUpGuideSubType[i]].Count;
-                    }
+                    haveCount += _itemDatasBySubTypeDic[dressUpGuideSubType[i]].Count;
                 }
+            }
 
-                // 饰品
-                for (int i = 0; i < dressUpGuideAccessoriesType.Length; i++)
+            // 饰品
+            for (int i = 0; i < dressUpGuideAccessoriesType.Length; i++)
+            {
+                if (_itemDatasBySubTypeDic.ContainsKey(dressUpGuideAccessoriesType[i]))
                 {
-                    if (_itemDatasBySubTypeDic.ContainsKey(dressUpGuideAccessoriesType[i]))
-                    {
-                        haveCount += _itemDatasBySubTypeDic[dressUpGuideAccessoriesType[i]].Count;
-                    }
+                    haveCount += _itemDatasBySubTypeDic[dressUpGuideAccessoriesType[i]].Count;
                 }
             }
-            else
+
+            // 特殊
+            if (_itemDatasBySubTypeDic.ContainsKey(ConstDressUpItemType.TE_SHU))
             {
-                haveCount = _itemDatasBySubTypeDic.ContainsKey(subType) ? _itemDatasBySubTypeDic[subType].Count : 0;
+                haveCount += _itemDatasBySubTypeDic[ConstDressUpItemType.TE_SHU].Count;
             }
-        }
+        
+    }
  
     }
 }

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/FieldGuide/UI_CompGuideItem.cs

@@ -10,6 +10,8 @@ namespace UI.FieldGuide
         public GLoader m_loaderPic;
         public GTextField m_txtProgress;
         public GTextField m_progressSymbol;
+        public Transition m_In;
+        public Transition m_Init;
         public const string URL = "ui://vqq9h9h4pjipe";
         public const string PACKAGE_NAME = "FieldGuide";
         public const string RES_NAME = "CompGuideItem";
@@ -60,12 +62,16 @@ namespace UI.FieldGuide
             m_loaderPic = (GLoader)comp.GetChild("loaderPic");
             m_txtProgress = (GTextField)comp.GetChild("txtProgress");
             m_progressSymbol = (GTextField)comp.GetChild("progressSymbol");
+            m_In = comp.GetTransition("In");
+            m_Init = comp.GetTransition("Init");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_loaderPic = null;
             m_txtProgress = null;
             m_progressSymbol = null;
+            m_In = null;
+            m_Init = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/FieldGuide/UI_FieldGuideUI.cs

@@ -10,6 +10,7 @@ namespace UI.FieldGuide
         public GLoader m_loaBg;
         public GButton m_btnBack;
         public GList m_listGuide;
+        public Transition m_openViewAction;
         public const string URL = "ui://vqq9h9h4pjip1";
         public const string PACKAGE_NAME = "FieldGuide";
         public const string RES_NAME = "FieldGuideUI";
@@ -60,12 +61,14 @@ namespace UI.FieldGuide
             m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_listGuide = (GList)comp.GetChild("listGuide");
+            m_openViewAction = comp.GetTransition("openViewAction");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_loaBg = null;
             m_btnBack = null;
             m_listGuide = null;
+            m_openViewAction = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/FieldGuide/UI_SuitTypeItem.cs

@@ -10,6 +10,8 @@ namespace UI.FieldGuide
         public GLoader m_icon;
         public GTextField m_title;
         public UI_ProgressBar3 m_progress;
+        public Transition m_In;
+        public Transition m_Init;
         public const string URL = "ui://vqq9h9h4e3ot6e";
         public const string PACKAGE_NAME = "FieldGuide";
         public const string RES_NAME = "SuitTypeItem";
@@ -60,6 +62,8 @@ namespace UI.FieldGuide
             m_icon = (GLoader)comp.GetChild("icon");
             m_title = (GTextField)comp.GetChild("title");
             m_progress = (UI_ProgressBar3)UI_ProgressBar3.Create(comp.GetChild("progress"));
+            m_In = comp.GetTransition("In");
+            m_Init = comp.GetTransition("Init");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -67,6 +71,8 @@ namespace UI.FieldGuide
             m_title = null;
             m_progress.Dispose();
             m_progress = null;
+            m_In = null;
+            m_Init = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/FieldGuide/UI_SuitTypeItems.cs

@@ -14,6 +14,7 @@ namespace UI.FieldGuide
         public UI_SuitTypeItem m_item5;
         public UI_SuitTypeItem m_item6;
         public UI_SuitTypeItem m_item7;
+        public Transition m_In;
         public const string URL = "ui://vqq9h9h4e3ot6f";
         public const string PACKAGE_NAME = "FieldGuide";
         public const string RES_NAME = "SuitTypeItems";
@@ -68,6 +69,7 @@ namespace UI.FieldGuide
             m_item5 = (UI_SuitTypeItem)UI_SuitTypeItem.Create(comp.GetChild("item5"));
             m_item6 = (UI_SuitTypeItem)UI_SuitTypeItem.Create(comp.GetChild("item6"));
             m_item7 = (UI_SuitTypeItem)UI_SuitTypeItem.Create(comp.GetChild("item7"));
+            m_In = comp.GetTransition("In");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -85,6 +87,7 @@ namespace UI.FieldGuide
             m_item6 = null;
             m_item7.Dispose();
             m_item7 = null;
+            m_In = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 13 - 4
GameClient/Assets/Game/HotUpdate/Views/FieldGuide/FieldGuideView.cs

@@ -2,6 +2,8 @@ using FairyGUI;
 using UI.FieldGuide;
 using System.Collections.Generic;
 using System;
+using System.Collections;
+using UnityEngine;
 
 namespace GFGGame
 {
@@ -50,7 +52,8 @@ namespace GFGGame
             base.OnShown();
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("tjbg");
             _ui.m_listGuide.numItems = _listGuideDatas.Length;
-            UpdatePrgress();
+            _ui.m_openViewAction.Play();
+            Timers.inst.StartCoroutine(UpdatePrgress());
         }
 
         protected override void OnHide()
@@ -90,6 +93,8 @@ namespace GFGGame
             listItem.target.data = id;
             bool red = actions[index] == null ? false : actions[index]();
             RedDotController.Instance.SetComRedDot(listItem.target, red, "", -46, 51);
+            listItem.m_Init.Play();
+
             UI_CompGuideItem.ProxyEnd();
         }
 
@@ -144,7 +149,7 @@ namespace GFGGame
             if (totalCount == 0) totalCount = 1;
         }
 
-        private void UpdatePrgress()
+        private IEnumerator UpdatePrgress()
         {
             int num = _ui.m_listGuide.numChildren;
             for (int i = 0; i < num; i++)
@@ -156,8 +161,11 @@ namespace GFGGame
                 GetGuideProgress(id, out haveCount, out totalCount);
                 decimal value = ProgressCalculate(haveCount, totalCount);
                 listItem.m_txtProgress.text = value.ToString();
+                listItem.m_In.Play();
                 UI_CompGuideItem.ProxyEnd();
+                yield return new WaitForSeconds(0.02f);
             }
+
         }
 
         public static int ProgressCalculate(int haveCount, int totalCount)
@@ -165,11 +173,11 @@ namespace GFGGame
             float rate = haveCount * 100.0f / totalCount;
             int result = 0;
 
-            if(rate > 0 && rate <= 1)
+            if (rate > 0 && rate <= 1)
             {
                 result = 1;
             }
-            else if(rate >= 99 && rate < 100)
+            else if (rate >= 99 && rate < 100)
             {
                 result = 99;
             }
@@ -180,5 +188,6 @@ namespace GFGGame
             return result;
         }
 
+
     }
 }

二进制
GameClient/Assets/ResIn/UI/FieldGuide/FieldGuide_fui.bytes