Browse Source

改服装店转表工具

zhaoyang 2 years ago
parent
commit
c4e9cdc93d

+ 6 - 16
GameClient/Assets/Editor/Excel/Scanner/ShopScanner.cs

@@ -28,27 +28,17 @@ namespace GFGEditor
             SQLiteHelper.Instance.OpenConnection();
             try
             {
-                string typeIndex = "";
-                int itemId;
-                int id;
-                var reader = SQLiteHelper.Instance.ReadFullTable("ShopCfgArray");
-                while (reader.Read())
+                List<ShopCfg> clothingShopCfg = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.FU_ZHUANG_DIAN, ConstStoreSubId.FU_ZHUANG_DIAN);
+                for (int i = 0; i < clothingShopCfg.Count; i++)
                 {
-                    typeIndex = reader["_typeIndex"].ToString();
-                    itemId = int.Parse(reader["_itemId"].ToString());
-                    id = int.Parse(reader["_id"].ToString());
-                    int menu1 = int.Parse(reader["_menu1"].ToString());
-                    int menu2 = int.Parse(reader["_menu2"].ToString());
-                    if (menu1 != ConstStoreTabId.FU_ZHUANG_DIAN || menu2 != ConstStoreSubId.FU_ZHUANG_DIAN) continue;
-
                     int count;
-                    if (Array.IndexOf(_shopItemType, typeIndex) >= 0)
+                    if (Array.IndexOf(_shopItemType, clothingShopCfg[i].typeIndex) >= 0)
                     {
-                        count = Array.IndexOf(_shopItemType, typeIndex);
+                        count = Array.IndexOf(_shopItemType, clothingShopCfg[i].typeIndex);
                     }
                     else
                     {
-                        ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
+                        ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(clothingShopCfg[i].itemId);
                         string itemType = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType).type.ToString();
 
                         if (Array.IndexOf(_shopItemType, itemType) >= 0)
@@ -60,7 +50,7 @@ namespace GFGEditor
                             count = _shopItemType.Length - 1;
                         }
                     }
-                    _typeIndexDic.Add(id, count.ToString());
+                    _typeIndexDic.Add(clothingShopCfg[i].id, count.ToString());
                 }
             }
             catch (Exception e)

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Data/ShopDataManager.cs

@@ -60,10 +60,10 @@ namespace GFGGame
             switch (storeId)
             {
                 case ConstStoreId.CLOTHING_STORE_ID:
-                    shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2AndtypeIndex(ConstStoreTabId.FU_ZHUANG_DIAN, ConstStoreSubId.FU_ZHUANG_DIAN, typeIndex);
+                    shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2AndtypeIndex(ConstStoreTabId.FU_ZHUANG_DIAN, ConstStoreSubId.FU_ZHUANG_DIAN, typeIndex.ToString());
                     break;
                 case ConstStoreId.GALLERY_STORE_ID:
-                    shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2AndtypeIndex(ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_EXCHANGE_GALLERY, typeIndex);
+                    shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2AndtypeIndex(ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_EXCHANGE_GALLERY, typeIndex.ToString());
                     break;
             }
             SortItemListByScore(shopCfgs, scoreType);

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

@@ -133,7 +133,7 @@ namespace GFGGame
                     {
                         if (dataArray[i].itemId == _selectedItemId)
                         {
-                            _selectedType = dataArray[i].typeIndex;
+                            _selectedType = int.Parse(dataArray[i].typeIndex);
                             _selectedId = dataArray[i].id;
                             // ShopCfg clothingShopCfg = ShopCfgClothingArray.Instance.GetCfg(_selectedItemClothingId);
                             _ui.m_listType.selectedIndex = _selectedType;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/ClothingShop/GalleryShopView.cs

@@ -116,7 +116,7 @@ namespace GFGGame
                     {
                         if (dataArray[i].itemId == _selectedItemId)
                         {
-                            _selectedType = dataArray[i].typeIndex;
+                            _selectedType = int.Parse(dataArray[i].typeIndex);
                             _selectedId = dataArray[i].id;
                             _ui.m_comItemList.m_comBtnTab.m_c1.selectedIndex = _selectedType;
                             break;