| | |
| | | int needToolCnt = 0;
|
| | | if (IsHaveManyXBTool(xbType, out toolCnt, out needToolCnt))
|
| | | {
|
| | | needToolCnt = needToolCnt - toolCnt;
|
| | | int needMoney = needToolCnt * funcSet.xbPrices[0];
|
| | | if (needMoney > 0)
|
| | | if(toolCnt >= needToolCnt)
|
| | | {
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(funcSet.costToolIds[1]);
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HappyXBCostTools", funcSet.costToolNums[1], itemConfig.ItemName, needMoney, needToolCnt), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | CheckXBManyLimit(needMoney, xbType);
|
| | | }
|
| | | return;
|
| | | });
|
| | | CheckXBManyLimit(0, xbType, 2);
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckXBManyLimit(0, xbType);
|
| | | CheckXBManyLimit(funcSet.xbPrices[1], xbType,0);
|
| | | }
|
| | | //needToolCnt = needToolCnt - toolCnt;
|
| | | //int needMoney = needToolCnt * funcSet.xbPrices[0];
|
| | | //if (needMoney > 0)
|
| | | //{
|
| | | // ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(funcSet.costToolIds[1]);
|
| | | // ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HappyXBCostTools", funcSet.costToolNums[1], itemConfig.ItemName, needMoney, needToolCnt), (bool isOk) =>
|
| | | // {
|
| | | // if (isOk)
|
| | | // {
|
| | | // CheckXBManyLimit(needMoney, xbType,0);
|
| | | // }
|
| | | // return;
|
| | | // });
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // CheckXBManyLimit(0, xbType,2);
|
| | | //}
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckXBManyLimit(funcSet.xbPrices[1],xbType);
|
| | | CheckXBManyLimit(funcSet.xbPrices[1],xbType,0);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | public void CheckXBManyLimit(int needMoney,int xbtype)
|
| | | public void CheckXBManyLimit(int needMoney,int xbtype,int costType)
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(1) >= (ulong)needMoney)
|
| | | {
|
| | | SendXBQuest(xbtype, 1, 2);
|
| | | SendXBQuest(xbtype, 1, costType);
|
| | | }
|
| | | else
|
| | | {
|