| | |
| | | /// </summary>
|
| | | /// <param name="type"></param>
|
| | | /// <param name="index"></param>
|
| | | public event Action<int> StartXBEvent;
|
| | | public void SendXBQuest(int type,int index,int costType)
|
| | | {
|
| | | isXBCoolTime = true;
|
| | |
| | | treasure.TreasureIndex = (byte)index;
|
| | | treasure.CostType = (byte)costType;
|
| | | GameNetSystem.Instance.SendInfo(treasure);
|
| | | if(StartXBEvent != null)
|
| | | {
|
| | | StartXBEvent(index);
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendPutOutXBItem(PackType curType,PackType targetType,int index,int isAll)
|
| | |
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public void SendOneXBQuest(PackType type,int xbType)
|
| | | {
|
| | | var funcSet = GetXBFuncSet(xbType);
|
| | | if (CheckIsEmptyGrid(type))
|
| | | {
|
| | | if (IsHaveOneXBTool(xbType))
|
| | | {
|
| | | SendXBQuest(xbType, 0, 2);
|
| | | }
|
| | | else
|
| | | {
|
| | | int xbOneMoney = funcSet.xbPrices[0];
|
| | | if (UIHelper.GetMoneyCnt(1) >= (ulong)xbOneMoney)
|
| | | {
|
| | | SendXBQuest(xbType, 0, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendXBManyQuest(PackType type, int xbType)
|
| | | {
|
| | | var funcSet = GetXBFuncSet(xbType);
|
| | | if (CheckIsEmptyGrid(type))
|
| | | {
|
| | | int toolCnt = 0;
|
| | | int needToolCnt = 0;
|
| | | if (IsHaveManyXBTool(xbType, out toolCnt, out needToolCnt))
|
| | | {
|
| | | 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);
|
| | | }
|
| | | return;
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckXBManyLimit(0, xbType);
|
| | | }
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckXBManyLimit(funcSet.xbPrices[1],xbType);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | public void CheckXBManyLimit(int needMoney,int xbtype)
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(1) >= (ulong)needMoney)
|
| | | {
|
| | | SendXBQuest(xbtype, 1, 2);
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public bool IsHaveFreeXB(int type)
|