//处理解锁 void OnDealSendData(CarryShopItem item, EMessageCoinType coinType, int price, bool isUnLock) { if (!CarryShopModel.Instance.isJudgeMoneyEnough(coinType, price)) { SoundManager.Instance.PlaySoundEffect("Sound_Button_Auction_Fail"); if (coinType == EMessageCoinType.ECuType) { UI.MessageBox.Instance.ShowNotEnoughMoneyMsg(null); } else { UI.MessageBox.Instance.ShowNotEnoughGoldMoneyMsg(); } } else { if (isUnLock) { SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_UnlockConfirm"); NetServiceManager.Instance.TradeService.SendCarryShopUnLock_CS(PlayerManager.Instance.FindHeroDataModel().ActorID, item.shopUint.byIndex); } else { int pack = GetGoodsHavePacks((int)item.shopUint.dwShopID); if (pack > 0 && ContainerInfomanager.Instance.PackIsFull()) { UI.MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_H2_2"), 1); // IDS_H2_2 return; } NpcPlayAnim("LadyAction07"); SoundManager.Instance.PlaySoundEffect("Sound_UIEff_ShopLady"); NetServiceManager.Instance.TradeService.SendCarryShopBuy_CS(item.shopUint.dwShopID, item.shopUint.byIndex, item.shopUint.dwShopNum); } } }
//带消耗性货币 public SubMessage(SubMessageLayer subMsgLayer, EMessageCoinType coinType, string MsgMainBody, string MsgMoney, string EnsureBtnStr, string CancelBtnStr, MessageBoxCallBack SureMessageCallBack, MessageBoxCallBack CancelMessageCallBack) //带确定取消返回参数 { this.SubMsgLayer = subMsgLayer; //界面中把标题当消耗货币使用// this.MsgMainBody = MsgMainBody; this.MsgMoneyStr = MsgMoney; this.ShowCoinType = coinType; this.EnsureBtnStr = EnsureBtnStr; this.CancelBtnStr = CancelBtnStr; this.SureMessageCallBack = SureMessageCallBack; this.CancelMessageCallBack = CancelMessageCallBack; messageType = MessageType.WithTwoParamMoney; }
/// <summary> /// show方法,显示提示框(带消耗货币) /// </summary> /// <param name="MsgLayer">优先级,1为最高,10为最低</param> /// <param name="MsgTitle">信息标题</param> /// <param name="Msg">主信息</param> /// <param name="EnsureBtnStr">确定按钮的文字</param> /// <param name="CancelBtnStr">取消按钮的文字</param> /// <param name="SureButtonCallBack">确定按钮的回调</param> /// <param name="CancelButtonCallBack">取消按钮的回调</param> public void Show(int MsgLayer, EMessageCoinType coinType, string MsgText, int money, string EnsureBtnStr, string CancelBtnStr, MessageBoxCallBack SureButtonCallBack, MessageBoxCallBack CancelButtonCallBack) { if (MessageArray[MsgLayer] == null) { MessageArray[MsgLayer] = new SubMessageLayer(MsgLayer); } string strMoney = money.ToString(); if ((coinType == EMessageCoinType.EGoldType && !PlayerManager.Instance.IsBindPayEnough(money)) || (coinType == EMessageCoinType.ECuType && !PlayerManager.Instance.IsMoneyEnough(money))) { strMoney = "[ff0000]" + money + "[-]"; } MessageArray[MsgLayer].AddSubMessage(new SubMessage(MessageArray[MsgLayer], coinType, MsgText, strMoney, EnsureBtnStr, CancelBtnStr, SureButtonCallBack, CancelButtonCallBack)); ShowLayerMsgBox(); }
public void OnSelectGoods(CarryShopItem item) { CarryShopModel.Instance.curSelectIndex = item.curIndex + CarryShopModel.Instance.curShowIndexView * 6; SetCurSelectMark(item); EMessageCoinType coinType = EMessageCoinType.EGoldType; int price = 0; if (item.shopData != null) { if (item.shopData.BuyType == 1) { coinType = EMessageCoinType.ECuType; } else if (item.shopData.BuyType == 3) { coinType = EMessageCoinType.EGoldType; } } if (item.isItemLock) { //弹出解锁// SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_UnlockWindow"); price = CarryShopModel.Instance.GetUnLockPrice(item.shopUint.byIndex); UI.MessageBox.Instance.Show(3, coinType, LanguageTextManager.GetString("IDS_I29_3"), price, LanguageTextManager.GetString("IDS_H2_55"), LanguageTextManager.GetString("IDS_H2_28"), () => { OnDealSendData(item, coinType, price, true); }, () => { //取消 SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_Cancel"); }); } else if (item.isItemOver) { //不动// SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_Unavailable"); } else { //弹出购买// price = item.shopData.Price; SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_BuyWindow"); UI.MessageBox.Instance.Show(3, coinType, string.Format(LanguageTextManager.GetString("IDS_I29_1"), LanguageTextManager.GetString(item.shopData.GoodsNameIds)), price, LanguageTextManager.GetString("IDS_H2_55"), LanguageTextManager.GetString("IDS_H2_28"), () => { OnDealSendData(item, coinType, price, false); }, () => { //取消 SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_Cancel"); }); } }
void DealChangeData(EMessageCoinType coinType, int price) { if (!CarryShopModel.Instance.isJudgeMoneyEnough(coinType, price)) { SoundManager.Instance.PlaySoundEffect("Sound_Button_Auction_Fail"); if (coinType == EMessageCoinType.ECuType) { UI.MessageBox.Instance.ShowNotEnoughMoneyMsg(null); } else { UI.MessageBox.Instance.ShowNotEnoughGoldMoneyMsg(); } } else { SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_ShiftConfirm"); NetServiceManager.Instance.TradeService.SendCarryShopUI_CS(1); } }
public void ShowCostMoneyMessageBox(bool CanBuy, EMessageCoinType CostMoneyType, int CostMoneyNumber, string Msg, string SureBtnStr, string CancelBtnStr, MessageBoxCallBack SureBtnCallBack, MessageBoxCallBack CancelBtnCallBack) { MessageBox.Instance.Show(3, CostMoneyType, Msg, CostMoneyNumber, SureBtnStr, CancelBtnStr, SureBtnCallBack, BuyCancelCallBack); }