| | |
| | |
|
| | | public class StoreModel : GameSystemManager<StoreModel>
|
| | | {
|
| | | public Dictionary<int, List<StoreData>> storeTypeDict { get; private set; } //所有显示商品
|
| | | public Dictionary<int, List<StoreData>> storeTypeDict { get; private set; } //所有显示商品 商店类型:商品列表
|
| | | public Dictionary<int, int> shopRefreshCntDict = new Dictionary<int, int>(); //刷新次数
|
| | | private Dictionary<int, int> shopItemlimitDict = new Dictionary<int, int>(); //已购买次数
|
| | | public event Action RefreshBuyShopLimitEvent;
|
| | |
| | | public int heroSoulRefreshMoney;
|
| | | public int heroSoulRefreshFreeCount;
|
| | |
|
| | | Dictionary<int, List<int>> freeShopDict = new Dictionary<int, List<int>>();
|
| | | public Dictionary<int, List<int>> freeShopDict = new Dictionary<int, List<int>>(); //免费商品 商店类型:商品列表
|
| | | public Dictionary<int, int> shopMoneyTypeDict = new Dictionary<int, int>();
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | RedpointCenter.Instance.AddParent(MainRedDot.MainGuildRedpoint, MainRedDot.Store_REDPOINT);
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += FuncStateChange;
|
| | | TimeMgr.Instance.OnDayEvent += RefreshDay;
|
| | | GuildManager.Instance.EnterOrQuitGuildEvent += EnterOrQuitGuildEvent;
|
| | |
| | | for (int i = 0; i < netPack.ShopIDList.Length; i++)
|
| | | {
|
| | | var config = StoreConfig.Get((int)netPack.ShopIDList[i]);
|
| | | if (config == null)
|
| | | {
|
| | | Debug.LogError("前后端商店数据不一致");
|
| | | continue;
|
| | | }
|
| | | //UnlockType 2 由服务端通知
|
| | | StoreData storeData = new StoreData();
|
| | | storeData.shopId = config.ID;
|
| | |
| | |
|
| | | if (storeConfig.ItemID != 0)
|
| | | {
|
| | | ShopItemInfo shopItem = new ShopItemInfo(storeConfig.ID, storeConfig.ItemCnt);
|
| | | ShopItemInfo shopItem = new ShopItemInfo(storeConfig.ItemID, storeConfig.ItemCnt);
|
| | | shopItemlist.Add(shopItem);
|
| | | }
|
| | | var extraItem = storeConfig.ItemListEx;
|
| | |
| | | List<int[]> shopItemlist = new List<int[]>();
|
| | | if (storeConfig.ItemID != 0)
|
| | | {
|
| | | shopItemlist.Add(new int[] { storeConfig.ID, storeConfig.ItemCnt});
|
| | | shopItemlist.Add(new int[] { storeConfig.ItemID, storeConfig.ItemCnt});
|
| | | }
|
| | | var extraItem = storeConfig.ItemListEx;
|
| | | for (int i = 0; i < extraItem.Length; i++)
|
| | |
| | |
|
| | | }
|
| | |
|
| | | //仙玉购买物品的二次确认框,一级货币只有仙玉 默认为仙玉即可
|
| | | //货币购买的二次确认框的确认记录
|
| | | Dictionary<int, bool> buyItemCheckDict = new Dictionary<int, bool>(); //记录勾选信息
|
| | | |
| | | //购买商店物品的二次确认框
|
| | | //eventType 二次确认框类型,对应枚举 BuyStoreItemCheckType
|
| | | public void SendBuyShopItemWithPopCheck(StoreConfig model, int count, int eventType = 0)
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("CostMoney", model.MoneyNum, model.MoneyType),
|
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("BuyStoreItem", model.MoneyNum, model.MoneyType, model.Name),
|
| | | Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) =>
|
| | | {
|
| | | if (isOk)
|
| | |
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return;
|
| | |
|
| | | if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Guild) && PlayerDatas.Instance.fairyData.HasFairy)
|
| | | {
|
| | | RedpointCenter.Instance.AddParent(MainRedDot.MainGuildRedpoint, MainRedDot.Store_REDPOINT);
|
| | | }
|
| | | normalRedpoint.state = RedPointState.None;
|
| | | guildRedpoint.state = RedPointState.None;
|
| | |
|
| | |
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public bool CheckPopBuyWin(int shopID)
|
| | | {
|
| | | int state = GetShopIDState(shopID);
|
| | | if (state == 1 || state == 3)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip(StringUtility.Concat("StoreTip", state.ToString()));
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | public enum StoreFunc
|
| | |
| | | Normal = 1, //1:坊市
|
| | | Guild = 2, //2:公会
|
| | | Hero = 3, //3:将魂
|
| | | |
| | | OSHeroCall = 4, //4:开服招募礼包
|
| | | OSGalaChange = 5, //5:开服庆典兑换
|
| | | OSGalaGift = 6, //6:开服庆典礼包
|
| | |
|
| | | }
|
| | |
|
| | |
|