| | |
| | | public event Action RefreshShopEvent;
|
| | |
|
| | | public StoreFunc selectStoreFuncType = StoreFunc.Normal;
|
| | |
|
| | | public int jumpShopID;
|
| | |
|
| | | public int buyShopID;
|
| | |
|
| | |
| | |
|
| | | public Dictionary<int, List<int>> freeShopDict = new Dictionary<int, List<int>>(); //免费商品 商店类型:商品列表
|
| | | public Dictionary<int, int> shopMoneyTypeDict = new Dictionary<int, int>();
|
| | |
|
| | |
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | |
|
| | | public void SendBuyShopItem(StoreConfig model, int count)
|
| | | {
|
| | | if (UIHelper.CheckMoneyCount(model.MoneyType, model.MoneyNum * count, 2))
|
| | | if (model.MoneyType <= 0)
|
| | | {
|
| | | CA310_tagCSBuyItem buyShop = new CA310_tagCSBuyItem();
|
| | | buyShop.ShopID = (ushort)model.ID;
|
| | | buyShop.BuyCount = (uint)count;
|
| | | GameNetSystem.Instance.SendInfo(buyShop);
|
| | | if (UIHelper.CheckItemCount(model.CostItemID, model.MoneyNum * count, 2))
|
| | | {
|
| | | SendBuyItem(model.ID, count);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (UIHelper.CheckMoneyCount(model.MoneyType, model.MoneyNum * count, 2))
|
| | | {
|
| | | SendBuyItem(model.ID, count);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendBuyItem(int shopID, int count)
|
| | | {
|
| | | CA310_tagCSBuyItem buyShop = new CA310_tagCSBuyItem();
|
| | | buyShop.ShopID = (ushort)shopID;
|
| | | buyShop.BuyCount = (uint)count;
|
| | | GameNetSystem.Instance.SendInfo(buyShop);
|
| | | }
|
| | |
|
| | | //货币购买的二次确认框的确认记录
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("BuyStoreItem", model.MoneyNum, model.MoneyType, model.Name),
|
| | | Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) =>
|
| | | {
|
| | | if (isOk)
|
| | | ConfirmCancel.ToggleConfirmCancel(
|
| | | Language.Get("Mail101"),
|
| | | model.MoneyType <= 0 ?
|
| | | Language.Get("BuyStoreItem1", model.MoneyNum, ItemConfig.Get(model.CostItemID).ItemName, model.Name) :
|
| | | Language.Get("BuyStoreItem", model.MoneyNum, model.MoneyType, model.Name),
|
| | | Language.Get("ConfirmCancel102"),
|
| | | (isOk, isToggle) =>
|
| | | {
|
| | | SendBuyShopItem(model, count);
|
| | | buyItemCheckDict[eventType] = isToggle;
|
| | | }
|
| | | |
| | | });
|
| | | if (isOk)
|
| | | {
|
| | | SendBuyShopItem(model, count);
|
| | | buyItemCheckDict[eventType] = isToggle;
|
| | | }
|
| | |
|
| | | });
|
| | | }
|
| | |
|
| | | //花仙玉购买的二次确认框(本次登录)
|
| | |
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | // 弹出购买框,不足则提示已售罄
|
| | | public void ShowBuyItem(int shopID, int tipType = 0)
|
| | | {
|
| | | var cfg = StoreConfig.Get(shopID);
|
| | | if (!TryGetIsSellOut(cfg, out var cnt))
|
| | | {
|
| | | buyShopID = shopID;
|
| | | UIManager.Instance.OpenWindow<BuyItemWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | if (tipType == 0)
|
| | | {
|
| | | //售罄
|
| | | SysNotifyMgr.Instance.ShowTip("StoreTip1");
|
| | | }
|
| | | else if (tipType == 1)
|
| | | {
|
| | | //物品不足提示
|
| | | SysNotifyMgr.Instance.ShowTip("ItemNotEnough", ItemConfig.Get(cfg.ItemID).ItemName);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public enum StoreFunc
|
| | |
| | | OSHeroCall = 4, //4:开服招募礼包
|
| | | OSGalaChange = 5, //5:开服庆典兑换
|
| | | OSGalaGift = 6, //6:开服庆典礼包
|
| | |
|
| | | SpecialStore = 7, //7:特惠商城
|
| | | DailySpecialsFree = 8, //8: 每日特惠-每日特惠免费
|
| | | DailyGiftFree = 9, //9: 每日特惠-每日礼包免费
|
| | | WeeklyGiftFree = 10, //10: 每日特惠-每周礼包免费
|
| | | HeroSkin = 16, //16: 时装商店
|
| | | OSBeautyMM = 17, //17: 红颜冲榜礼包
|
| | | OSHeroTrain = 18, //18: 武将冲榜礼包
|
| | | OSMingge = 19, //19: 命格冲榜礼包
|
| | | Qunying = 20, //20: 群英积分商店
|
| | | }
|
| | |
|
| | |
|