| System/Dungeon/DungeonModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/FBHelpPointExchageModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/New/FBHelpPointExchageNotify.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/New/FBHelpPointExchageNotify.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/MainInterfacePanel/InGamePushContainer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Store/StoreModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/WindowBase/ModelCenter.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
System/Dungeon/DungeonModel.cs
@@ -350,6 +350,9 @@ } } break; case 31160: _error = 0; return true; } DungeonRecord record; System/KnapSack/FBHelpPointExchageModel.cs
@@ -30,8 +30,7 @@ { currentShopId = 0; helpPointShoplist.Clear(); PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= UpdateFBHelpPoint; storeModel.UpdateHelpPointExchangeEvent -= UpdateHelpPointShop; storeModel.RefreshTCBPlayerDataEvent -= UpdateFBHelpPoint; TimeMgr.Instance.OnDayEvent -= UpdateDay; } @@ -41,9 +40,8 @@ shopDayLocalSave = StringUtility.Contact("ShopDayLocalSave",playerId); shopLifeLocalSave = StringUtility.Contact("ShopLifeLocalSave",playerId); curDayLocalSave = StringUtility.Contact("CurDayLocalSave",playerId); PlayerDatas.Instance.PlayerDataRefreshInfoEvent += UpdateFBHelpPoint; storeModel.RefreshTCBPlayerDataEvent += UpdateFBHelpPoint; TimeMgr.Instance.OnDayEvent += UpdateDay; storeModel.UpdateHelpPointExchangeEvent += UpdateHelpPointShop; GetLocalSaveData(); } @@ -123,7 +121,30 @@ private void UpdateFBHelpPoint(PlayerDataRefresh type) { if (type != PlayerDataRefresh.FBHelpPoint) return; if (type != PlayerDataRefresh.FBHelpPoint || !FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return; var storeDatas = storeModel.TryGetStoreDatas((int)StoreFunc.IntegralStore); if(storeDatas != null) { for(int i = 0; i < storeDatas.Count; i++) { var storeData = storeDatas[i]; int pushType = 0; storeModel.TryGetPushTypeByShopId(storeData.shopId,out pushType); if(pushType != 0) { int remainNum = 0; bool isSellOut = storeModel.TryGetIsSellOut(storeData.storeConfig,out remainNum); ulong haveMoney = UIHelper.GetMoneyCnt(storeData.storeConfig.MoneyType); bool isEnoughMoney = haveMoney >= (ulong)storeData.storeConfig.MoneyNumber ? true : false; if(!isSellOut && isEnoughMoney) { UpdateHelpPointShop(storeData.shopId); } } } } for(int i = 0; i < helpPointShoplist.Count; i++) { @@ -151,6 +172,9 @@ { helpPointShoplist.Remove(shopId); } int type = 0; bool isPush = storeModel.TryGetPushTypeByShopId(shopId, out type); SetLocalSaveData(type, shopId); } private void UpdateHelpPointShop(int shopId) @@ -158,9 +182,23 @@ StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(shopId); if (storeConfig == null) return; currentShopId = shopId; AddHelpPointShop(shopId); if(UpdateHelpPointShopEvent != null) if(!IsAlreadPush(shopId)) { currentShopId = shopId; AddHelpPointShop(shopId); if (UpdateHelpPointShopEvent != null) { UpdateHelpPointShopEvent(); } } } public void GetNextHelpPointShop(int shopId) { RemoveHelpPointShop(shopId); int length = helpPointShoplist.Count; currentShopId = length == 0 ? 0 : helpPointShoplist[length - 1]; if (UpdateHelpPointShopEvent != null) { UpdateHelpPointShopEvent(); } @@ -168,20 +206,26 @@ public bool IsAlreadPush(int shopId) { StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(shopId); if (storeConfig == null) return false; ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(storeConfig.ItemID); switch((ItemType)itemConfig.Type) int type = 0; storeModel.TryGetPushTypeByShopId(shopId, out type); switch (type) { case ItemType.OfflineCard: case 1: if(todayShoplist != null && todayShoplist.Contains(shopId)) { return true; } break; case ItemType.MountDan: break; default: case 2: if (lifeShoplist != null && lifeShoplist.Contains(shopId)) { return true; } break; } return true; return false; } } } System/KnapSack/New/FBHelpPointExchageNotify.cs
New file @@ -0,0 +1,72 @@ using UnityEngine; using UnityEngine.UI; using TableConfig; namespace Snxxz.UI { public class FBHelpPointExchageNotify : MonoBehaviour { [SerializeField] CommonItemBaisc itemBaisc; [SerializeField] Text titleText; [SerializeField] Button closeBtn; [SerializeField] Button gotoBtn; FBHelpPointExchageModel ExchageModel { get { return ModelCenter.Instance.GetModel<FBHelpPointExchageModel>(); } } ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } public void Awake() { gotoBtn.AddListener(ClickGoto); closeBtn.AddListener(GetNextPush); } public void SetDisplay() { int shopId = ExchageModel.currentShopId; this.gameObject.SetActive(shopId != 0); if (shopId == 0) return; StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(shopId); if(storeConfig != null) { ItemCellModel cellModel = new ItemCellModel(storeConfig.ItemID); itemBaisc.Init(cellModel); itemBaisc.cellBtn.RemoveAllListeners(); itemBaisc.cellBtn.AddListener(()=> { ItemAttrData attrData = new ItemAttrData(storeConfig.ItemID); tipsModel.SetItemTipsModel(attrData); }); } } public void ClickGoto() { StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(ExchageModel.currentShopId); switch ((StoreFunc)storeConfig.ShopType) { case StoreFunc.WeekStore: WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc1); break; case StoreFunc.CommonStore: WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc2); break; case StoreFunc.GrowStrongerStore: WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc3); break; case StoreFunc.BindStore: WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc4); break; case StoreFunc.IntegralStore: WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc5); break; } GetNextPush(); } public void GetNextPush() { ExchageModel.GetNextHelpPointShop(ExchageModel.currentShopId); } } } System/KnapSack/New/FBHelpPointExchageNotify.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 644090f0bbd882143bdd1ed02c53484d timeCreated: 1542177585 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/MainInterfacePanel/InGamePushContainer.cs
@@ -27,6 +27,8 @@ [SerializeField] FairyGrabBossHelpBehaviour m_FairyGrabBossHelpBehaviour; [SerializeField] DogzNotifyBehaviour m_DogzNotifyBehaviour; [SerializeField] InSevenDayBehavior m_InSevenDayBehavior; [SerializeField] FBHelpPointExchageNotify m_HelpPointExchangeNotify; WorldBossModel worldBossModel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } } BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } } ElderGodAreaModel elderGodAreaModel { get { return ModelCenter.Instance.GetModel<ElderGodAreaModel>(); } } @@ -34,7 +36,7 @@ DogzDungeonModel dogzDungeonModel { get { return ModelCenter.Instance.GetModel<DogzDungeonModel>(); } } VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } } DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } FBHelpPointExchageModel exchageModel { get { return ModelCenter.Instance.GetModel<FBHelpPointExchageModel>(); } } FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } } BetterEquipGetModel betterEquipGetModel { get { return ModelCenter.Instance.GetModel<BetterEquipGetModel>(); } } RealmBetterEquipModel realmEquipModel { get { return ModelCenter.Instance.GetModel<RealmBetterEquipModel>(); } } @@ -65,6 +67,8 @@ CheckFairyGrabBossHelp(); CheckDogzNotify(); InSevenDayShow(); CheckHelpPointExchange(); exchageModel.UpdateHelpPointShopEvent += CheckHelpPointExchange; playerPack.RefreshDecomAttrAct += CheckEquipDecompose; betterEquipGetModel.showEquipRefreshEvent += CheckBetterEquip; realmEquipModel.showEquipRefreshEvent += CheckRealmBetterEquip; @@ -82,6 +86,7 @@ public void UnInit() { fairyGrabBossModel.helpCoolDown = false; exchageModel.UpdateHelpPointShopEvent -= CheckHelpPointExchange; playerPack.RefreshDecomAttrAct -= CheckEquipDecompose; betterEquipGetModel.showEquipRefreshEvent -= CheckBetterEquip; preciousItemGetModel.showItemRefreshEvent -= CheckPreciousItem; @@ -95,6 +100,16 @@ dogzModel.UpdateDogzPutRedEvent -= CheckDogzNotify; } private void CheckHelpPointExchange() { int pushId = exchageModel.currentShopId; m_HelpPointExchangeNotify.gameObject.SetActive(pushId != 0); if(pushId != 0) { m_HelpPointExchangeNotify.SetDisplay(); } } private void CheckRealmBetterEquip() { if (string.IsNullOrEmpty(realmEquipModel.currentEquipGuid)) System/Store/StoreModel.cs
@@ -38,7 +38,6 @@ public Dictionary<int,Dictionary<int,int>> JobReplaceIdDict = new Dictionary<int, Dictionary<int, int>>(); public Dictionary<int, string> resetTimeDict { get; private set; } public Dictionary<int, int> showCoinsUIDict { get; private set; } public int[] StoreRedIdlist { get; private set;} public int storeTrailerLv { get; private set; } bool isLogin = true; @@ -66,7 +65,6 @@ FuncConfigConfig mallCurrency = Config.Instance.Get<FuncConfigConfig>("MallCurrency"); showCoinsUIDict = ConfigParse.GetDic<int, int>(mallCurrency.Numerical1); FuncConfigConfig mallPush = Config.Instance.Get<FuncConfigConfig>("MallPush"); StoreRedIdlist = ConfigParse.GetMultipleStr<int>(mallPush.Numerical2); storeTrailerLv = int.Parse(mallPush.Numerical1); MainInterfaceWin.IsCopyOfThePanel += OnMoveTopPart; } @@ -1172,18 +1170,19 @@ } } public void UpdateFreeShopRedpoint() { if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return; foreach (var key in showStoreTypeDict.Keys) { var storeDatas = showStoreTypeDict[key]; for(int i = 0; i < storeDatas.Count; i++) { var storeConfig = storeDatas[i].storeConfig; if (storeConfig.MoneyNumber == 0) int type = 0; TryGetRedTypeByShopId(storeConfig.ID,out type); if(type == 1) { int remainNum = 0; if (!TryGetIsSellOut(storeConfig, out remainNum)) @@ -1199,7 +1198,7 @@ } } public event Action<int> UpdateHelpPointExchangeEvent; public void UpdateCanBuyRedpoint() { if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return; @@ -1210,7 +1209,9 @@ for (int i = 0; i < storeDatas.Count; i++) { var storeConfig = storeDatas[i].storeConfig; if (StoreRedIdlist.Contains(storeConfig.ID)) int type = 0; TryGetRedTypeByShopId(storeConfig.ID, out type); if(type == 4) { int remainNum = 0; if (!TryGetIsSellOut(storeConfig, out remainNum)) @@ -1218,13 +1219,6 @@ if (UIHelper.GetMoneyCnt(storeConfig.MoneyType) >= (ulong)storeConfig.MoneyNumber) { shopRedDict[storeConfig.ID].state = RedPointState.Simple; if (storeConfig.ShopType == (int)StoreFunc.IntegralStore) { if (UpdateHelpPointExchangeEvent != null) { UpdateHelpPointExchangeEvent(storeConfig.ID); } } } else { @@ -1251,7 +1245,9 @@ for (int i = 0; i < storeDatas.Count; i++) { var storeConfig = storeDatas[i].storeConfig; if (mustIdlist.Contains(storeConfig.ItemID)) int type = 0; TryGetRedTypeByShopId(storeConfig.ID, out type); if(type == 2) { if (CheckIsMustBuy(storeConfig)) { @@ -1269,7 +1265,9 @@ public void ClearMustBuyRedpoint(StoreConfig storeConfig) { if(mustIdlist.Contains(storeConfig.ItemID)) int type = 0; TryGetRedTypeByShopId(storeConfig.ID,out type); if(type == 2) { shopRedDict[storeConfig.ID].state = RedPointState.None; IsMustBuyDay = false; @@ -1306,7 +1304,6 @@ } } public List<int> mustIdlist = new List<int>() { 4741}; public bool CheckIsMustBuy(StoreConfig config) { int remainNum = 0; @@ -1331,39 +1328,44 @@ { var storeData = storelist[i]; ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(storeData.storeConfig.ItemID); string key = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID,"ShopId",storeData.shopId); int remainNum = 0; switch(itemConfig.Type) int type = 0; TryGetRedTypeByShopId(storeData.shopId, out type); if(type == 3) { case 26: case 41: if(!TryGetIsSellOut(storeData.storeConfig,out remainNum)) { if (!PlayerPrefs.HasKey(key)) string key = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "ShopId", storeData.shopId); int remainNum = 0; switch (itemConfig.Type) { case 26: case 41: if (!TryGetIsSellOut(storeData.storeConfig, out remainNum)) { shopRedDict[storeData.shopId].state = RedPointState.Simple; LocalSave.SetBool(key,true); SetPetAndMountPushData(storeData.shopId); } else { if(LocalSave.GetBool(key)) if (!PlayerPrefs.HasKey(key)) { shopRedDict[storeData.shopId].state = RedPointState.Simple; LocalSave.SetBool(key, true); SetPetAndMountPushData(storeData.shopId); } else { shopRedDict[storeData.shopId].state = RedPointState.None; if (LocalSave.GetBool(key)) { shopRedDict[storeData.shopId].state = RedPointState.Simple; } else { shopRedDict[storeData.shopId].state = RedPointState.None; } } } } else { //PlayerPrefs.DeleteKey(key); shopRedDict[storeData.shopId].state = RedPointState.None; } break; else { //PlayerPrefs.DeleteKey(key); shopRedDict[storeData.shopId].state = RedPointState.None; } break; } } } System/WindowBase/ModelCenter.cs
@@ -206,6 +206,7 @@ RegisterModel<SocialModel>(); RegisterModel<ChatBubbleModel>(); RegisterModel<AccumulateRechargeModel>(); RegisterModel<FBHelpPointExchageModel>(); inited = true; }