少年修仙传客户端代码仓库
client_Hale
2019-05-23 1c8bfbdd8e96b1f3ad1dfc10dad63e50cd0a2961
Merge remote-tracking branch 'origin/master' into HazyRegion_1
1个文件已修改
52 ■■■■ 已修改文件
System/KnapSack/Logic/PackModel.cs 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/PackModel.cs
@@ -106,7 +106,6 @@
            itemDayUseCntDict.Clear();
            itemSumUseCntDict.Clear();
            itemGUIDDict.Clear();
            showDropItem = false;
            isPlayBetterEquipEffect = false;
            colorType = EquipColorType.None;
            lvType = EquipLvType.All;
@@ -158,13 +157,11 @@
        public bool isPlayBetterEquipEffect { get; set; }  //整理背包时是否播放特效
        #region 接收服务端数据
        bool showDropItem = false;
        private Dictionary<PackType, SinglePack> playerPackDict = new Dictionary<PackType, SinglePack>();
        private Dictionary<string, ItemModel> itemGUIDDict = new Dictionary<string, ItemModel>();
        public void UpdatePack(H0725_tagRolePackRefreshEx packInfo)
        {
            showDropItem = false;
            SetLookIndex(null);
            var packType = (PackType)packInfo.PackType;
            if (!playerPackDict.ContainsKey(packType))
@@ -181,7 +178,7 @@
            {
                var itemInfo = new ItemInfo(packInfo.ItemInfo[i]);
                var item = playerPackDict[packType].UpdateItem(itemInfo);
                AddItemGUIDDict(item);
                AddItemGUIDDict(item, false);
                if (isPlayBetterEquipEffect)
                {
@@ -201,16 +198,29 @@
        {
            isPlayBetterEquipEffect = false;
            SetLookIndex(null);
            showDropItem = true;
            PackType type = (PackType)serverItem.PackType;
            if (!playerPackDict.ContainsKey(type))
            {
                playerPackDict.Add(type, new SinglePack(type));
            }
            }
            var showNewItem = false;
            if (itemGUIDDict.ContainsKey(serverItem.ItemGUID))
            {
                var prePack = itemGUIDDict[serverItem.ItemGUID].packType;
                var preAuction = itemGUIDDict[serverItem.ItemGUID].isAuction;
                var nowPackType = type;
                var nowAcution = serverItem.IsBind == 1;
                showNewItem = preAuction != nowAcution || prePack != nowPackType;
            }
            else
            {
                showNewItem = true;
            }
            var itemInfo = new ItemInfo(serverItem);
            var item = playerPackDict[type].UpdateItem(itemInfo);
            AddItemGUIDDict(item);
            var item = playerPackDict[type].UpdateItem(itemInfo);
            AddItemGUIDDict(item, showNewItem);
            if (refreshItemCountEvent != null)
            {
@@ -405,24 +415,10 @@
            }
        }
        void AddItemGUIDDict(ItemModel itemModel)
        {
            if (!itemGUIDDict.ContainsKey(itemModel.guid))
            {
                itemGUIDDict.Add(itemModel.guid, itemModel);
                GetItemEventCtrl(itemModel);
            }
            else
            {
                var prePack = itemGUIDDict[itemModel.guid].packType;
                itemGUIDDict[itemModel.guid] = itemModel;
                if (prePack != itemModel.packType)
                {
                    GetItemEventCtrl(itemModel);
                }
            }
        void AddItemGUIDDict(ItemModel itemModel, bool showNewItem)
        {
            itemGUIDDict[itemModel.guid] = itemModel;
            GetItemEventCtrl(itemModel, showNewItem);
        }
        void DeleteItemDictByGUID(PackType type, string guid)
@@ -567,9 +563,9 @@
        }
        #endregion
        private void GetItemEventCtrl(ItemModel itemModel)
        private void GetItemEventCtrl(ItemModel itemModel, bool showNewItem)
        {
            if (showDropItem)
            if (showNewItem)
            {
                bool isOverdue = false;
                if (itemModel.config.ExpireTime > 0)