| | |
| | |
|
| | | public int[] jumpAndUseTypes { get; private set; }
|
| | |
|
| | | public int[] ItemRenewalIds { get; private set; }
|
| | | public int[] tryPutOnEquipIds { get; private set; }
|
| | |
|
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | StoreModel m_storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | |
|
| | | var bagUseItem = FuncConfigConfig.Get("BagUseItem");
|
| | | jumpAndUseTypes = ConfigParse.GetMultipleStr<int>(bagUseItem.Numerical1);
|
| | |
|
| | | var renewalFunc = FuncConfigConfig.Get("ItemRepayButton");
|
| | | ItemRenewalIds = ConfigParse.GetMultipleStr<int>(renewalFunc.Numerical1);
|
| | | tryPutOnEquipIds = ConfigParse.GetMultipleStr<int>(renewalFunc.Numerical2);
|
| | |
|
| | | var gemtype1 = FuncConfigConfig.Get("GemType1");
|
| | | gemType1s = ConfigParse.GetMultipleStr<int>(gemtype1.Numerical1);
|
| | |
| | |
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 刷新脱机外挂时间
|
| | | /// </summary>
|
| | | /// <param name="refresh"></param>
|
| | | private void RefreshOfflinePluginTime(PlayerDataType refresh)
|
| | | {
|
| | | if (refresh != PlayerDataType.HappyPoint) return;
|
| | |
| | | HangUpSetModel.Instance.SetOfflinePluginTime(m_storeModel.GetTCBPlayerData(refresh));
|
| | | }
|
| | |
|
| | | public ItemAttrData curAttrData { get; private set; }
|
| | |
|
| | | public GatherSoulData gatherSoulData;
|
| | |
|
| | | /// <summary>
|
| | | /// 预览物品信息
|
| | | /// </summary>
|
| | | /// <param name="itemAttrData"></param>
|
| | | public void SetItemTipsModel(ItemAttrData itemAttrData)
|
| | | Dictionary<int, int> GetItemEffectDict(int itemId)
|
| | | {
|
| | | curAttrData = itemAttrData;
|
| | | if (itemAttrData == null) return;
|
| | |
|
| | | ShowTip();
|
| | | }
|
| | |
|
| | | public void ShowTip()
|
| | | {
|
| | | if (curAttrData == null) return;
|
| | | WindowCenter.Instance.Open<GatherSoulTipWin>();
|
| | | }
|
| | |
|
| | | #region 设置弹框按钮
|
| | |
|
| | | public void SetDogzEquipBtn(ItemAttrData attrData)
|
| | | {
|
| | | if (attrData == null) return;
|
| | |
|
| | | attrData.SetTipsFuncBtn(ItemOperateType.putOff, (ItemWinBtnType, ItemAttrData) =>
|
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config == null)
|
| | | {
|
| | | dogzModel.CheckPutOff(dogzModel.GetDogzEquipPlaceByIndex(attrData.index));
|
| | | });
|
| | |
|
| | | if (dogzModel.TryGetAssistDogzState(dogzModel.presentSelectDogz))
|
| | | {
|
| | | attrData.SetTipsFuncBtn(ItemOperateType.strength, (ItemWinBtnType, ItemAttrData) =>
|
| | | {
|
| | | dogzModel.OpenDogzFuncEvent(1, attrData.index);
|
| | | });
|
| | | return null;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设置装备弹框按钮
|
| | | /// </summary>
|
| | | /// <param name="attrData"></param>
|
| | | public void SetPutOnTipsBtn(ItemAttrData attrData)
|
| | | {
|
| | | if (attrData == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | RoleEquipType equipType = (RoleEquipType)attrData.itemConfig.EquipPlace;
|
| | | if (equipType == RoleEquipType.Wing)
|
| | | {
|
| | | attrData.SetTipsFuncBtn(ItemOperateType.refine, (ItemWinBtnType, ItemAttrData) =>
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StrengthFunc3);
|
| | | });
|
| | | }
|
| | | else if (equipType != RoleEquipType.Guard1)
|
| | | {
|
| | | attrData.SetTipsFuncBtn(ItemOperateType.strength, (ItemWinBtnType, ItemAttrData) =>
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StrengthFunc1);
|
| | | });
|
| | | }
|
| | |
|
| | | attrData.SetTipsFuncBtn(ItemOperateType.putOff, (ItemWinBtnType, ItemAttrData) =>
|
| | | {
|
| | | ItemOperateUtility.Instance.PutOffEquip(attrData.guid);
|
| | | });
|
| | |
|
| | | for (int i = 0; i < tryPutOnEquipIds.Length; i++)
|
| | | {
|
| | | if (tryPutOnEquipIds[i] == attrData.itemId)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.coinPointTotal <= 0)
|
| | | {
|
| | | attrData.SetTipsFuncBtn(ItemOperateType.renewal, (ItemWinBtnType, ItemAttrData) => { WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.FirstRecharge); });
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | Dictionary<int, int> GetItemEffectDict(ItemConfig config)
|
| | | {
|
| | | Dictionary<int, int> itemEffectDict = new Dictionary<int, int>();
|
| | | if (config == null) return itemEffectDict;
|
| | |
|
| | | var itemEffectDict = new Dictionary<int, int>();
|
| | | try
|
| | | {
|
| | | if (config.Effect1 != 0)
|
| | |
| | | return itemEffectDict;
|
| | | }
|
| | |
|
| | | #region 设置弹框位置
|
| | | Dictionary<int, List<int>> GetItemEffectsDict(int itemId)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | #endregion
|
| | | var dict = new Dictionary<int, List<int>>();
|
| | | if (config.Effect1 != 0)
|
| | | {
|
| | | List<int> valuelist = new List<int>();
|
| | | valuelist.Add(config.EffectValueA1);
|
| | | valuelist.Add(config.EffectValueB1);
|
| | | valuelist.Add(config.EffectValueC1);
|
| | | dict.Add(config.Effect1, valuelist);
|
| | | }
|
| | |
|
| | | if (config.Effect2 != 0)
|
| | | {
|
| | | List<int> valuelist = new List<int>();
|
| | | valuelist.Add(config.EffectValueA2);
|
| | | valuelist.Add(config.EffectValueB2);
|
| | | valuelist.Add(config.EffectValueC2);
|
| | | dict.Add(config.Effect2, valuelist);
|
| | | }
|
| | |
|
| | | if (config.Effect3 != 0)
|
| | | {
|
| | | List<int> valuelist = new List<int>();
|
| | | valuelist.Add(config.EffectValueA3);
|
| | | valuelist.Add(config.EffectValueB3);
|
| | | valuelist.Add(config.EffectValueC3);
|
| | | dict.Add(config.Effect3, valuelist);
|
| | | }
|
| | |
|
| | | if (config.Effect4 != 0)
|
| | | {
|
| | | List<int> valuelist = new List<int>();
|
| | | valuelist.Add(config.EffectValueA4);
|
| | | valuelist.Add(config.EffectValueB4);
|
| | | valuelist.Add(config.EffectValueC4);
|
| | | dict.Add(config.Effect4, valuelist);
|
| | | }
|
| | |
|
| | | if (config.Effect5 != 0)
|
| | | {
|
| | | List<int> valuelist = new List<int>();
|
| | | valuelist.Add(config.EffectValueA5);
|
| | | valuelist.Add(config.EffectValueB5);
|
| | | valuelist.Add(config.EffectValueC5);
|
| | | dict.Add(config.Effect5, valuelist);
|
| | | }
|
| | |
|
| | | return dict;
|
| | | }
|
| | |
|
| | | #region 解锁背包格子数据
|
| | | public int OpenCount {
|
| | | get; private set;
|
| | | }
|
| | |
|
| | | public PackType packType { get; private set; }
|
| | |
|
| | | public int Index {
|
| | | get; private set;
|
| | | }
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 计算增加经验
|
| | | public ulong GetAddExpValue(int timeValue, int maxExpLv)
|
| | | {
|
| | | PlayerLVConfig playerLVConfig = PlayerLVConfig.Get(PlayerDatas.Instance.baseData.LV);
|
| | |
| | | Equation.Instance.AddKeyValue("TimeValue", timeValue);
|
| | | return Equation.Instance.Eval<ulong>(expValueFormula);
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public string GetQualityName(int quality)
|
| | | {
|
| | |
| | |
|
| | | #region 物品增加战斗力
|
| | | MountModel mountDatas { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
|
| | |
|
| | | public bool TryGetFightPowerByItemId(int itemId, out int fightPower)
|
| | | public int GetFightPower(int itemId)
|
| | | {
|
| | | fightPower = 0;
|
| | | ItemConfig itemConfig = ItemConfig.Get(itemId);
|
| | | if (itemConfig == null) return false;
|
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config == null) return 0;
|
| | |
|
| | | var fightPower = 0;
|
| | | var attrIdlist = PlayerPropertyConfig.GetKeys();
|
| | | var fruitlist = AttrFruitConfig.GetKeys();
|
| | |
|
| | | Dictionary<int, int> attrDict = new Dictionary<int, int>();
|
| | | Dictionary<int, int> itemEffectDict = GetItemEffectDict(itemConfig);
|
| | | Dictionary<int, int> itemEffectDict = GetItemEffectDict(itemId);
|
| | | int atk = 0;
|
| | | int hp = 0;
|
| | | int def = 0;
|
| | |
| | | var fruitConfig = AttrFruitConfig.Get(itemId);
|
| | | fightPower += fruitConfig.FightPowerEx;
|
| | | }
|
| | | return fightPower > 0;
|
| | | return fightPower;
|
| | | }
|
| | |
|
| | | private Dictionary<int, int> GetRealmAttrDict()
|
| | |
| | | {
|
| | | fashionType = 0;
|
| | | fashionId = 0;
|
| | | Dictionary<int, List<int>> effectDict = null;
|
| | | GetItemEffectDict(itemId, out effectDict);
|
| | | var effectDict = GetItemEffectsDict(itemId);
|
| | | foreach (var key in effectDict.Keys)
|
| | | {
|
| | | var valueList = effectDict[key];
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | private void GetItemEffectDict(int itemId, out Dictionary<int, List<int>> dict)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | dict = new Dictionary<int, List<int>>();
|
| | | if (config == null) return;
|
| | |
|
| | | if (config.Effect1 != 0)
|
| | | {
|
| | | List<int> valuelist = new List<int>();
|
| | | valuelist.Add(config.EffectValueA1);
|
| | | valuelist.Add(config.EffectValueB1);
|
| | | valuelist.Add(config.EffectValueC1);
|
| | | dict.Add(config.Effect1, valuelist);
|
| | | }
|
| | |
|
| | | if (config.Effect2 != 0)
|
| | | {
|
| | | List<int> valuelist = new List<int>();
|
| | | valuelist.Add(config.EffectValueA2);
|
| | | valuelist.Add(config.EffectValueB2);
|
| | | valuelist.Add(config.EffectValueC2);
|
| | | dict.Add(config.Effect2, valuelist);
|
| | | }
|
| | |
|
| | | if (config.Effect3 != 0)
|
| | | {
|
| | | List<int> valuelist = new List<int>();
|
| | | valuelist.Add(config.EffectValueA3);
|
| | | valuelist.Add(config.EffectValueB3);
|
| | | valuelist.Add(config.EffectValueC3);
|
| | | dict.Add(config.Effect3, valuelist);
|
| | | }
|
| | |
|
| | | if (config.Effect4 != 0)
|
| | | {
|
| | | List<int> valuelist = new List<int>();
|
| | | valuelist.Add(config.EffectValueA4);
|
| | | valuelist.Add(config.EffectValueB4);
|
| | | valuelist.Add(config.EffectValueC4);
|
| | | dict.Add(config.Effect4, valuelist);
|
| | | }
|
| | |
|
| | | if (config.Effect5 != 0)
|
| | | {
|
| | | List<int> valuelist = new List<int>();
|
| | | valuelist.Add(config.EffectValueA5);
|
| | | valuelist.Add(config.EffectValueB5);
|
| | | valuelist.Add(config.EffectValueC5);
|
| | | dict.Add(config.Effect5, valuelist);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public struct GatherSoulData
|
| | | {
|
| | | public int itemId;
|
| | | public PackType packgeType;
|
| | | public int level;
|
| | | public int equipHole;
|
| | | public int index;
|
| | | }
|
| | |
|
| | | public class ItemAttrData
|
| | | {
|
| | | public PackType packType { get; private set; }
|
| | | public string guid { get; private set; }
|
| | | public int itemId { get; private set; }
|
| | | public int index { get; private set; }
|
| | | public ulong count { get; private set; }
|
| | | public int[] stones { get; private set; } //可镶嵌宝石数组 长度为0 未镶嵌 数值为0 未镶嵌
|
| | | public int score { get; private set; }
|
| | | public ItemConfig itemConfig { get; private set; }
|
| | | public bool isCustom { get; private set; } //是否是定制物品
|
| | | public int level { get; private set; }//等级
|
| | | public int equipHole { get; private set; }//聚魂孔
|
| | | public ItemTipChildType ChildType { get; private set; } //决定当前面板打开哪个
|
| | | public Dictionary<int, List<int>> useDataDict { get; private set; }
|
| | | public Dictionary<int, int> strengthDataDict { get; private set; }
|
| | | public Dictionary<int, int> legendDataDict { get; private set; }
|
| | | public Dictionary<int, int> exhaustedMaxDataDict { get; private set; }
|
| | | public Dictionary<int, int> wingsRefineMatDict { get; private set; }
|
| | | public Dictionary<ItemOperateType, Action<ItemOperateType, string>> tipsFuncBtnDic { get; private set; }
|
| | |
|
| | | public bool isHavePutLimit { get; private set; }
|
| | |
|
| | | GodBeastModel beastModel { get { return ModelCenter.Instance.GetModel<GodBeastModel>(); } }
|
| | |
|
| | | public ItemAttrData(int id, bool isPreview = false, ulong count = 0, int index = -1, bool isCompare = false, PackType type = PackType.Deleted, string guid = "", Dictionary<int, List<int>> useDataDict = null, ItemTipChildType childType = ItemTipChildType.Normal)
|
| | | {
|
| | | this.packType = type;
|
| | | this.itemConfig = ItemConfig.Get(id);
|
| | | this.tipsFuncBtnDic = new Dictionary<ItemOperateType, Action<ItemOperateType, string>>();
|
| | | this.guid = guid;
|
| | | this.itemId = id;
|
| | | this.count = count;
|
| | | this.index = index;
|
| | | this.useDataDict = useDataDict;
|
| | | this.ChildType = childType;
|
| | | this.isCustom = false;
|
| | | isHavePutLimit = true;
|
| | | this.level = 1;
|
| | | this.equipHole = -1;
|
| | | this.isCustom = ItemLogicUtility.Instance.IsCustomItem(id);
|
| | | if (isCustom)
|
| | | {
|
| | | var appointItemConfig = AppointItemConfig.Get(itemId);
|
| | | if (appointItemConfig != null)
|
| | | {
|
| | | if (appointItemConfig.CancelUseLimit == 1)
|
| | | {
|
| | | isHavePutLimit = false;
|
| | | }
|
| | | SetCustomAttrData(appointItemConfig);
|
| | | }
|
| | | this.itemId = itemConfig.EffectValueA1;
|
| | | this.itemConfig = ItemConfig.Get(this.itemId);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (isPreview)
|
| | | {
|
| | | List<int> legendIdlist = null;
|
| | | List<int> legendValuelist = null;
|
| | | switch (itemConfig.EquipPlace)
|
| | | {
|
| | | case 11:
|
| | | SetWingsLegendAttrPreview(out legendIdlist, out legendValuelist);
|
| | | break;
|
| | | case 101:
|
| | | case 102:
|
| | | case 103:
|
| | | case 104:
|
| | | case 105:
|
| | | SetDogzEquipLegendAttrPreview(out legendIdlist, out legendValuelist);
|
| | | break;
|
| | | }
|
| | |
|
| | | if (legendIdlist != null && legendValuelist != null)
|
| | | {
|
| | | if (legendIdlist.Count == legendValuelist.Count)
|
| | | {
|
| | | SetLegendData(legendIdlist, legendValuelist);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (GetUseDataModel(20) != null)
|
| | | {
|
| | | if (GetUseDataModel(20)[0] == 1)
|
| | | {
|
| | | isHavePutLimit = false;
|
| | | }
|
| | | }
|
| | |
|
| | | switch (type)
|
| | | {
|
| | | case PackType.Equip:
|
| | | int[] equipGems = null;
|
| | | var equipGemModel = ModelCenter.Instance.GetModel<EquipGemModel>();
|
| | | if (equipGemModel.TryGetEquipGems(index, out equipGems))
|
| | | {
|
| | | SetGemModel(equipGems);
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | SetLegendData(GetUseDataModel(17), GetUseDataModel(19));
|
| | | SetExhaustedData(GetUseDataModel(21), GetUseDataModel(23));
|
| | | SetWingsRefineMat(GetUseDataModel((int)ItemUseDataKey.wingMaterialItemID), GetUseDataModel((int)ItemUseDataKey.wingMaterialItemCount));
|
| | | }
|
| | | }
|
| | |
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(type, id, useDataDict, isPreview);
|
| | | if (type == PackType.DogzEquip || type == PackType.DogzItem)
|
| | | {
|
| | | strengthDataDict = new Dictionary<int, int>();
|
| | | if (GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus) != null)
|
| | | {
|
| | | StrengthLV = GetUseDataModel((int)ItemUseDataKey.dogzEquipPlus)[0];
|
| | | }
|
| | | Dictionary<int, int> getStregthDict = beastModel.SiteEnhancementAttribute(type, index);
|
| | | foreach (var key in getStregthDict.Keys)
|
| | | {
|
| | | strengthDataDict.Add(key, getStregthDict[key]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void SetWingsLegendAttrPreview(out List<int> ids, out List<int> values)
|
| | | {
|
| | | ids = new List<int>();
|
| | | values = new List<int>();
|
| | | var level = itemConfig.LV;
|
| | | var count = LegendPropertyUtility.GetWingPropertyCount(level);
|
| | | var properties = LegendPropertyUtility.GetWingProperties(level);
|
| | | if (properties != null)
|
| | | {
|
| | | for (var i = 0; ids.Count < count && i < properties.Count; i++)
|
| | | {
|
| | | var propertyId = properties[i];
|
| | | ids.Add(propertyId);
|
| | | values.Add(LegendPropertyUtility.GetWingPropertyValues(level, propertyId)[0]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void SetDogzEquipLegendAttrPreview(out List<int> legendIdlist, out List<int> legendValuelist)
|
| | | {
|
| | | legendIdlist = new List<int>();
|
| | | legendValuelist = new List<int>();
|
| | |
|
| | | var place = itemConfig.EquipPlace;
|
| | | if (LegendPropertyUtility.HasDogzPlace(place))
|
| | | {
|
| | | var ids = LegendPropertyUtility.GetDogzPlaceProperties(place);
|
| | | for (var i = ids.Count - 1; i >= 0; i--)
|
| | | {
|
| | | if (LegendPropertyUtility.GetDogzPropertyType(ids[i]) == LegendAttrType.Normal)
|
| | | {
|
| | | ids.RemoveAt(i);
|
| | | }
|
| | | }
|
| | |
|
| | | legendIdlist.AddRange(ids);
|
| | | }
|
| | |
|
| | | for (var i = 0; i < legendIdlist.Count; i++)
|
| | | {
|
| | | var propertyId = legendIdlist[i];
|
| | | var value = LegendPropertyUtility.GetDogzQualityPropertyValue(propertyId, itemConfig.ItemColor);
|
| | | legendValuelist.Add(value);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | /// <summary>
|
| | | /// 设置强化数据
|
| | | /// </summary>
|
| | | //private ItemPlusConfig.ItemPlusData itemPlus;
|
| | | public int StrengthLV { get; private set; }
|
| | | public void SetStrengthData(int lv, int type)
|
| | | {
|
| | | this.StrengthLV = lv;
|
| | | strengthDataDict = null;
|
| | | if (lv <= 0) return;
|
| | |
|
| | | strengthDataDict = new Dictionary<int, int>();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设置传奇属性数据
|
| | | /// </summary>
|
| | | /// <param name="ids"></param>
|
| | | /// <param name="values"></param>
|
| | | private void SetLegendData(List<int> ids, List<int> values)
|
| | | {
|
| | | legendDataDict = null;
|
| | | if (ids == null || ids.Count < 1) return;
|
| | |
|
| | | legendDataDict = new Dictionary<int, int>();
|
| | | int i = 0;
|
| | | for (i = 0; i < ids.Count; i++)
|
| | | {
|
| | | legendDataDict.Add(ids[i], values[i]);
|
| | | }
|
| | | }
|
| | |
|
| | | private void SetWingsRefineMat(List<int> ids, List<int> nums)
|
| | | {
|
| | | wingsRefineMatDict = null;
|
| | | if (ids == null || ids.Count < 1) return;
|
| | |
|
| | | wingsRefineMatDict = new Dictionary<int, int>();
|
| | | for (int i = 0; i < ids.Count; i++)
|
| | | {
|
| | | wingsRefineMatDict.Add(ids[i], nums[i]);
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设置绝版属性数据
|
| | | /// </summary>
|
| | | /// <param name="ids"></param>
|
| | | /// <param name="values"></param>
|
| | | private void SetExhaustedData(List<int> ids, List<int> values)
|
| | | {
|
| | | exhaustedMaxDataDict = null;
|
| | | if (ids == null || ids.Count < 1) return;
|
| | |
|
| | | exhaustedMaxDataDict = new Dictionary<int, int>();
|
| | | int i = 0;
|
| | | for (i = 0; i < ids.Count; i++)
|
| | | {
|
| | | exhaustedMaxDataDict.Add(ids[i], values[i]);
|
| | | }
|
| | | }
|
| | |
|
| | | //设置弹框的宝石数据
|
| | | public void SetGemModel(params int[] stones)
|
| | | {
|
| | | this.stones = stones;
|
| | | }
|
| | |
|
| | | public bool TryGetItemRemainTime(out double remainTime)
|
| | | {
|
| | | ItemCDCool cool = KnapsackTimeCDMgr.Instance.GetItemCoolById(guid);
|
| | | if (cool != null)
|
| | | {
|
| | | remainTime = cool.GetRemainTime();
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | remainTime = itemConfig.ExpireTime;
|
| | | var getTimes = GetUseDataModel((int)ItemUseDataKey.createTime);
|
| | | var serverSurplusTimes = GetUseDataModel((int)ItemUseDataKey.totalTime);
|
| | | if (remainTime > 0)
|
| | | {
|
| | | if (getTimes != null)
|
| | | {
|
| | | int getTime = getTimes[0];
|
| | | int serverSurplusTime = serverSurplusTimes != null ? serverSurplusTimes[0] : 0;
|
| | | if (getTime > 0)
|
| | | {
|
| | | double time = ItemLogicUtility.Instance.GetTimeOffest(TimeUtility.GetTime((uint)getTime));
|
| | | time = time > 0 ? time : 0;
|
| | | remainTime = (serverSurplusTime > 0 ? serverSurplusTime : itemConfig.ExpireTime) - time;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | #region 预览定制属性逻辑处理
|
| | |
|
| | | /// <summary>
|
| | | /// 设置定制属性的数据
|
| | | /// </summary> |
| | | private void SetCustomAttrData(AppointItemConfig appointItemConfig)
|
| | | {
|
| | | if (appointItemConfig == null)
|
| | | return;
|
| | |
|
| | | List<int> legendIdlist = null;
|
| | | List<int> legendValuelist = null;
|
| | | List<int> exhaustedIdlist = null;
|
| | | List<int> exhaustedValuelist = null;
|
| | | int i = 0;
|
| | | if (appointItemConfig.LegendAttrID.Length > 0)
|
| | | {
|
| | | legendIdlist = new List<int>();
|
| | | legendValuelist = new List<int>();
|
| | | for (i = 0; i < appointItemConfig.LegendAttrID.Length; i++)
|
| | | {
|
| | | if (appointItemConfig.LegendAttrID[i] != 0)
|
| | | {
|
| | | legendIdlist.Add(appointItemConfig.LegendAttrID[i]);
|
| | | legendValuelist.Add(appointItemConfig.LegendAttrValue[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (appointItemConfig.OutOfPrintAttr.Length > 0)
|
| | | {
|
| | | exhaustedIdlist = new List<int>();
|
| | | exhaustedValuelist = new List<int>();
|
| | | for (i = 0; i < appointItemConfig.OutOfPrintAttr.Length; i++)
|
| | | {
|
| | | if (appointItemConfig.OutOfPrintAttr[i] != 0)
|
| | | {
|
| | | exhaustedIdlist.Add(appointItemConfig.OutOfPrintAttr[i]);
|
| | | exhaustedValuelist.Add(appointItemConfig.OutOfPrintAttrValue[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | SetLegendData(legendIdlist, legendValuelist);
|
| | | SetExhaustedData(exhaustedIdlist, exhaustedValuelist);
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public List<int> GetUseDataModel(int key)
|
| | | {
|
| | | List<int> list = null;
|
| | | if (useDataDict != null)
|
| | | {
|
| | | useDataDict.TryGetValue(key, out list);
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设置弹框功能按钮
|
| | | /// </summary>
|
| | | /// <param name="type"></param>
|
| | | /// <param name="func"></param>
|
| | | public void SetTipsFuncBtn(ItemOperateType type, Action<ItemOperateType, string> func)
|
| | | {
|
| | | tipsFuncBtnDic.Add(type, func);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|