瀏覽代碼

物品兑换

zhaoyang 3 年之前
父節點
當前提交
18a2db9708

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit 43d490981b31602f519872ecff5b1453dd0ee2b5
+Subproject commit 6d5b81d457f66747f9bc40378e2267c4336454a0

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

@@ -32,7 +32,7 @@ namespace GFGGame
 
         public static void AddPower(string prefix = "", Action onSuccess = null)
         {
-            int maxLimit = ItemExchangeCfgArray.Instance.GetCfgs(ConstItemID.POWER)[0].maxLimit;
+            int maxLimit = ItemExchangeCfgArray.Instance.GetCfg(ConstItemID.POWER).maxLimit;
             int lastBuyCount = maxLimit - ItemDataManager.GetItemExchangeTimes(ConstItemID.POWER);
             string showTxt = string.Format("每5分钟回复1点体力\n今日剩余购买{0}/{1}次", lastBuyCount, maxLimit);
             BuyConfirmController.Show(ConstItemID.POWER, 1, () =>
@@ -65,8 +65,8 @@ namespace GFGGame
         public static void AddDiamondRed(int value = 0, Action onSuccess = null)
         {
 
-            ItemExchangeCfg currencyRatioCfg = ItemExchangeCfgArray.Instance.GetCfgs(ConstItemID.DIAMOND_RED)[0];// GetCurrencyRatioCfgById(ConstItemID.DIAMOND_RED);
-            BuyItemConteoller.Show(currencyRatioCfg.id, value > 0 ? value : currencyRatioCfg.num, ConstBuyType.TYPE_ITEM, 0, onSuccess, true, true, GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
+            ItemExchangeCfg currencyRatioCfg = ItemExchangeCfgArray.Instance.GetCfg(ConstItemID.DIAMOND_RED);// GetCurrencyRatioCfgById(ConstItemID.DIAMOND_RED);
+            BuyItemConteoller.Show(currencyRatioCfg.id, value > 0 ? value : 1, ConstBuyType.TYPE_ITEM, 0, onSuccess, true, true);
             BuyItemConteoller.showTxtBuyTips = true;
         }
 

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

@@ -58,7 +58,7 @@ namespace GFGGame
             _ui.m_txtNeed.text = string.Format("是否花费{0}{1} 购买{2}{3}", coustNum, costCfg.name, buyNum, itemCfg.name);
 
             _ui.m_txtNum.text = "";
-            _maxTimes = ItemExchangeCfgArray.Instance.GetCfgs(_itemId)[0].maxLimit;
+            _maxTimes = ItemExchangeCfgArray.Instance.GetCfg(_itemId).maxLimit;
             if (_maxTimes != 0)
             {
                 _ui.m_txtNum.text = string.Format("今日剩余购买次数{0}/{1}", _buyTimes, _maxTimes);

+ 4 - 9
GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyCountView.cs

@@ -111,10 +111,10 @@ namespace GFGGame
             }
             else if (buyType == ConstBuyType.TYPE_ITEM)
             {
-                ItemExchangeCfg itemExchangeCfg = ItemExchangeCfgArray.Instance.GetCfgs(buyId)[0];
-                int maxBuyCount = (int)Math.Floor((decimal)(ItemDataManager.GetItemNum(itemExchangeCfg.costId) / itemExchangeCfg.costNum));
+                ItemExchangeCfg itemExchangeCfg = ItemExchangeCfgArray.Instance.GetCfg(buyId);
+                int maxBuyCount = (int)Math.Floor((decimal)(ItemDataManager.GetItemNum(itemExchangeCfg.costId) / itemExchangeCfg.costNumArr[0]));
 
-                _maxCanBuy = Math.Min(Math.Min(maxCount, maxBuyCount), itemExchangeCfg.maxLimit - ItemDataManager.GetItemExchangeTimes(buyId));
+                _maxCanBuy = Math.Min(Math.Min(maxCount, maxBuyCount), itemExchangeCfg.maxLimit == 0 ? maxCount : itemExchangeCfg.maxLimit - ItemDataManager.GetItemExchangeTimes(buyId));
                 _itemId = buyId;
 
             }
@@ -125,7 +125,6 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            _ui.m_txtCount.text = "" + _minBuyCount;
             UpdateView();
         }
         private void UpdateView()
@@ -150,7 +149,7 @@ namespace GFGGame
         private void UpdateCost()
         {
             GetMoneyIdAndNum(_count, out _costId, out _costNum, out _buyNum);
-            _ui.m_txtCount.text = _count.ToString();
+            _ui.m_txtCount.text = _buyNum.ToString();
             _ui.m_txtPrice.text = _costNum.ToString();
             SetBtnState();
         }
@@ -318,10 +317,6 @@ namespace GFGGame
                 ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, ItemDataManager.GetItemExchangeTimes(_itemId), count, out _costId, out _costNum, out _buyNum);
 
             }
-            // else
-            // {
-
-            // }
         }
 
 

二進制
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes