| | |
| | | |
| | | public Dictionary<int, FamilyStoreItem> _DicfamilyStoreItem = new Dictionary<int, FamilyStoreItem>();//家族仓库物品信息 |
| | | |
| | | public List<FamilyActionInfoClass> _InformationList = new List<FamilyActionInfoClass>(); |
| | | public List<FamilyActionInfoClass> _InformationList = new List<FamilyActionInfoClass>(); |
| | | public delegate void OnFairyAuIntegral(); |
| | | public static event OnFairyAuIntegral Event_FairyAuIntegral;//用于仙盟积分的刷新 |
| | | public delegate void OnFamilyActionInfo(); |
| | | public static event OnFamilyActionInfo Event_FamilyActionInfo;//家族行为信息的刷新 |
| | | public delegate void OnFamilyStoreItemInfo(); |
| | | public static event OnFamilyStoreItemInfo Event_FamilyStoreItemInfo;//仓库信息的刷新 |
| | | public static event Action<List<int>> Del_FamilyStoreItemInfo;//仓库信息物品的删除 |
| | | public static event Action<List<int>> Del_FamilyStoreItemInfo;//仓库信息物品的删除
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | | PackModelInterface _modelInterface;
|
| | | PackModelInterface modelInterface { get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); } }
|
| | | public int _FairyAuIntegral = 0;//获取仙盟积分 |
| | | |
| | | public int JumpItemID = 0;// |
| | | public int JumpItemID = 0;//从跳转到仙盟仓库需要选中高亮 |
| | | List<int> EquipmentList = new List<int>();//关于装备位置 |
| | | public bool IsShowPoint = false;//是否显示红点
|
| | | private const int Redpoint_key1 = 1070103;
|
| | | public Redpoint redPointStre1 = new Redpoint(10701, Redpoint_key1);//仙盟仓库红点 |
| | | |
| | | public override void Init() |
| | | { |
| | | |
| | | var funConfig = Config.Instance.Get<FuncConfigConfig>("StrengthenDisplay"); |
| | | int[] List = ConfigParse.GetMultipleStr<int>(funConfig.Numerical1); |
| | | EquipmentList.Clear(); |
| | | for (int i = 0; i < List.Length; i++)
|
| | | {
|
| | | EquipmentList.Add(List[i]);
|
| | | } |
| | | } |
| | | |
| | | public override void UnInit() |
| | | { |
| | | |
| | | {
|
| | |
|
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | |
| | | }
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting;//数据的刷新(h0418)
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;
|
| | | WarehouseTipsWin.RedPointUpdate -= RedPointUpdate;
|
| | | WarehouseTipsWin.RedPointUpdate += RedPointUpdate;
|
| | | }
|
| | |
|
| | | } |
| | | |
| | |
|
| | | public void FairyAuIntegral(int value)//获取仙盟积分 |
| | | { |
| | | _FairyAuIntegral = value; |
| | |
| | | FuncConfigConfig _PetFoodExchange = Config.Instance.Get<FuncConfigConfig>("PetFoodExchange"); |
| | | _FamilyStoreItemP.ItemID = int.Parse(_PetFoodExchange.Numerical1); |
| | | _DicfamilyStoreItem.Add(0, _FamilyStoreItemP); |
| | | } |
| | | |
| | | }
|
| | |
|
| | | for (int i = 0; i < info.Count; i++) |
| | | { |
| | | if (_DicfamilyStoreItem.ContainsKey(info.StoreItemList[i].Index + 1)) |
| | | continue; |
| | | FamilyStoreItem _FamilyStoreItem = new FamilyStoreItem(); |
| | | _FamilyStoreItem.ItemData = JsonUtility.FromJson<FamilyStoreItem.ItemJsonData>(info.StoreItemList[i].ItemData); |
| | | _FamilyStoreItem.Index = info.StoreItemList[i].Index+1; |
| | | _FamilyStoreItem.Index = info.StoreItemList[i].Index + 1; |
| | | _FamilyStoreItem.ItemID = (int)info.StoreItemList[i].ItemID; |
| | | _FamilyStoreItem._UserData = ConfigParse.Analysis(_FamilyStoreItem.ItemData.UserData); |
| | | _DicfamilyStoreItem.Add((int)info.StoreItemList[i].Index+1, _FamilyStoreItem); |
| | | } |
| | | |
| | | if (Event_FamilyStoreItemInfo != null) |
| | | Event_FamilyStoreItemInfo(); |
| | | |
| | | |
| | | |
| | | |
| | | _DicfamilyStoreItem.Add((int)info.StoreItemList[i].Index + 1, _FamilyStoreItem); |
| | | }
|
| | |
|
| | | if (Event_FamilyStoreItemInfo != null)
|
| | | {
|
| | | Event_FamilyStoreItemInfo();
|
| | | } |
| | | IsShowRedPoint(); |
| | | }
|
| | | List<int> List = new List<int>(); |
| | | public void WarehouseToRefresh(byte [] _list)//仓库刷新 |
| | | public void WarehouseToRefresh(byte[] _list)//仓库刷新 |
| | | {
|
| | | List.Clear(); |
| | | for (int i = 0; i < _list.Length; i++)
|
| | | {
|
| | | List.Add(_list[i]+1);
|
| | | List.Add(_list[i] + 1);
|
| | | } |
| | | if (Del_FamilyStoreItemInfo != null)
|
| | | {
|
| | | Del_FamilyStoreItemInfo(List);
|
| | | } |
| | |
|
| | | IsShowRedPoint();
|
| | |
|
| | |
|
| | | } |
| | | public void FamilyStoreDel(int _index ,int ClearType)//家族仓库物品删除(清除的格子索引, 仅单格子清除时有效,从0开始代表第一格,0-单格子清除; 1-所有物品清除) |
| | | public void FamilyStoreDel(int _index, int ClearType)//家族仓库物品删除(清除的格子索引, 仅单格子清除时有效,从0开始代表第一格,0-单格子清除; 1-所有物品清除) |
| | | { |
| | | if (_DicfamilyStoreItem.ContainsKey(_index + 1) && ClearType==0) |
| | | if (_DicfamilyStoreItem.ContainsKey(_index + 1) && ClearType == 0) |
| | | { |
| | | _DicfamilyStoreItem.Remove(_index + 1); |
| | | } |
| | |
| | | _FamilyStoreItemP.ItemID = int.Parse(_PetFoodExchange.Numerical1); |
| | | _DicfamilyStoreItem.Add(0, _FamilyStoreItemP); |
| | | } |
| | | } |
| | | }
|
| | | } |
| | | |
| | | public void FamilyActionInfo(HA403_tagGCFamilyActionInfo info)//接收家族行为信息 |
| | |
| | | FamilyActionInfoClass _FamilyActionInfoClass = new FamilyActionInfoClass(); |
| | | _FamilyActionInfoClass.FamilyID = (int)info.FamilyID; |
| | | _FamilyActionInfoClass.ActionType = (int)info.ActionType; |
| | | _FamilyActionInfoClass.Time =(int)info.FamilyActionList[i].Time; |
| | | _FamilyActionInfoClass.Time = (int)info.FamilyActionList[i].Time; |
| | | _FamilyActionInfoClass.Name = info.FamilyActionList[i].Name; |
| | | _FamilyActionInfoClass.OperationType = (int)info.FamilyActionList[i].Value1; |
| | | _FamilyActionInfoClass.PlayerID = (int)info.FamilyActionList[i].Value2; |
| | | _FamilyActionInfoClass.ItemID = (int)info.FamilyActionList[i].Value3; |
| | | _FamilyActionInfoClass.ItemData = JsonUtility.FromJson<FamilyActionInfoClass.ItemJsonData>(info.FamilyActionList[i].UseData); |
| | | _FamilyActionInfoClass._UserData = ConfigParse.Analysis(_FamilyActionInfoClass.ItemData.UserData); |
| | | _InformationList.Add(_FamilyActionInfoClass); |
| | | |
| | | _InformationList.Add(_FamilyActionInfoClass);
|
| | |
|
| | | } |
| | | if (Event_FamilyActionInfo != null) |
| | | Event_FamilyActionInfo();//家族行为信息的刷新 |
| | | |
| | | }
|
| | |
|
| | | |
| | | private bool IsEquipmentComparison()
|
| | | {
|
| | | bool IsBool = false;
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptEquip);
|
| | | for (int i = 0; i < EquipmentList.Count; i++)
|
| | | {
|
| | | ItemModel ItemModel = singlePack.GetItemModelByIndex(i);
|
| | | int Type = i;
|
| | | if (ItemModel != null)
|
| | | {
|
| | | foreach (var key in _DicfamilyStoreItem.Keys)
|
| | | {
|
| | | if (key == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | int ItemId = _DicfamilyStoreItem[key].ItemID;
|
| | | var itemConfig = Config.Instance.Get<ItemConfig>(ItemId);
|
| | | int RealmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | int equipScore = modelInterface.SetEquipScore(PackType.rptEquip, ItemId, _DicfamilyStoreItem[key]._UserData);
|
| | | if (ItemModel.chinItemModel.EquipPlace == Type && RealmLevel >= itemConfig.RealmLimit && equipScore >= ItemModel.equipScore)
|
| | | {
|
| | | IsBool = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | foreach (var key in _DicfamilyStoreItem.Keys)
|
| | | {
|
| | | if (key == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | int ItemId = _DicfamilyStoreItem[key].ItemID;
|
| | | var itemConfig = Config.Instance.Get<ItemConfig>(ItemId);
|
| | | int RealmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | if (itemConfig.EquipPlace == Type && RealmLevel >= itemConfig.RealmLimit)
|
| | | {
|
| | | IsBool = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return IsBool;
|
| | | }
|
| | | private void IsShowRedPoint()
|
| | | {
|
| | | int GetDayOfYear = DateTime.Now.DayOfYear;
|
| | | string strKey= "Treasure"+ PlayerDatas.Instance.baseData.LV;
|
| | | int day = LocalSave.GetInt(strKey);
|
| | | if (day != GetDayOfYear && IsEquipmentComparison())
|
| | | {
|
| | | LocalSave.SetInt(strKey, GetDayOfYear);
|
| | | IsShowPoint = true;
|
| | | }
|
| | | if (IsShowPoint)
|
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | redPointStre1.state = RedPointState.None;
|
| | | }
|
| | | |
| | | }
|
| | | private void Updatefighting(PlayerDataRefresh obj)//刷新境界
|
| | | {
|
| | | if (obj == PlayerDataRefresh.OfficialRank)
|
| | | {
|
| | | IsShowRedPoint();
|
| | | }
|
| | | }
|
| | | private void RedPointUpdate()
|
| | | {
|
| | | IsShowRedPoint();
|
| | | }
|
| | | } |