少年修仙传客户端代码仓库
client_linchunjie
2018-09-05 50f9966ea6549cf5ba03c715354f94f9454aff5d
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
3个文件已修改
590 ■■■■ 已修改文件
System/KnapSack/Logic/ItemTipsModel.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/New/CommonItemBaisc.cs 542 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/New/FairyWearWin.cs 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/ItemTipsModel.cs
@@ -329,7 +329,6 @@
            FuncConfigConfig randomRuneConfig = Config.Instance.Get<FuncConfigConfig>("RandomRuneIDList");
            randomRuneIds = ConfigParse.GetMultipleStr<int>(randomRuneConfig.Numerical1);
            WindowCenter.Instance.windowBeforeCloseEvent += CloseWinEvent;
        }
        public void OnBeforePlayerDataInitialize()
@@ -355,13 +354,6 @@
        public ItemAttrData curAttrData { get; private set; }
        public ItemAttrData compareAttrData { get; private set; }
        private void CloseWinEvent(Window obj)
        {
            curAttrData = null;
            compareAttrData = null;
        }
        /// <summary>
        ///从背包类型中得到物品展示
System/KnapSack/New/CommonItemBaisc.cs
@@ -1,234 +1,226 @@
using UnityEngine;
using UnityEngine.UI;
using TableConfig;
using Snxxz.UI;
using System.Collections.Generic;
using System;
using System.Linq;
namespace Snxxz.UI
{
    public class CommonItemBaisc : MonoBehaviour
    {
        Image _bgIcon;
        public Image bgIcon
        {
            get
            {
                if (_bgIcon == null)
                {
                    var _trans = transform.Find("EquipBG");
                    _bgIcon = _trans != null ? _trans.GetComponent<Image>() : null;
                }
                return _bgIcon;
            }
        }
        Image _itemIcon;
        public Image itemIcon
        {
            get
            {
                if (_itemIcon == null)
                {
                    var _trans = transform.Find("ItemIcon");
                    _itemIcon = _trans != null ? _trans.GetComponent<Image>() : null;
                }
                return _itemIcon;
            }
        }
        Image _bindIcon;
        public Image bindIcon
        {
            get
            {
                if (_bindIcon == null)
                {
                    var _trans = transform.Find("BindBG");
                    _bindIcon = _trans != null ? _trans.GetComponent<Image>() : null;
                }
                return _bindIcon;
            }
        }
        Image _stateIcon;
        public Image stateIcon
        {
            get
            {
                if (_stateIcon == null)
                {
                    var _trans = transform.Find("stateIcon");
                    _stateIcon = _trans != null ? _trans.GetComponent<Image>() : null;
                }
                return _stateIcon;
            }
        }
        Text _countText;
        public Text countText
        {
            get
            {
                if (_countText == null)
                {
                    var _trans = transform.Find("CountText");
                    _countText = _trans != null ? _trans.GetComponent<Text>() : null;
                }
                return _countText;
            }
        }
        GameObject _starlist;
        public GameObject starlist
        {
            get
            {
                if (_starlist == null)
                {
                    var _trans = transform.Find("StarList");
                    _starlist = _trans != null ? _trans.gameObject : null;
                }
                return _starlist;
            }
        }
        Button _cellBtn;
        public Button cellBtn
        {
            get
            {
                if (_cellBtn == null)
                    _cellBtn = this.GetComponent<Button>();
                return _cellBtn;
            }
        }
        public ItemConfig itemConfig;
        PackModelInterface _modelInterface;
        protected PackModelInterface modelInterface
        {
            get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
        }
        PlayerPackModel _playerPack;
        protected PlayerPackModel playerPack
        {
            get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
        }
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        /// <summary>
        /// 初始化数据 bool值用来判断是否需要展示评分高低或者职业限制
        /// </summary>
        /// <param name="model"></param>
        /// <param name="isCompare"></param>
        public virtual void Init(ItemModel model,bool isCompare = false)
        {
            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);
        }
        /// <summary>
        ///  初始化数据(预览)
        /// </summary>
        /// <param name="model"></param>
        public virtual void Init(ItemCellModel model)
        {
            itemConfig = model.itemConfig;
            InitUI(model.guid,model.itemId, model.count, model.score, model.isBind,model.packType,model.isCompare,model.useDataDic);
        }
        private void InitUI(string guid,int itemId,ulong count,int score,int isBind,PackType type,bool isCompare, Dictionary<int, List<int>> useDataDic)
        {
            if (itemConfig == null) return;
            itemIcon.gameObject.SetActive(true);
            bgIcon.gameObject.SetActive(true);
            itemIcon.SetSprite(itemConfig.IconKey);
            bgIcon.SetItemBackGround(modelInterface.GetItemQuality(itemId, useDataDic));
            int i = 0;
            for(i = 0; i < starlist.transform.childCount; i++)
            {
                Image starIcon = starlist.transform.GetChild(i).GetComponent<Image>();
                starIcon.SetSprite("Stars_a");
                if (i >= itemConfig.StarLevel)
                {
                    starIcon.gameObject.SetActive(false);
                }
                else
                {
                    starIcon.gameObject.SetActive(true);
                }
            }
            if(isBind == 0)
            {
                bindIcon.gameObject.SetActive(false);
            }
            else
            {
                bindIcon.gameObject.SetActive(true);
            }
            countText.text = UIHelper.ReplaceLargeNum((double)count);
            if(count > 1)
            {
                countText.gameObject.SetActive(true);
            }
            else
            {
                countText.gameObject.SetActive(false);
            }
            if(!isCompare || type == PackType.rptEquip)
            {
                stateIcon.gameObject.SetActive(false);
            }
            else
            {
                stateIcon.gameObject.SetActive(true);
using UnityEngine;
using UnityEngine.UI;
using TableConfig;
using Snxxz.UI;
using System.Collections.Generic;
using System;
using System.Linq;
namespace Snxxz.UI
{
    public class CommonItemBaisc : MonoBehaviour
    {
        Image _bgIcon;
        public Image bgIcon
        {
            get
            {
                if (_bgIcon == null)
                {
                    var _trans = transform.Find("EquipBG");
                    _bgIcon = _trans != null ? _trans.GetComponent<Image>() : null;
                }
                return _bgIcon;
            }
        }
        Image _itemIcon;
        public Image itemIcon
        {
            get
            {
                if (_itemIcon == null)
                {
                    var _trans = transform.Find("ItemIcon");
                    _itemIcon = _trans != null ? _trans.GetComponent<Image>() : null;
                }
                return _itemIcon;
            }
        }
        Image _bindIcon;
        public Image bindIcon
        {
            get
            {
                if (_bindIcon == null)
                {
                    var _trans = transform.Find("BindBG");
                    _bindIcon = _trans != null ? _trans.GetComponent<Image>() : null;
                }
                return _bindIcon;
            }
        }
        Image _stateIcon;
        public Image stateIcon
        {
            get
            {
                if (_stateIcon == null)
                {
                    var _trans = transform.Find("stateIcon");
                    _stateIcon = _trans != null ? _trans.GetComponent<Image>() : null;
                }
                return _stateIcon;
            }
        }
        Text _countText;
        public Text countText
        {
            get
            {
                if (_countText == null)
                {
                    var _trans = transform.Find("CountText");
                    _countText = _trans != null ? _trans.GetComponent<Text>() : null;
                }
                return _countText;
            }
        }
        GameObject _starlist;
        public GameObject starlist
        {
            get
            {
                if (_starlist == null)
                {
                    var _trans = transform.Find("StarList");
                    _starlist = _trans != null ? _trans.gameObject : null;
                }
                return _starlist;
            }
        }
        Button _cellBtn;
        public Button cellBtn
        {
            get
            {
                if (_cellBtn == null)
                    _cellBtn = this.GetComponent<Button>();
                return _cellBtn;
            }
        }
        public ItemConfig itemConfig;
        PackModelInterface _modelInterface;
        protected PackModelInterface modelInterface
        {
            get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
        }
        PlayerPackModel _playerPack;
        protected PlayerPackModel playerPack
        {
            get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
        }
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        /// <summary>
        /// 初始化数据 bool值用来判断是否需要展示评分高低或者职业限制
        /// </summary>
        /// <param name="model"></param>
        /// <param name="isCompare"></param>
        public virtual void Init(ItemModel model,bool isCompare = false)
        {
            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);
        }
        /// <summary>
        ///  初始化数据(预览)
        /// </summary>
        /// <param name="model"></param>
        public virtual void Init(ItemCellModel model)
        {
            itemConfig = model.itemConfig;
            InitUI(model.guid,model.itemId, model.count, model.score, model.isBind,model.packType,model.isCompare,model.useDataDic);
        }
        private void InitUI(string guid,int itemId,ulong count,int score,int isBind,PackType type,bool isCompare, Dictionary<int, List<int>> useDataDic)
        {
            if (itemConfig == null) return;
            itemIcon.gameObject.SetActive(true);
            bgIcon.gameObject.SetActive(true);
            itemIcon.SetSprite(itemConfig.IconKey);
            bgIcon.SetItemBackGround(modelInterface.GetItemQuality(itemId, useDataDic));
            int i = 0;
            for(i = 0; i < starlist.transform.childCount; i++)
            {
                Image starIcon = starlist.transform.GetChild(i).GetComponent<Image>();
                starIcon.SetSprite("Stars_a");
                if (i >= itemConfig.StarLevel)
                {
                    starIcon.gameObject.SetActive(false);
                }
                else
                {
                    starIcon.gameObject.SetActive(true);
                }
            }
            if(isBind == 0)
            {
                bindIcon.gameObject.SetActive(false);
            }
            else
            {
                bindIcon.gameObject.SetActive(true);
            }
            countText.text = UIHelper.ReplaceLargeNum((double)count);
            if(count > 1)
            {
                countText.gameObject.SetActive(true);
            }
            else
            {
                countText.gameObject.SetActive(false);
            }
            if(!isCompare || type == PackType.rptEquip)
            {
                stateIcon.gameObject.SetActive(false);
            }
            else
            {
                stateIcon.gameObject.SetActive(true);
                if(type != PackType.rptDogzItem)
                {
                    bool isOverdue = modelInterface.IsOverdue(guid, itemId, useDataDic);
                    if (!isOverdue)
                    {
                        int equipScore1 = 0;
                        if (tipsModel.compareAttrData != null)
                        ItemModel putOnModel = playerPack.GetItemModelByIndex(PackType.rptEquip, itemConfig.EquipPlace);
                        if (itemConfig.EquipPlace == (int)RoleEquipType.retFairyCan)
                        {
                            equipScore1 = tipsModel.compareAttrData.score;
                        }
                        else
                        {
                            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)
                            {
                                ItemModel fairyModel2 = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retFairyCan2);
                                if (fairyModel2 != null)
                                if (putOnModel != null)
                                {
                                    if (putOnModel != null)
                                    if (fairyModel2.equipScore < putOnModel.equipScore)
                                    {
                                        if (fairyModel2.equipScore < putOnModel.equipScore)
                                        {
                                            putOnModel = fairyModel2;
                                        }
                                        putOnModel = fairyModel2;
                                    }
                                }
                                else
                                {
                                    putOnModel = fairyModel2;
                                }
                            }
                            if (putOnModel != null)
                            else
                            {
                                equipScore1 = putOnModel.equipScore;
                                putOnModel = fairyModel2;
                            }
                        }
                        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)
                        {
@@ -254,7 +246,7 @@
                    {
                        stateIcon.SetSprite("EquipForbidIcon");
                    }
                }
                }
                else
                {
                    var dogzModel = ModelCenter.Instance.GetModel<DogzModel>();
@@ -286,61 +278,61 @@
                            stateIcon.gameObject.SetActive(false);
                        }
                    }
                }
            }
        }
    }
    public class ItemCellModel
    {
        public string guid { get; private set; }
        public int itemId { get; private set; }
        public ulong count { get; private set; }
        public int isBind { get; private set; }
        public int score { get; private set; }
        public bool isCompare { get; private set; }
        public ItemConfig itemConfig { get; private set;}
        public PackType packType { get; private set; }
        public Dictionary<int, List<int>> useDataDic { get; private set; }
        public Dictionary<int, int> specAttrDic { get; private set; }
        PackModelInterface _modelInterface;
        PackModelInterface modelInterface
        {
            get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
        }
        public ItemCellModel(int itemId,bool isPreview = false,ulong count = 0,int isBind = 0,string guid = "",PackType type = PackType.rptDeleted,bool isCompare = false, Dictionary<int, List<int>> useDataDic = null)
        {
            specAttrDic = new Dictionary<int, int>();
            this.guid = guid;
            this.itemId = itemId;
            this.count = count;
            this.isBind = isBind;
            this.itemConfig = Config.Instance.Get<ItemConfig>(itemId);
            this.isCompare = isCompare;
            this.useDataDic = useDataDic;
            this.packType = type;
            if(CheckIsCustomItem())
            {
                this.itemId = itemConfig.EffectValueA1;
                this.itemConfig = Config.Instance.Get<ItemConfig>(this.itemId);
            }
            this.score = modelInterface.SetEquipScore(type,itemId,useDataDic,isPreview);
        }
        public bool CheckIsCustomItem()
        {
            if (itemConfig == null) return false;
            if (itemConfig.Effect1 == 220)
            {
                return true;
            }
            return false;
        }
    }
}
                }
            }
        }
    }
    public class ItemCellModel
    {
        public string guid { get; private set; }
        public int itemId { get; private set; }
        public ulong count { get; private set; }
        public int isBind { get; private set; }
        public int score { get; private set; }
        public bool isCompare { get; private set; }
        public ItemConfig itemConfig { get; private set;}
        public PackType packType { get; private set; }
        public Dictionary<int, List<int>> useDataDic { get; private set; }
        public Dictionary<int, int> specAttrDic { get; private set; }
        PackModelInterface _modelInterface;
        PackModelInterface modelInterface
        {
            get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
        }
        public ItemCellModel(int itemId,bool isPreview = false,ulong count = 0,int isBind = 0,string guid = "",PackType type = PackType.rptDeleted,bool isCompare = false, Dictionary<int, List<int>> useDataDic = null)
        {
            specAttrDic = new Dictionary<int, int>();
            this.guid = guid;
            this.itemId = itemId;
            this.count = count;
            this.isBind = isBind;
            this.itemConfig = Config.Instance.Get<ItemConfig>(itemId);
            this.isCompare = isCompare;
            this.useDataDic = useDataDic;
            this.packType = type;
            if(CheckIsCustomItem())
            {
                this.itemId = itemConfig.EffectValueA1;
                this.itemConfig = Config.Instance.Get<ItemConfig>(this.itemId);
            }
            this.score = modelInterface.SetEquipScore(type,itemId,useDataDic,isPreview);
        }
        public bool CheckIsCustomItem()
        {
            if (itemConfig == null) return false;
            if (itemConfig.Effect1 == 220)
            {
                return true;
            }
            return false;
        }
    }
}
System/KnapSack/New/FairyWearWin.cs
@@ -90,16 +90,16 @@
            {
                _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();
                    }
                });
                //_itemCell01.cellBtn.RemoveAllListeners();
                //_itemCell01.cellBtn.AddListener(()=>
                //{
                //    if (PackSendQuestMgr.Instance.sendItemModel != null)
                //    {
                //        itemTipsModel.SetCurrentAttrData(PackSendQuestMgr.Instance.sendItemModel,true);
                //        itemTipsModel.SetCompareAttrData(_itemModel01);
                //        itemTipsModel.ShowUICtrl();
                //    }
                //});
                //pdr ToDo  
                _wear01Text.text = Language.Get("BagWin_BtnText_1");
            }
@@ -116,16 +116,16 @@
                //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();
                    }
                });
                //_itemCell02.cellBtn.RemoveAllListeners();
                //_itemCell02.cellBtn.AddListener(()=>
                //{
                //    if (PackSendQuestMgr.Instance.sendItemModel != null)
                //    {
                //        itemTipsModel.SetCurrentAttrData(PackSendQuestMgr.Instance.sendItemModel, true);
                //        itemTipsModel.SetCompareAttrData(_itemModel02);
                //        itemTipsModel.ShowUICtrl();
                //    }
                //});
             
            }
            else