少年修仙传客户端代码仓库
Client_PangDeRong
2018-09-06 56b9c524aa379cfce1ac3a7ab33236dd4bee8a23
1855 仙器替换界面显示评分比较图标
5个文件已修改
243 ■■■■ 已修改文件
System/KnapSack/New/CommonItemBaisc.cs 173 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/New/FairyWearWin.cs 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/New/ItemCell.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/New/RareItem.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Market/MarketBagItem.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/New/CommonItemBaisc.cs
@@ -126,23 +126,23 @@
        /// </summary>
        /// <param name="model"></param>
        /// <param name="isCompare"></param>
        public virtual void Init(ItemModel model,bool isCompare = false)
        public virtual void Init(ItemModel model,bool isCompare = false,int compareScore = 0)
        {
            itemConfig = Config.Instance.Get<ItemConfig>(model.itemInfo.ItemID);
            InitUI(model.itemInfo.ItemGUID,model.itemInfo.ItemID,(ulong)model.itemInfo.ItemCount,model.equipScore,model.itemInfo.IsBind,model.packType,isCompare,model.useDataDict);
            InitUI(model.itemInfo.ItemGUID,model.itemInfo.ItemID,(ulong)model.itemInfo.ItemCount,model.equipScore,model.itemInfo.IsBind,model.packType,isCompare,model.useDataDict,compareScore);
        }
        /// <summary>
        ///  初始化数据(预览)
        /// </summary>
        /// <param name="model"></param>
        public virtual void Init(ItemCellModel model)
        public virtual void Init(ItemCellModel model, int compareScore = 0)
        {
            itemConfig = model.itemConfig;
            InitUI(model.guid,model.itemId, model.count, model.score, model.isBind,model.packType,model.isCompare,model.useDataDic);
            InitUI(model.guid,model.itemId, model.count, model.score, model.isBind,model.packType,model.isCompare,model.useDataDic,compareScore);
        }
        private void InitUI(string guid,int itemId,ulong count,int score,int isBind,PackType type,bool isCompare, Dictionary<int, List<int>> useDataDic)
        private void InitUI(string guid,int itemId,ulong count,int score,int isBind,PackType type,bool isCompare, Dictionary<int, List<int>> useDataDic, int compareScore = 0)
        {
            if (itemConfig == null) return;
@@ -185,102 +185,101 @@
                countText.gameObject.SetActive(false);
            }
            if(!isCompare || type == PackType.rptEquip)
            int compareReslut = CheckIsCompare(type,itemId,score,isCompare,compareScore,guid);
            switch(compareReslut)
            {
                stateIcon.gameObject.SetActive(false);
                case 0:
                    stateIcon.gameObject.SetActive(false);
                    break;
                case 1:
                    stateIcon.gameObject.SetActive(true);
                    stateIcon.SetSprite("EquipForbidIcon");
                    break;
                case 2:
                    stateIcon.gameObject.SetActive(true);
                    stateIcon.SetSprite("EquipUpIcon");
                    break;
                case 3:
                    stateIcon.gameObject.SetActive(true);
                    stateIcon.SetSprite("EquipDownIcon");
                    break;
            }
        }
        /// <summary>
        /// 0 不比较 1 禁止比较 2 高评分 3 低评分
        /// </summary>
        /// <param name="itemId"></param>
        /// <param name="score"></param>
        /// <param name="isCompare"></param>
        /// <param name="compareSocre"></param>
        /// <returns></returns>
        public int CheckIsCompare(PackType type,int itemId, int score, bool isCompare,int compareSocre,string guid = "")
        {
            ItemConfig config = Config.Instance.Get<ItemConfig>(itemId);
            int playerJob = PlayerDatas.Instance.baseData.Job;
            if (config == null || (!isCompare && compareSocre <= 0) || config.EquipPlace == 0) return 0;
            ItemModel model = playerPack.GetItemModelByGUID(guid);
            if (model != null
                && (modelInterface.IsOverdue(guid, itemId, model.useDataDict)
                || (playerJob != Math.Floor((double)config.JobLimit / 100) && config.JobLimit != 0))) return 1;
            if(isCompare)
            {
               if(type != PackType.rptDogzItem)
                {
                    compareSocre = GetCompareSocre(PackType.rptEquip,config.EquipPlace);
                }
               else
                {
                    compareSocre = GetCompareSocre(PackType.rptDogzEquip, config.EquipPlace);
                }
               if(score == compareSocre)
                {
                    return 0;
                }
               else
                {
                    return score > compareSocre ? 2 : 3;
                }
            }
            else
            {
                stateIcon.gameObject.SetActive(true);
                if(type != PackType.rptDogzItem)
                {
                    bool isOverdue = modelInterface.IsOverdue(guid, itemId, useDataDic);
                    if (!isOverdue)
                return score > compareSocre ? 2 : 3;
            }
        }
        public int GetCompareSocre(PackType type,int equipPlace)
        {
            switch (type)
            {
                case PackType.rptEquip:
                    switch ((RoleEquipType)equipPlace)
                    {
                        ItemModel putOnModel = playerPack.GetItemModelByIndex(PackType.rptEquip, itemConfig.EquipPlace);
                        if (itemConfig.EquipPlace == (int)RoleEquipType.retFairyCan)
                        {
                            ItemModel fairyModel2 = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retFairyCan2);
                            if (fairyModel2 != null)
                        case RoleEquipType.retFairyCan:
                            ItemModel fairy01 = playerPack.GetItemModelByIndex(type,(int)RoleEquipType.retFairyCan);
                            ItemModel fairy02 = playerPack.GetItemModelByIndex(type, (int)RoleEquipType.retFairyCan2);
                            if(fairy01 == null || fairy02 == null)
                            {
                                if (putOnModel != null)
                                {
                                    if (fairyModel2.equipScore < putOnModel.equipScore)
                                    {
                                        putOnModel = fairyModel2;
                                    }
                                }
                                return 0;
                            }
                            else
                            {
                                putOnModel = fairyModel2;
                                return fairy01.equipScore >= fairy02.equipScore ? fairy02.equipScore : fairy01.equipScore;
                            }
                        }
                        int equipScore1 = 0;
                        if (putOnModel != null)
                        {
                            equipScore1 = putOnModel.equipScore;
                        }
                        int playerJob = PlayerDatas.Instance.baseData.Job;
                        if (playerJob == Math.Floor((double)itemConfig.JobLimit / 100) || itemConfig.JobLimit == 0)
                        {
                            if (equipScore1 > score)
                            {
                                stateIcon.SetSprite("EquipDownIcon");
                            }
                            else if (equipScore1 < score)
                            {
                                stateIcon.SetSprite("EquipUpIcon");
                            }
                            else
                            {
                                stateIcon.gameObject.SetActive(false);
                            }
                        }
                        else
                        {
                            stateIcon.SetSprite("EquipForbidIcon");
                        }
                        default:
                            ItemModel model = playerPack.GetItemModelByIndex(type,equipPlace);
                            return model == null ? 0 : model.equipScore;
                    }
                    else
                    {
                        stateIcon.SetSprite("EquipForbidIcon");
                    }
                }
                else
                {
                case PackType.rptDogzEquip:
                    var dogzModel = ModelCenter.Instance.GetModel<DogzModel>();
                    ItemModel putOnModel = null;
                     dogzModel.TryGetDogzEquip(dogzModel.presentSelectDogz, itemConfig.EquipPlace,out putOnModel);
                    if(putOnModel != null)
                    {
                        if(putOnModel.equipScore > score)
                        {
                            stateIcon.SetSprite("EquipDownIcon");
                        }
                        else if(putOnModel.equipScore < score)
                        {
                            stateIcon.SetSprite("EquipUpIcon");
                        }
                        else
                        {
                            stateIcon.gameObject.SetActive(false);
                        }
                    }
                    else
                    {
                        if(score > 0)
                        {
                            stateIcon.SetSprite("EquipUpIcon");
                        }
                        else
                        {
                            stateIcon.gameObject.SetActive(false);
                        }
                    }
                }
                    dogzModel.TryGetDogzEquip(dogzModel.presentSelectDogz, equipPlace, out putOnModel);
                    return putOnModel == null ? 0 : putOnModel.equipScore;
            }
            return 0;
        }
    }
System/KnapSack/New/FairyWearWin.cs
@@ -89,17 +89,15 @@
            if (_itemModel01 != null)
            {
                _itemCell01.gameObject.SetActive(true);
                _itemCell01.Init(_itemModel01, false);
                //_itemCell01.cellBtn.RemoveAllListeners();
                //_itemCell01.cellBtn.AddListener(()=>
                //{
                //    if (PackSendQuestMgr.Instance.sendItemModel != null)
                //    {
                //        itemTipsModel.SetCurrentAttrData(PackSendQuestMgr.Instance.sendItemModel,true);
                //        itemTipsModel.SetCompareAttrData(_itemModel01);
                //        itemTipsModel.ShowUICtrl();
                //    }
                //});
                if(PackSendQuestMgr.Instance.sendItemModel != null)
                {
                    _itemCell01.Init(_itemModel01, false, PackSendQuestMgr.Instance.sendItemModel.equipScore);
                }
                _itemCell01.cellBtn.RemoveAllListeners();
                _itemCell01.cellBtn.AddListener(() =>
                {
                    itemTipsModel.SetItemTipsModel(_itemModel01.packType,_itemModel01.itemInfo.ItemGUID);
                });
                //pdr ToDo  
                _wear01Text.text = Language.Get("BagWin_BtnText_1");
            }
@@ -112,21 +110,19 @@
            if (_itemModel02 != null)
            {
                _itemCell02.gameObject.SetActive(true);
                _itemCell02.Init(_itemModel02, false);
                //pdr ToDo
                _wear02Text.text = Language.Get("BagWin_BtnText_1");
                //_itemCell02.cellBtn.RemoveAllListeners();
                //_itemCell02.cellBtn.AddListener(()=>
                //{
                //    if (PackSendQuestMgr.Instance.sendItemModel != null)
                //    {
                //        itemTipsModel.SetCurrentAttrData(PackSendQuestMgr.Instance.sendItemModel, true);
                //        itemTipsModel.SetCompareAttrData(_itemModel02);
                //        itemTipsModel.ShowUICtrl();
                //    }
                //});
                if (PackSendQuestMgr.Instance.sendItemModel != null)
                {
                    _itemCell02.Init(_itemModel02, false, PackSendQuestMgr.Instance.sendItemModel.equipScore);
                }
                _itemCell02.cellBtn.RemoveAllListeners();
                _itemCell02.cellBtn.AddListener(() =>
                {
                    itemTipsModel.SetItemTipsModel(_itemModel02.packType, _itemModel02.itemInfo.ItemGUID);
                });
            }
            else
            {
System/KnapSack/New/ItemCell.cs
@@ -23,15 +23,15 @@
            }
        }
        public override void Init(ItemModel model,bool isCompare = false)
        public override void Init(ItemModel model,bool isCompare = false, int compareScore = 0)
        {
            base.Init(model, isCompare);
            base.Init(model, isCompare,compareScore);
            reducebtn.gameObject.SetActive(false);
        }
        public override void Init(ItemCellModel model)
        public override void Init(ItemCellModel model, int compareScore = 0)
        {
            base.Init(model);
            base.Init(model,compareScore);
            reducebtn.gameObject.SetActive(false);
        }
    }
System/KnapSack/New/RareItem.cs
@@ -1,14 +1,14 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TableConfig;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TableConfig;
namespace Snxxz.UI
{
    public class RareItem : CommonItemBaisc
    {
        [SerializeField] UIEffect m_RareSfx;
        public override void Init(ItemCellModel model)
        public override void Init(ItemCellModel model, int compareScore = 0)
        {
            if (m_RareSfx != null)
            {
@@ -17,7 +17,7 @@
            base.Init(model);
        }
        public void SetItemRare(ItemCellModel model, int _itemColor = 0)
        public void SetItemRare(ItemCellModel model, int _itemColor = 0, int compareScore = 0)
        {
            if (model == null)
            {
@@ -59,5 +59,5 @@
            }
        }
    }
}
}
System/Market/MarketBagItem.cs
@@ -6,12 +6,12 @@
{
    public class MarketBagItem : CommonItemBaisc
    {
        public override void Init(ItemModel model, bool isCompare = false)
        public override void Init(ItemModel model, bool isCompare = false, int compareScore = 0)
        {
            base.Init(model, isCompare);
        }
        public override void Init(ItemCellModel model)
        public override void Init(ItemCellModel model, int compareScore = 0)
        {
            base.Init(model);
        }