|
@@ -111,10 +111,10 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else if (buyType == ConstBuyType.TYPE_ITEM)
|
|
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;
|
|
_itemId = buyId;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -125,7 +125,6 @@ namespace GFGGame
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
- _ui.m_txtCount.text = "" + _minBuyCount;
|
|
|
|
UpdateView();
|
|
UpdateView();
|
|
}
|
|
}
|
|
private void UpdateView()
|
|
private void UpdateView()
|
|
@@ -150,7 +149,7 @@ namespace GFGGame
|
|
private void UpdateCost()
|
|
private void UpdateCost()
|
|
{
|
|
{
|
|
GetMoneyIdAndNum(_count, out _costId, out _costNum, out _buyNum);
|
|
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();
|
|
_ui.m_txtPrice.text = _costNum.ToString();
|
|
SetBtnState();
|
|
SetBtnState();
|
|
}
|
|
}
|
|
@@ -318,10 +317,6 @@ namespace GFGGame
|
|
ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, ItemDataManager.GetItemExchangeTimes(_itemId), count, out _costId, out _costNum, out _buyNum);
|
|
ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, ItemDataManager.GetItemExchangeTimes(_itemId), count, out _costId, out _costNum, out _buyNum);
|
|
|
|
|
|
}
|
|
}
|
|
- // else
|
|
|
|
- // {
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|