| | |
| | | needCostItemCnt = treasureSetConfig.CostItemCountList[index]; |
| | | hasItemCnt = PackManager.Instance.GetItemCountByID(PackType.Item, treasureSetConfig.CostItemID); |
| | | |
| | | // 物品不足 && 没超货币招募次数上限 && 货币足够 |
| | | // 物品不足 && 没超货币招募次数上限 |
| | | if (hasItemCnt < needCostItemCnt && |
| | | nowMoneyCnt + treasureCnt <= dailyMaxCountMoney && |
| | | moneyCount >= needCostMoneyCnt) |
| | | nowMoneyCnt + treasureCnt <= dailyMaxCountMoney) |
| | | { |
| | | DisplayByMoney(treasureSetConfig.CostMoneyType, needCostMoneyCnt); |
| | | DisplayByMoney(treasureSetConfig.CostMoneyType, needCostMoneyCnt, moneyCount); |
| | | return; |
| | | } |
| | | DisplayByItem(treasureSetConfig.CostItemID, treasureCnt); |
| | | } |
| | | |
| | | void DisplayByMoney(int moneyType, long moneyCnt) |
| | | void DisplayByMoney(int moneyType, long needCostMoneyCnt, long moneyCount) |
| | | { |
| | | needText.text = Language.Get("L1100", RichTextMsgReplaceConfig.GetRichReplace("MONEY", moneyType), UIHelper.AppendColor(moneyCount < moneyCnt ? TextColType.Red : TextColType.LightGreen, moneyCnt.ToString())); |
| | | |
| | | bool isEnough = moneyCount >= needCostMoneyCnt; |
| | | needText.text = Language.Get("L1100", RichTextMsgReplaceConfig.GetRichReplace("MONEY", moneyType), UIHelper.AppendColor(!isEnough ? TextColType.Red : TextColType.LightGreen, needCostMoneyCnt.ToString())); |
| | | needImage.SetIconWithMoneyType(moneyType); |
| | | |
| | | clickButton.SetListener(() => |
| | | { |
| | | if (!isEnough) |
| | | { |
| | | ItemTipUtility.ShowMoneyTip(moneyType, true); |
| | | return; |
| | | } |
| | | HeroUIManager.Instance.selectCallType = (HappXBTitle)type; |
| | | HeroUIManager.Instance.selectCallIndex = index; |
| | | HappyXBModel.Instance.SendXBQuest(type, index, 0); |