Browse Source

Merge remote-tracking branch 'remotes/origin/guodong' into zhaoyang

zhaoyang 3 years ago
parent
commit
36a68594e4

+ 3 - 3
GameClient/Assets/Editor/Excel/ExcelChecker.cs

@@ -122,9 +122,9 @@ namespace GFGEditor
 
         private static void CheckClothingShopCfg()
         {
-            ClothingShopCfgArray cfgArray = ClothingShopCfgArray.Instance;
-            ClothingShopCfg[] dataArray = cfgArray.dataArray;
-            foreach(ClothingShopCfg cfg in dataArray)
+            ShopCfgClothingArray cfgArray = ShopCfgClothingArray.Instance;
+            ShopCfg[] dataArray = cfgArray.dataArray;
+            foreach(ShopCfg cfg in dataArray)
             {
                 CheckItemIdExist(cfg.itemID, "商城ClothingShopCfg.itemID");
                 CheckItemIdExist(cfg.costID, "商城ClothingShopCfg.costID");

+ 3 - 3
GameClient/Assets/Editor/Excel/Scanner/ItemApproachScanner.cs

@@ -87,9 +87,9 @@ namespace GFGEditor
         /// <returns></returns>
         private static string GetClothingShopApproach(int itemId)
         {
-            ClothingShopCfgArray manager = ClothingShopCfgArray.Instance;
-            ClothingShopCfg[] dataArray = manager.dataArray;
-            foreach (ClothingShopCfg cfg in dataArray)
+            ShopCfgClothingArray manager = ShopCfgClothingArray.Instance;
+            ShopCfg[] dataArray = manager.dataArray;
+            foreach (ShopCfg cfg in dataArray)
             {
                 if (cfg.itemID == itemId)
                 {

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit 294f9d5d7fd36d34c9e4810b49b534f864203b5c
+Subproject commit be6b266ea16b997f58c915e170b831d367c5c7d6

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/Cache/LuckyBoxBonusDataCache.cs

@@ -149,7 +149,7 @@ namespace GFGGame
             }
             else
             {
-                CurrencyRatioCfg currencyRatioCfg = ItemUtil.GetCurrencyRatioCfgById(itemId);
+                ItemExchangeCfg currencyRatioCfg = ItemUtil.GetCurrencyRatioCfgById(itemId);
                 int costHasNum = ItemDataManager.GetItemNum(currencyRatioCfg.costId);
                 int costNeedNum = ItemUtil.GetCostItemCount(itemId, count - hasNum);
                 if (costHasNum >= costNeedNum)

+ 17 - 17
GameClient/Assets/Game/HotUpdate/ExcelConfig/Manager/ClothingShopCfgManager.cs

@@ -5,11 +5,11 @@ namespace GFGGame
     public class ClothingShopCfgManager : SingletonBase<ClothingShopCfgManager>
     {
         private bool _inited;
-        private Dictionary<int, Dictionary<int, List<ClothingShopCfg>>> _dataDic = new Dictionary<int, Dictionary<int, List<ClothingShopCfg>>>();
+        private Dictionary<int, Dictionary<int, List<ShopCfg>>> _dataDic = new Dictionary<int, Dictionary<int, List<ShopCfg>>>();
 
-        public List<ClothingShopCfg> GetList(int storeId, int typeIndex, int scoreType)
+        public List<ShopCfg> GetList(int storeId, int typeIndex, int scoreType)
         {
-            List<ClothingShopCfg> list = new List<ClothingShopCfg>();
+            List<ShopCfg> list = new List<ShopCfg>();
             InitData();
             if (_dataDic.ContainsKey(storeId) && _dataDic[storeId].ContainsKey(typeIndex))
             {
@@ -19,9 +19,9 @@ namespace GFGGame
             return list;
         }
 
-        private List<ClothingShopCfg> SortItemListByScore(List<ClothingShopCfg> arrayList, int scoreType)
+        private List<ShopCfg> SortItemListByScore(List<ShopCfg> arrayList, int scoreType)
         {
-            arrayList.Sort((ClothingShopCfg a, ClothingShopCfg b) =>
+            arrayList.Sort((ShopCfg a, ShopCfg b) =>
             {
                 int numA = ItemDataManager.GetItemNum(a.itemID);
                 int numB = ItemDataManager.GetItemNum(b.itemID);
@@ -60,43 +60,43 @@ namespace GFGGame
                 return;
             }
             _inited = true;
-            ClothingShopCfg[] clotiongDataArray = ClothingShopCfgArray.Instance.dataArray;
-            foreach (ClothingShopCfg cfg in clotiongDataArray)
+            ShopCfg[] clotiongDataArray = ShopCfgClothingArray.Instance.dataArray;
+            foreach (ShopCfg cfg in clotiongDataArray)
             {
                 if (_dataDic.ContainsKey(ConstStoreId.CLOTHING_STORE_ID)==false){
-                    _dataDic[ConstStoreId.CLOTHING_STORE_ID] = new Dictionary<int, List<ClothingShopCfg>>();
+                    _dataDic[ConstStoreId.CLOTHING_STORE_ID] = new Dictionary<int, List<ShopCfg>>();
                 }
                 if (_dataDic[ConstStoreId.CLOTHING_STORE_ID].ContainsKey(cfg.typeIndex)==false)
                 {
-                    _dataDic[ConstStoreId.CLOTHING_STORE_ID][cfg.typeIndex] = new List<ClothingShopCfg>();
+                    _dataDic[ConstStoreId.CLOTHING_STORE_ID][cfg.typeIndex] = new List<ShopCfg>();
                 }
                 _dataDic[ConstStoreId.CLOTHING_STORE_ID][cfg.typeIndex].Add(cfg);
             }
 
-            ClothingShopCfg[] clothingCJDataArray = ClothingShopCfgCJArray.Instance.dataArray;
-            foreach (ClothingShopCfg cfg in clothingCJDataArray)
+            ShopCfg[] clothingCJDataArray = ShopCfgCJArray.Instance.dataArray;
+            foreach (ShopCfg cfg in clothingCJDataArray)
             {
                 if (_dataDic.ContainsKey(ConstStoreId.LUCKY_BOX_STORE_ID) == false)
                 {
-                    _dataDic[ConstStoreId.LUCKY_BOX_STORE_ID] = new Dictionary<int, List<ClothingShopCfg>>();
+                    _dataDic[ConstStoreId.LUCKY_BOX_STORE_ID] = new Dictionary<int, List<ShopCfg>>();
                 }
                 if (_dataDic[ConstStoreId.LUCKY_BOX_STORE_ID].ContainsKey(cfg.typeIndex) == false)
                 {
-                    _dataDic[ConstStoreId.LUCKY_BOX_STORE_ID][cfg.typeIndex] = new List<ClothingShopCfg>();
+                    _dataDic[ConstStoreId.LUCKY_BOX_STORE_ID][cfg.typeIndex] = new List<ShopCfg>();
                 }
                 _dataDic[ConstStoreId.LUCKY_BOX_STORE_ID][cfg.typeIndex].Add(cfg);
             }
 
-            ClothingShopCfg[] clothingCJADataArray = ClothingShopCfgCJArray.Instance.dataArray;
-            foreach (ClothingShopCfg cfg in clothingCJADataArray)
+            ShopCfg[] clothingCJADataArray = ShopCfgCJArray.Instance.dataArray;
+            foreach (ShopCfg cfg in clothingCJADataArray)
             {
                 if (_dataDic.ContainsKey(ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID) == false)
                 {
-                    _dataDic[ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID] = new Dictionary<int, List<ClothingShopCfg>>();
+                    _dataDic[ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID] = new Dictionary<int, List<ShopCfg>>();
                 }
                 if (_dataDic[ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID].ContainsKey(cfg.typeIndex) == false)
                 {
-                    _dataDic[ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID][cfg.typeIndex] = new List<ClothingShopCfg>();
+                    _dataDic[ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID][cfg.typeIndex] = new List<ShopCfg>();
                 }
                 _dataDic[ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID][cfg.typeIndex].Add(cfg);
             }

+ 9 - 9
GameClient/Assets/Game/HotUpdate/Utils/ItemUtil.cs

@@ -14,7 +14,7 @@ namespace GFGGame
         /// <param name="showTxtBuyTips">是否显示购买提示</param>
         public static void ExchangeItemById(int itemId, int num, bool showTips = true, Action onSuccess = null, bool openSource = false, int maxCount = 9990, bool showTxtBuyTips = false, string prefix = "")
         {
-            CurrencyRatioCfg currencyRatioCfg = GetCurrencyRatioCfgById(itemId);
+            ItemExchangeCfg currencyRatioCfg = GetCurrencyRatioCfgById(itemId);
             if (itemId == ConstItemID.GOLD)
             {
                 AddGold(num, onSuccess);
@@ -30,15 +30,15 @@ namespace GFGGame
             }
         }
 
-        public static CurrencyRatioCfg GetCurrencyRatioCfgById(int itemId)
+        public static ItemExchangeCfg GetCurrencyRatioCfgById(int itemId)
         {
-            CurrencyRatioCfg[] currencyRatioCfgs = CurrencyRatioCfgArray.Instance.GetCfgs(itemId);
+            ItemExchangeCfg[] currencyRatioCfgs = ItemExchangeCfgArray.Instance.GetCfgs(itemId);
             if (currencyRatioCfgs.Length == 0)
             {
                 UnityEngine.Debug.LogWarning(itemId + "在h货币换算.xlsx中没有配置");
                 return null;
             }
-            CurrencyRatioCfg currencyRatioCfg;
+            ItemExchangeCfg currencyRatioCfg;
             if (itemId == ConstItemID.POWER)
             {
                 int powerBuyTimes = GameGlobal.myNumericComponent.GetAsInt(NumericType.PowerBuyTimes);
@@ -60,7 +60,7 @@ namespace GFGGame
         }
         public static void AddPower(string prefix = "", Action onSuccess = null)
         {
-            CurrencyRatioCfg currencyRatioCfg = GetCurrencyRatioCfgById(ConstItemID.POWER);
+            ItemExchangeCfg currencyRatioCfg = GetCurrencyRatioCfgById(ConstItemID.POWER);
             int count = GetCostItemCount(ConstItemID.POWER, currencyRatioCfg.num);
             int powerBuyTimes = GameGlobal.myNumericComponent.GetAsInt(NumericType.PowerBuyTimes);
             int lastBuyCount = currencyRatioCfg.maxLimit - powerBuyTimes;
@@ -79,7 +79,7 @@ namespace GFGGame
 
         public static void AddGold(int value = 0, Action onSuccess = null)
         {
-            CurrencyRatioCfg currencyRatioCfg = GetCurrencyRatioCfgById(ConstItemID.GOLD);
+            ItemExchangeCfg currencyRatioCfg = GetCurrencyRatioCfgById(ConstItemID.GOLD);
             int count = value > 0 ? value : currencyRatioCfg.num;
             int costCount = GetCostItemCount(ConstItemID.GOLD, count);
             int lastBuyCount = currencyRatioCfg.maxLimit - GameGlobal.myNumericComponent.GetAsInt(NumericType.GoldBuyTimes);
@@ -112,7 +112,7 @@ namespace GFGGame
         public static void AddDiamondRed(int value = 0, Action onSuccess = null)
         {
 
-            CurrencyRatioCfg currencyRatioCfg = GetCurrencyRatioCfgById(ConstItemID.DIAMOND_RED);
+            ItemExchangeCfg currencyRatioCfg = GetCurrencyRatioCfgById(ConstItemID.DIAMOND_RED);
             BuyItemConteoller.Show(currencyRatioCfg.id, currencyRatioCfg.costId, currencyRatioCfg.num, currencyRatioCfg.costNum, value > 0 ? value : currencyRatioCfg.num, onSuccess, true, true, GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
             BuyItemConteoller.showTxtBuyTips = true;
         }
@@ -121,7 +121,7 @@ namespace GFGGame
         /// </summary>
         public static int GetCostItemCount(int itemId, int count)
         {
-            CurrencyRatioCfg currencyRatioCfg = GetCurrencyRatioCfgById(itemId);
+            ItemExchangeCfg currencyRatioCfg = GetCurrencyRatioCfgById(itemId);
             if (currencyRatioCfg != null)
             {
                 return (int)Math.Ceiling((decimal)count / currencyRatioCfg.num * currencyRatioCfg.costNum);
@@ -137,7 +137,7 @@ namespace GFGGame
         /// </summary>
         public static int GetItemExChangeCount(int itemId, int costCount)
         {
-            CurrencyRatioCfg currencyRatioCfg = GetCurrencyRatioCfgById(itemId);
+            ItemExchangeCfg currencyRatioCfg = GetCurrencyRatioCfgById(itemId);
             if (currencyRatioCfg != null)
             {
                 return (int)Math.Floor((decimal)costCount / currencyRatioCfg.costNum * currencyRatioCfg.num);

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

@@ -22,9 +22,9 @@ namespace GFGGame
         private GoWrapper _wrapper;
         private DressUpObjDataCache _dressUpObjDataCache;
         private ValueBarController _valueBarController;
-        private List<ClothingShopCfg> _dataList;
+        private List<ShopCfg> _dataList;
         private GLoader _imgSelected;
-        private ClothingShopCfg _cfgSelected;
+        private ShopCfg _cfgSelected;
         private const int MAX_COUNT = 99;
         private const int INIT_COUNT = 1;
         private int _scoreType;
@@ -120,7 +120,7 @@ namespace GFGGame
                 {
                     _selectedItemId = (int)objs[2];//从物品来源面板跳转到商店,需要物品id方便打开界面时做选中处理
                     _selectedItemCount = (int)objs[3];
-                    ClothingShopCfg[] dataArray = ClothingShopCfgArray.Instance.dataArray;
+                    ShopCfg[] dataArray = ShopCfgClothingArray.Instance.dataArray;
                     for (int i = 0; i < dataArray.Length; i++)
                     {
                         if (dataArray[i].itemID == _selectedItemId)
@@ -269,7 +269,7 @@ namespace GFGGame
 
             if (_ui.m_listShop.numItems > 0)
             {
-                ClothingShopCfg clothingShopCfg = ClothingShopCfgArray.Instance.GetCfg(_selectedItemClothingId);
+                ShopCfg clothingShopCfg = ShopCfgClothingArray.Instance.GetCfg(_selectedItemClothingId);
                 int itemIndex = 0;
                 if (_selectedItemId > 0 && clothingShopCfg != null)
                 {
@@ -297,7 +297,7 @@ namespace GFGGame
         private void ListShopItemRender(int index, GObject item)
         {
             UI_ShopListItemRender listItem = UI_ShopListItemRender.Proxy(item);
-            ClothingShopCfg cfg = _dataList[index];
+            ShopCfg cfg = _dataList[index];
             listItem.target.data = cfg;
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemID);
             listItem.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
@@ -314,7 +314,7 @@ namespace GFGGame
         {
             _selectedListItem = listItem;
             listItem.AddChild(_imgSelected);
-            ClothingShopCfg cfg = listItem.data as ClothingShopCfg;
+            ShopCfg cfg = listItem.data as ShopCfg;
             _cfgSelected = cfg;
             UpdateRole(tween);
             UpdateSelectedItemInfo();

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs

@@ -46,14 +46,14 @@ namespace GFGGame
 
             });
 
-            _valueBar.m_btnCJ.onClick.Add(() =>
+            _valueBar.m_btnCJ.onClick.Add((EventCallback0)(() =>
             {
                 int luckyBoxId = LuckyBoxBonusDataCache.currentBoxId;
                 LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(luckyBoxId);
-                CurrencyRatioCfg currencyRatioCfg = ItemUtil.GetCurrencyRatioCfgById(luckyBoxCfg.costID);
-                ItemUtil.ExchangeItemById(luckyBoxCfg.costID, currencyRatioCfg != null ? currencyRatioCfg.num : 20, true);
+                ItemExchangeCfg currencyRatioCfg = ItemUtil.GetCurrencyRatioCfgById(luckyBoxCfg.costID);
+                ItemUtil.ExchangeItemById(luckyBoxCfg.costID, (int)(currencyRatioCfg != null ? currencyRatioCfg.num : 20), true);
 
-            });
+            }));
         }
 
         public void Dispose()

+ 5 - 5
GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyConfirmView.cs

@@ -83,18 +83,18 @@ namespace GFGGame
                 {
 
                     // PromptController.Instance.ShowFloatTextPrompt(costCfg.name + "不足!");
-                    Alert.Show(costCfg.name + "不足,是否前往购买?").SetLeftButton(true).SetRightButton(true, "确认", (object data) =>
+                    Alert.Show(costCfg.name + "不足,是否前往购买?").SetLeftButton(true).SetRightButton(true, "确认", (AlertWindow.AlertCallback)((object data) =>
                                        {
                                            int costNeedCount = _costCount - ItemDataManager.GetItemNum(_costId);
-                                           CurrencyRatioCfg currencyRatioCfg = ItemUtil.GetCurrencyRatioCfgById(_costId);
-                                           BuyItemConteoller.Show(_costId, currencyRatioCfg.costId, currencyRatioCfg.num, currencyRatioCfg.costNum, costNeedCount, null, true, true, GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
-                                       });
+                                           ItemExchangeCfg currencyRatioCfg = ItemUtil.GetCurrencyRatioCfgById(_costId);
+                                           BuyItemConteoller.Show(_costId, (int)currencyRatioCfg.costId, (int)currencyRatioCfg.num, (int)currencyRatioCfg.costNum, costNeedCount, null, true, true, GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
+                                       }));
                     OnClickBtnCancel();
                 }
 
                 return;
             }
-            CurrencyRatioCfg currencyRatioCfg = ItemUtil.GetCurrencyRatioCfgById(_itemId);
+            ItemExchangeCfg currencyRatioCfg = ItemUtil.GetCurrencyRatioCfgById(_itemId);
 
             // int count = (int)Math.Ceiling((decimal)_costCount / currencyRatioCfg.costNum * currencyRatioCfg.num);
             int count = ItemUtil.GetItemExChangeCount(_itemId, _costCount);

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

@@ -54,7 +54,7 @@ namespace GFGGame
         }
         private void OnClickBtnSure()
         {
-            CurrencyRatioCfg currencyRatioCfg = ItemUtil.GetCurrencyRatioCfgById(_itemId);
+            ItemExchangeCfg currencyRatioCfg = ItemUtil.GetCurrencyRatioCfgById(_itemId);
 
             int count = ItemUtil.GetItemExChangeCount(_itemId, _costCount);
             ItemUtil.AddItemUseCost(_itemId, count, _costId, _costCount);

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