| | |
| | | // using System; |
| | | // using System.Collections; |
| | | // using System.Collections.Generic; |
| | | // using UnityEngine; |
| | | // namespace vnxbqy.UI |
| | | // { |
| | | // public static class RichViewItemUtility |
| | | // { |
| | | // static string s_CacheUserData = string.Empty; |
| | | |
| | | // static EquipGemModel equipGemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } } |
| | | |
| | | // public static void DisplayItem(int itemId, ItemTipUtility.CustomItemPlus itemplus) |
| | | // { |
| | | // if (ItemLogicUtility.Instance.IsRealmEquip(itemId) && itemplus.Preview != 1) |
| | | // { |
| | | // var itemConfig = ItemConfig.Get(itemId); |
| | | // Dictionary<int, int> gems = new Dictionary<int, int>(); |
| | | // Dictionary<int, bool> gemHoleActiveStates = new Dictionary<int, bool>(); |
| | | // if (itemplus.Stone != null) |
| | | // { |
| | | // for (int i = 0; i < itemplus.Stone.Length; i++) |
| | | // { |
| | | // gems.Add(i, itemplus.Stone[i]); |
| | | // if (i == 3) |
| | | // { |
| | | // gemHoleActiveStates.Add(i, itemplus.Stone[i] != 0); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // for (int i = 0; i < EquipGemModel.EQUIPGEM_HOLE_COUNT; i++) |
| | | // { |
| | | // if (i < 3) |
| | | // { |
| | | // gemHoleActiveStates.Add(i, equipGemModel.IsGemHoleOpen(i, itemplus.Star)); |
| | | // } |
| | | // } |
| | | |
| | | // var legendProperties = new List<Int2>(); |
| | | // var equipSkillList = new List<int>(); |
| | | // Dictionary<int, List<int>> useDataDict = null; |
| | | // if (!string.IsNullOrEmpty(itemplus.UserData)) |
| | | // { |
| | | // useDataDict = ConfigParse.Analysis(itemplus.UserData); |
| | | // if (useDataDict != null) |
| | | // { |
| | | // if(useDataDict.ContainsKey((int)ItemUseDataKey.legendAttrID) && useDataDict.ContainsKey((int)ItemUseDataKey.legendAttrValue)) |
| | | // { |
| | | // var count = Mathf.Min(useDataDict[(int)ItemUseDataKey.legendAttrID].Count, useDataDict[(int)ItemUseDataKey.legendAttrValue].Count); |
| | | // for (int i = 0; i < count; i++) |
| | | // { |
| | | // legendProperties.Add(new Int2(useDataDict[(int)ItemUseDataKey.legendAttrID][i], useDataDict[(int)ItemUseDataKey.legendAttrValue][i])); |
| | | // } |
| | | // } |
| | | // if (useDataDict.ContainsKey((int)ItemUseDataKey.equipSkills)) |
| | | // { |
| | | // equipSkillList = useDataDict[(int)ItemUseDataKey.equipSkills]; |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | |
| | | // List<Int2> trainProperties = new List<Int2>(); |
| | | // if (!itemplus.Wash.Equals(default(ItemTipUtility.CustomEquipWash))) |
| | | // { |
| | | // var washType = EquipTrainModel.GetTrainType(itemConfig.EquipPlace); |
| | | // var trainConfig = EquipWashConfig.Get(washType, 1); |
| | | // for (int i = 0; i < itemplus.Wash.Value.Length; i++) |
| | | // { |
| | | // var propertyType = i == 0 ? trainConfig.config.attType1 : i == 1 ? |
| | | // trainConfig.config.attType2 : trainConfig.config.attType3; |
| | | // trainProperties.Add(new Int2(propertyType, itemplus.Wash.Value[i])); |
| | | // } |
| | | // } |
| | | |
| | | // Dictionary<EquipSuitType, int> suitLevels = new Dictionary<EquipSuitType, int>(); |
| | | // suitLevels.Add(EquipSuitType.TwoSuit, -1); |
| | | // suitLevels.Add(EquipSuitType.FiveSuit, -1); |
| | | // suitLevels.Add(EquipSuitType.EightSuit, -1); |
| | | |
| | | // List<int> suitplaces = new List<int>(); |
| | | |
| | | // Dictionary<int, int> placeStars = new Dictionary<int, int>(); |
| | | // for (int i = 1; i <= 8; i++) |
| | | // { |
| | | // placeStars.Add(i, -1); |
| | | // } |
| | | |
| | | // if (itemplus.placeStars != null) |
| | | // { |
| | | // for (int i = 0; i < itemplus.placeStars.Length; i++) |
| | | // { |
| | | // placeStars[i + 1] = itemplus.placeStars[i]; |
| | | // } |
| | | // } |
| | | |
| | | // if (itemplus.suitPlaces != null && itemplus.suitLevels != null) |
| | | // { |
| | | // suitplaces.AddRange(itemplus.suitPlaces); |
| | | // suitLevels[EquipSuitType.TwoSuit] = itemplus.suitLevels[0]; |
| | | // suitLevels[EquipSuitType.FiveSuit] = itemplus.suitLevels[1]; |
| | | // suitLevels[EquipSuitType.EightSuit] = itemplus.suitLevels[2]; |
| | | // } |
| | | // else if (itemplus.Equips != null) |
| | | // { |
| | | // var stars = new List<int>(); |
| | | // for (int i = 0; i < itemplus.Equips.Length; i++) |
| | | // { |
| | | // var array = itemplus.Equips[i]; |
| | | // var config = ItemConfig.Get(array[0]); |
| | | // if (config.EquipPlace > 8) |
| | | // { |
| | | // continue; |
| | | // } |
| | | // stars.Add(array[1]); |
| | | |
| | | // placeStars[config.EquipPlace] = array[1]; |
| | | |
| | | // if (config.SuiteiD > 0) |
| | | // { |
| | | // suitplaces.Add(config.EquipPlace); |
| | | // } |
| | | // } |
| | | |
| | | // stars.Sort((int x, int y) => { return -x.CompareTo(y); }); |
| | | |
| | | // var twoSuitLevel = (suitplaces.Count > 1 && stars.Count > 1) ? stars[1] : -1; |
| | | // var fiveSuitLevel = (suitplaces.Count > 4 && stars.Count > 4) ? stars[4] : -1; |
| | | // var eightSuitLevel = (suitplaces.Count > 7 && stars.Count > 7) ? stars[7] : -1; |
| | | |
| | | // suitLevels[EquipSuitType.TwoSuit] = twoSuitLevel; |
| | | // suitLevels[EquipSuitType.FiveSuit] = fiveSuitLevel; |
| | | // suitLevels[EquipSuitType.EightSuit] = eightSuitLevel; |
| | | // } |
| | | |
| | | // ItemTipUtility.ShowCustomEquip(new ItemTipUtility.CustomEquipInfo() |
| | | // { |
| | | // itemId = itemId, |
| | | // job = itemConfig.JobLimit, |
| | | // strengthenLevel = itemplus.PlusLV, |
| | | // starLevel = itemplus.Star, |
| | | // gems = gems, |
| | | // legendProperties = legendProperties, |
| | | // score = ItemLogicUtility.Instance.GetEquipScore(itemId, useDataDict, true), |
| | | // gemHoleActiveStates = gemHoleActiveStates, |
| | | // suitLevels = suitLevels, |
| | | // suitPlaces = suitplaces, |
| | | // trainProperties = trainProperties, |
| | | // isEquiped = itemplus.Equipped == 1, |
| | | // placeStars = placeStars, |
| | | // equipSkillList = equipSkillList, |
| | | // }); |
| | | // } |
| | | // else |
| | | // { |
| | | // ItemTipUtility.Show(itemId); |
| | | // } |
| | | // } |
| | | |
| | | // public static void SendViewNotifyItem(string guid, string userdata) |
| | | // { |
| | | // s_CacheUserData = userdata; |
| | | // var pak = new CA905_tagCGQueryNotifyEquipDetailInfo(); |
| | | // pak.ItemGUID = guid; |
| | | // GameNetSystem.Instance.SendInfo(pak); |
| | | // } |
| | | |
| | | // public static void ReceivePackage(HA905_tagGCNotifyEquipDetailInfo package) |
| | | // { |
| | | // List<int[]> equips = null; |
| | | // if (package.ClassEquipCount > 0) |
| | | // { |
| | | // equips = new List<int[]>(); |
| | | // foreach (var equip in package.ClassEquipList) |
| | | // { |
| | | // equips.Add(new int[2] |
| | | // { |
| | | // (int)equip.ItemID, |
| | | // equip.Star, |
| | | // }); |
| | | // } |
| | | // } |
| | | |
| | | // ItemTipUtility.CustomItemPlus itemplus = new ItemTipUtility.CustomItemPlus() |
| | | // { |
| | | // ItemID = (int)package.ItemID, |
| | | // count = 1, |
| | | // Star = package.Star, |
| | | // PlusLV = package.PlusLV, |
| | | // EvolveLV = package.EvolveLV, |
| | | // Wash = new ItemTipUtility.CustomEquipWash() |
| | | // { |
| | | // LV = package.WashLV, |
| | | // Value = new int[3] |
| | | // { |
| | | // 0<package.WashValueList.Length?(int)package.WashValueList[0]:0, |
| | | // 1<package.WashValueList.Length?(int)package.WashValueList[1]:0, |
| | | // 2<package.WashValueList.Length?(int)package.WashValueList[2]:0, |
| | | // }, |
| | | // }, |
| | | // Equipped = 1, |
| | | // Stone = new int[4] |
| | | // { |
| | | // 0<package.StoneIDList.Length?(int)package.StoneIDList[0]:0, |
| | | // 1<package.StoneIDList.Length?(int)package.StoneIDList[1]:0, |
| | | // 2<package.StoneIDList.Length?(int)package.StoneIDList[2]:0, |
| | | // 3<package.StoneIDList.Length?(int)package.StoneIDList[3]:0, |
| | | // }, |
| | | // UserData = s_CacheUserData, |
| | | // Equips = equips == null ? null : equips.ToArray(), |
| | | // }; |
| | | |
| | | // DisplayItem((int)itemplus.ItemID, itemplus); |
| | | // } |
| | | // } |
| | | // } |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | //public static class RichViewItemUtility
|
| | | //{
|
| | | // static string s_CacheUserData = string.Empty;
|
| | |
|
| | | // static EquipGemModel equipGemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
|
| | |
|
| | | // public static void DisplayItem(int itemId, ItemTipUtility.CustomItemPlus itemplus)
|
| | | // {
|
| | | // if (ItemLogicUtility.Instance.IsRealmEquip(itemId) && itemplus.Preview != 1)
|
| | | // {
|
| | | // var itemConfig = ItemConfig.Get(itemId);
|
| | | // Dictionary<int, int> gems = new Dictionary<int, int>();
|
| | | // Dictionary<int, bool> gemHoleActiveStates = new Dictionary<int, bool>();
|
| | | // if (itemplus.Stone != null)
|
| | | // {
|
| | | // for (int i = 0; i < itemplus.Stone.Length; i++)
|
| | | // {
|
| | | // gems.Add(i, itemplus.Stone[i]);
|
| | | // if (i == 3)
|
| | | // {
|
| | | // gemHoleActiveStates.Add(i, itemplus.Stone[i] != 0);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | // for (int i = 0; i < EquipGemModel.EQUIPGEM_HOLE_COUNT; i++)
|
| | | // {
|
| | | // if (i < 3)
|
| | | // {
|
| | | // gemHoleActiveStates.Add(i, equipGemModel.IsGemHoleOpen(i, itemplus.Star));
|
| | | // }
|
| | | // }
|
| | |
|
| | | // var legendProperties = new List<Int2>();
|
| | | // var equipSkillList = new List<int>();
|
| | | // Dictionary<int, List<int>> useDataDict = null;
|
| | | // if (!string.IsNullOrEmpty(itemplus.UserData))
|
| | | // {
|
| | | // useDataDict = ConfigParse.Analysis(itemplus.UserData);
|
| | | // if (useDataDict != null)
|
| | | // {
|
| | | // if (useDataDict.ContainsKey((int)ItemUseDataKey.legendAttrID) && useDataDict.ContainsKey((int)ItemUseDataKey.legendAttrValue))
|
| | | // {
|
| | | // var count = Mathf.Min(useDataDict[(int)ItemUseDataKey.legendAttrID].Count, useDataDict[(int)ItemUseDataKey.legendAttrValue].Count);
|
| | | // for (int i = 0; i < count; i++)
|
| | | // {
|
| | | // legendProperties.Add(new Int2(useDataDict[(int)ItemUseDataKey.legendAttrID][i], useDataDict[(int)ItemUseDataKey.legendAttrValue][i]));
|
| | | // }
|
| | | // }
|
| | | // if (useDataDict.ContainsKey((int)ItemUseDataKey.equipSkills))
|
| | | // {
|
| | | // equipSkillList = useDataDict[(int)ItemUseDataKey.equipSkills];
|
| | | // }
|
| | |
|
| | | // }
|
| | | // }
|
| | |
|
| | | // List<Int2> trainProperties = new List<Int2>();
|
| | | // if (!itemplus.Wash.Equals(default(ItemTipUtility.CustomEquipWash)))
|
| | | // {
|
| | | // var washType = EquipTrainModel.GetTrainType(itemConfig.EquipPlace);
|
| | | // var trainConfig = EquipWashConfig.Get(washType, 1);
|
| | | // for (int i = 0; i < itemplus.Wash.Value.Length; i++)
|
| | | // {
|
| | | // var propertyType = i == 0 ? trainConfig.config.attType1 : i == 1 ?
|
| | | // trainConfig.config.attType2 : trainConfig.config.attType3;
|
| | | // trainProperties.Add(new Int2(propertyType, itemplus.Wash.Value[i]));
|
| | | // }
|
| | | // }
|
| | |
|
| | | // Dictionary<EquipSuitType, int> suitLevels = new Dictionary<EquipSuitType, int>();
|
| | | // suitLevels.Add(EquipSuitType.TwoSuit, -1);
|
| | | // suitLevels.Add(EquipSuitType.FiveSuit, -1);
|
| | | // suitLevels.Add(EquipSuitType.EightSuit, -1);
|
| | |
|
| | | // List<int> suitplaces = new List<int>();
|
| | |
|
| | | // Dictionary<int, int> placeStars = new Dictionary<int, int>();
|
| | | // for (int i = 1; i <= 8; i++)
|
| | | // {
|
| | | // placeStars.Add(i, -1);
|
| | | // }
|
| | |
|
| | | // if (itemplus.placeStars != null)
|
| | | // {
|
| | | // for (int i = 0; i < itemplus.placeStars.Length; i++)
|
| | | // {
|
| | | // placeStars[i + 1] = itemplus.placeStars[i];
|
| | | // }
|
| | | // }
|
| | |
|
| | | // if (itemplus.suitPlaces != null && itemplus.suitLevels != null)
|
| | | // {
|
| | | // suitplaces.AddRange(itemplus.suitPlaces);
|
| | | // suitLevels[EquipSuitType.TwoSuit] = itemplus.suitLevels[0];
|
| | | // suitLevels[EquipSuitType.FiveSuit] = itemplus.suitLevels[1];
|
| | | // suitLevels[EquipSuitType.EightSuit] = itemplus.suitLevels[2];
|
| | | // }
|
| | | // else if (itemplus.Equips != null)
|
| | | // {
|
| | | // var stars = new List<int>();
|
| | | // for (int i = 0; i < itemplus.Equips.Length; i++)
|
| | | // {
|
| | | // var array = itemplus.Equips[i];
|
| | | // var config = ItemConfig.Get(array[0]);
|
| | | // if (config.EquipPlace > 8)
|
| | | // {
|
| | | // continue;
|
| | | // }
|
| | | // stars.Add(array[1]);
|
| | |
|
| | | // placeStars[config.EquipPlace] = array[1];
|
| | |
|
| | | // if (config.SuiteiD > 0)
|
| | | // {
|
| | | // suitplaces.Add(config.EquipPlace);
|
| | | // }
|
| | | // }
|
| | |
|
| | | // stars.Sort((int x, int y) => { return -x.CompareTo(y); });
|
| | |
|
| | | // var twoSuitLevel = (suitplaces.Count > 1 && stars.Count > 1) ? stars[1] : -1;
|
| | | // var fiveSuitLevel = (suitplaces.Count > 4 && stars.Count > 4) ? stars[4] : -1;
|
| | | // var eightSuitLevel = (suitplaces.Count > 7 && stars.Count > 7) ? stars[7] : -1;
|
| | |
|
| | | // suitLevels[EquipSuitType.TwoSuit] = twoSuitLevel;
|
| | | // suitLevels[EquipSuitType.FiveSuit] = fiveSuitLevel;
|
| | | // suitLevels[EquipSuitType.EightSuit] = eightSuitLevel;
|
| | | // }
|
| | |
|
| | | // ItemTipUtility.ShowCustomEquip(new ItemTipUtility.CustomEquipInfo()
|
| | | // {
|
| | | // itemId = itemId,
|
| | | // job = itemConfig.JobLimit,
|
| | | // strengthenLevel = itemplus.PlusLV,
|
| | | // starLevel = itemplus.Star,
|
| | | // gems = gems,
|
| | | // legendProperties = legendProperties,
|
| | | // score = ItemLogicUtility.Instance.GetEquipScore(itemId, useDataDict, true),
|
| | | // gemHoleActiveStates = gemHoleActiveStates,
|
| | | // suitLevels = suitLevels,
|
| | | // suitPlaces = suitplaces,
|
| | | // trainProperties = trainProperties,
|
| | | // isEquiped = itemplus.Equipped == 1,
|
| | | // placeStars = placeStars,
|
| | | // equipSkillList = equipSkillList,
|
| | | // });
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // ItemTipUtility.Show(itemId);
|
| | | // }
|
| | | // }
|
| | |
|
| | | // public static void SendViewNotifyItem(string guid, string userdata)
|
| | | // {
|
| | | // s_CacheUserData = userdata;
|
| | | // var pak = new CA905_tagCGQueryNotifyEquipDetailInfo();
|
| | | // pak.ItemGUID = guid;
|
| | | // GameNetSystem.Instance.SendInfo(pak);
|
| | | // }
|
| | |
|
| | | // public static void ReceivePackage(HA905_tagGCNotifyEquipDetailInfo package)
|
| | | // {
|
| | | // List<int[]> equips = null;
|
| | | // if (package.ClassEquipCount > 0)
|
| | | // {
|
| | | // equips = new List<int[]>();
|
| | | // foreach (var equip in package.ClassEquipList)
|
| | | // {
|
| | | // equips.Add(new int[2]
|
| | | // { |
| | | // (int)equip.ItemID, |
| | | // equip.Star,
|
| | | // });
|
| | | // }
|
| | | // }
|
| | |
|
| | | // ItemTipUtility.CustomItemPlus itemplus = new ItemTipUtility.CustomItemPlus()
|
| | | // {
|
| | | // ItemID = (int)package.ItemID,
|
| | | // count = 1,
|
| | | // Star = package.Star,
|
| | | // PlusLV = package.PlusLV,
|
| | | // EvolveLV = package.EvolveLV,
|
| | | // Wash = new ItemTipUtility.CustomEquipWash()
|
| | | // {
|
| | | // LV = package.WashLV,
|
| | | // Value = new int[3]
|
| | | // { |
| | | // 0<package.WashValueList.Length?(int)package.WashValueList[0]:0, |
| | | // 1<package.WashValueList.Length?(int)package.WashValueList[1]:0, |
| | | // 2<package.WashValueList.Length?(int)package.WashValueList[2]:0,
|
| | | // },
|
| | | // },
|
| | | // Equipped = 1,
|
| | | // Stone = new int[4]
|
| | | // { |
| | | // 0<package.StoneIDList.Length?(int)package.StoneIDList[0]:0, |
| | | // 1<package.StoneIDList.Length?(int)package.StoneIDList[1]:0, |
| | | // 2<package.StoneIDList.Length?(int)package.StoneIDList[2]:0, |
| | | // 3<package.StoneIDList.Length?(int)package.StoneIDList[3]:0,
|
| | | // },
|
| | | // UserData = s_CacheUserData,
|
| | | // Equips = equips == null ? null : equips.ToArray(),
|
| | | // };
|
| | |
|
| | | // DisplayItem((int)itemplus.ItemID, itemplus);
|
| | | // }
|
| | | //}
|
| | | |