zhaoyang 3 years ago
parent
commit
cd41490f8d

+ 36 - 0
GameClient/Assets/Editor/Excel/CodeBuilder.cs

@@ -28,6 +28,7 @@ namespace GFGEditor
         private static List<int> _allIndexs = new List<int>();
         private static Dictionary<string, string> _idDic = new Dictionary<string, string>();
         private static Dictionary<string, string> _itemTypeDicByName = new Dictionary<string, string>();
+        private static Dictionary<string, string> _headAniDicByName = new Dictionary<string, string>();
 
         public static void GenerateCode(ExcelWorksheet worksheet, string configName, string configArrayName)
         {
@@ -371,6 +372,8 @@ namespace GFGEditor
 
         private static void WriteRowDataToSqlite(ExcelRange worksheet, string configArrayName, int row)
         {
+            string headAniKey = "";
+            string headAniValue = "";
             List<string> values = new List<string>();
             var keyValue = worksheet[row, 1].Text.Trim();
             foreach (var i in _indexs)
@@ -389,11 +392,32 @@ namespace GFGEditor
                     HandleItemCfgField(keyValue, name, ref value);
                     values.Add(value);
                 }
+                else if (configArrayName == nameof(StoryDialogCfgArray) && name == "headAni" && !string.IsNullOrEmpty(value))
+                {
+                    HandleStoryDialogCfgField(keyValue, name, ref value);
+                    values.Add(value);
+                }
                 else
                 {
                     string _value = GetValue(configArrayName, worksheet, name, row, i);
                     values.Add(_value);
                 }
+                if (configArrayName == nameof(HeadAniCfgArray))
+                {
+                    if (name == "name")
+                    {
+                        headAniKey = value;
+                    }
+                    else if (name == "headAni")
+                    {
+                        headAniValue = value;
+                    }
+
+                }
+            }
+            if (configArrayName == nameof(HeadAniCfgArray) && !string.IsNullOrEmpty(headAniKey) && !string.IsNullOrEmpty(headAniValue))
+            {
+                _headAniDicByName.Add(headAniKey, headAniValue);
             }
             SQLiteHelper.Instance.InsertValues(configArrayName, values.ToArray());
         }
@@ -437,7 +461,19 @@ namespace GFGEditor
                 }
             }
         }
+        private static void HandleStoryDialogCfgField(string idStr, string fieldName, ref string value)
+        {
 
+            if (!_headAniDicByName.ContainsKey(value))
+            {
+                ET.Log.Error(string.Format("剧情对话.xlsx  头像动画  {0} 无资源", value));
+                value = "";
+            }
+            else
+            {
+                value = _headAniDicByName[value];
+            }
+        }
         private static void CreateParamsString(List<string> keyNames, List<string> keyTypes, out string paramStr, out string colNames, out string colValues)
         {
             paramStr = "";

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/ClothingShop/ClothingShopView.cs

@@ -394,9 +394,10 @@ namespace GFGGame
         {
             UI_ListTagItem item = UI_ListTagItem.Proxy(obj);
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_cfgSelected.itemID);
-            string[] tag = itemCfg.tagsArr[index].Split('_');
-            item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tag[0]);
-            item.m_txtTag.text = tag[1];
+            string tag = itemCfg.tagsArr[index];
+            int tagType = TagCfgArray.Instance.GetCfg(tag).type;
+            item.m_txtTag.text = tag;
+            item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
             UI_ListTagItem.ProxyEnd();
         }
         private void CheckGuide(object param)

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -920,9 +920,10 @@ namespace GFGGame
         private void RenderListTagItem(int index, GObject obj)
         {
             UI.CommonGame.UI_ListTagItem item = UI.CommonGame.UI_ListTagItem.Proxy(obj);
-            string[] tag = _fightCfg.needTagsArr[index].Split('_');
-            item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tag[0]);
-            item.m_txtTag.text = tag[1];
+            string tag = _fightCfg.needTagsArr[index];
+            int tagType = TagCfgArray.Instance.GetCfg(tag).type;
+            item.m_txtTag.text = tag;
+            item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
             UI.CommonGame.UI_ListTagItem.ProxyEnd();
         }
         private bool CheckListCount(int type)

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryLevelInfoView.cs

@@ -274,9 +274,10 @@ namespace GFGGame
             UI_ListTagItem item = UI_ListTagItem.Proxy(obj);
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
-            string[] tag = fightCfg.needTagsArr[index].Split('_');
-            item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tag[0]);
-            item.m_txtTag.text = tag[1];
+            string tag = fightCfg.needTagsArr[index];
+            int tagType = TagCfgArray.Instance.GetCfg(tag).type;
+            item.m_txtTag.text = tag;
+            item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
             UI_ListTagItem.ProxyEnd();
         }
 

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes