From c79dbe6647429b864d15a21b3baa77ffa8d48768 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期一, 15 四月 2019 15:29:35 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
System/Store/StoreModel.cs | 156 ----------------------------------------------------
1 files changed, 0 insertions(+), 156 deletions(-)
diff --git a/System/Store/StoreModel.cs b/System/Store/StoreModel.cs
index 14b6692..9417179 100644
--- a/System/Store/StoreModel.cs
+++ b/System/Store/StoreModel.cs
@@ -83,7 +83,6 @@
TimeMgr.Instance.OnHourEvent -= RefreshServerHour;
GlobalTimeEvent.Instance.secondEvent -= UpdateSecond;
NewBieCenter.Instance.guideBeginEvent -= GuidBegin;
- packModel.refreshItemCountEvent -= UpdateFairyEquip;
shopItemlimitDict.Clear();
petAndMountPushlist.Clear();
ClearPushData();
@@ -112,7 +111,6 @@
WindowCenter.Instance.windowAfterOpenEvent += windowAfterOpen;
WindowCenter.Instance.windowAfterCloseEvent += windowAfterClose;
NewBieCenter.Instance.guideBeginEvent += GuidBegin;
- packModel.refreshItemCountEvent += UpdateFairyEquip;
UpdateShowStore();
SetIsMustBuyDay();
ControllerRedPoint();
@@ -730,7 +728,6 @@
case PlayerDataType.FBHelpPoint:
UpdateFreeShopRedpoint();
UpdateCanBuyRedpoint();
- UpdateFairyEquipRedpoint();
break;
}
}
@@ -810,7 +807,6 @@
UpdateCanBuyRedpoint();
UpdateMustBuyRedpoint();
UpdatePetAndMountPutAwayRedpoint();
- UpdateFairyEquipRedpoint();
}
if (RefreshBuyShopLimitEvent != null)
RefreshBuyShopLimitEvent();
@@ -1093,7 +1089,6 @@
UpdateCanBuyRedpoint();
UpdateMustBuyRedpoint();
UpdatePetAndMountPutAwayRedpoint();
- UpdateFairyEquipRedpoint();
break;
case FuncOpenEnum.BlastFurnace:
ControllerRedPoint();
@@ -1353,155 +1348,6 @@
}
}
- private void UpdateFairyEquip(PackType type, int index, int id)
- {
- if (type != PackType.Equip
- && (index != (int)RoleEquipType.FairyCan1 || index != (int)RoleEquipType.FairyCan2)) return;
-
- ClearAllFairyEquipRedpoint();
-
- }
-
- public void UpdateFairyEquipRedpoint()
- {
- 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 storeData = storeDatas[i];
- var storeConfig = storeData.storeConfig;
- int type = 0;
- TryGetRedTypeByShopId(storeConfig.ID, out type);
- if (type == 5)
- {
-
- string fairySaveKey = string.Empty;
- bool isGetSave = TryGetFairySaveKey(storeConfig, out fairySaveKey);
- int remainNum = 0;
- if (!TryGetIsSellOut(storeConfig, out remainNum))
- {
- if (UIHelper.GetMoneyCnt(storeConfig.MoneyType) >= (ulong)storeConfig.MoneyNumber)
- {
- if (isGetSave)
- {
- shopRedDict[storeData.shopId].state = RedPointState.Simple;
- LocalSave.SetBool(fairySaveKey, true);
- }
- else
- {
- shopRedDict[storeData.shopId].state = RedPointState.None;
- }
- }
- else
- {
- if (shopRedDict[storeData.shopId].state != RedPointState.None)
- {
- LocalSave.SetBool(fairySaveKey, false);
- shopRedDict[storeConfig.ID].state = RedPointState.None;
- }
- }
- }
- else
- {
- shopRedDict[storeConfig.ID].state = RedPointState.None;
- }
- }
- }
-
- }
- }
-
- public void ClearFairyEquipRedpoint(StoreConfig storeConfig)
- {
- int type = 0;
- TryGetRedTypeByShopId(storeConfig.ID, out type);
- if (type == 5)
- {
- if (shopRedDict[storeConfig.ID].state != RedPointState.None)
- {
- shopRedDict[storeConfig.ID].state = RedPointState.None;
- string key1 = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "ShopId", storeConfig.ID, "EquipPlace:", 9);
- string key2 = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "ShopId", storeConfig.ID, "EquipPlace:", 10);
- if (LocalSave.GetBool(key1))
- {
- LocalSave.SetBool(key1, false);
- }
- else if (LocalSave.GetBool(key2))
- {
- LocalSave.SetBool(key2, false);
- }
- }
- }
- }
-
- public void SwitchFuncTitleClearRedpoint(StoreFunc storeFunc)
- {
- if (storeFuncType == StoreFunc.IntegralStore && storeFunc != StoreFunc.IntegralStore)
- {
- ClearAllFairyEquipRedpoint();
- }
- }
-
- private void ClearAllFairyEquipRedpoint()
- {
- foreach (var key in shopRedDict.Keys)
- {
- StoreConfig storeConfig = StoreConfig.Get(key);
- ItemConfig itemConfig = ItemConfig.Get(storeConfig.ItemID);
- int type = 0;
- TryGetRedTypeByShopId(storeConfig.ID, out type);
- if (type == 5)
- {
- if (shopRedDict[key].state != RedPointState.None)
- {
- shopRedDict[key].state = RedPointState.None;
- string key1 = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "ShopId", key, "EquipPlace:", 9);
- string key2 = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "ShopId", key, "EquipPlace:", 10);
-
- if (LocalSave.GetBool(key1))
- {
- LocalSave.SetBool(key1, false);
- }
- else if (LocalSave.GetBool(key2))
- {
- LocalSave.SetBool(key2, false);
- }
- }
- }
- }
- }
-
- public bool TryGetFairySaveKey(StoreConfig config, out string fairySaveKey)
- {
- fairySaveKey = string.Empty;
- if (config == null) return false;
-
- ItemConfig itemConfig = ItemConfig.Get(config.ItemID);
- if (itemConfig.EquipPlace == (int)RoleEquipType.FairyCan1)
- {
- string key1 = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "ShopId", config.ID, "EquipPlace:", 9);
- string key2 = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "ShopId", config.ID, "EquipPlace:", 10);
- ItemModel itemModel1 = packModel.GetItemByIndex(PackType.Equip, 9);
- ItemModel itemModel2 = packModel.GetItemByIndex(PackType.Equip, 10);
- if (itemModel1 == null
- && (!PlayerPrefs.HasKey(key1) || LocalSave.GetBool(key1)))
- {
- fairySaveKey = key1;
- return true;
- }
- else if (itemModel2 == null
- && (!PlayerPrefs.HasKey(key2) || LocalSave.GetBool(key2)))
- {
- fairySaveKey = key2;
- return true;
- }
- }
- return false;
- }
-
public void UpdateMustBuyRedpoint()
{
if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return;
@@ -1685,13 +1531,11 @@
{
ClearMustBuyRedpoint(storeConfig);
ClearPetAndMountRedpoint(storeConfig);
- ClearFairyEquipRedpoint(storeConfig);
}
public void CloseAllRedpoint(StoreFunc storeFunc)
{
ClearAllPetAndMountRedpoint(storeFunc);
- SwitchFuncTitleClearRedpoint(storeFunc);
}
#endregion
--
Gitblit v1.8.0