| | |
| | | |
| | | public event Action<int> refreshItemDayUseCountEvent; //刷新物品每日使用数量 |
| | | public event Action<int> refreshItemSumUseCountEvent; //刷新物品总使用数量 |
| | | public event Action<PackType, string, bool> RefreshItemLockEvent; //物品锁定刷新 背包类型,guid,锁定状态 |
| | | |
| | | public bool isPlayBetterEquipEffect { get; set; } //整理背包时是否播放特效 |
| | | |
| | |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize; |
| | | DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent += OnAfterPlayerDataInitialize; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | ParseConfig(); |
| | | //SysNotifyMgr.Instance.sysNotifyEvent += RefreshSysInfo; |
| | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize; |
| | | DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent -= OnAfterPlayerDataInitialize; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | // SysNotifyMgr.Instance.sysNotifyEvent -= RefreshSysInfo; |
| | |
| | | itemDayUseCntDict.Clear(); |
| | | itemSumUseCntDict.Clear(); |
| | | itemGUIDDict.Clear(); |
| | | PackGirdServerBuyCountDict.Clear(); |
| | | isPlayBetterEquipEffect = false; |
| | | } |
| | | |
| | | public void OnAfterPlayerDataInitialize() |
| | | { |
| | | |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | public void UpdateItemLockState(H0722_tagItemDeadLockRefresh netPack) |
| | | { |
| | | var singlePack = GetSinglePack((PackType)netPack.PackType); |
| | | var item = singlePack.GetItemByIndex(netPack.ItemIndex); |
| | | if (item == null) |
| | | { |
| | | return; |
| | | } |
| | | item.itemInfo.isLock = netPack.IsLock == 1; |
| | | RefreshItemLockEvent?.Invoke((PackType)netPack.PackType, item.guid, item.itemInfo.isLock); |
| | | } |
| | | |
| | | public void UpdateBuyPackGirdCount(HA207_tagSCPackBuyInfo netPack) |
| | | { |
| | | for (int i = 0; i < netPack.BuyInfoList.Length; i++) |
| | | { |
| | | { |
| | | PackGirdServerBuyCountDict[netPack.BuyInfoList[i].PackType] = netPack.BuyInfoList[i].BuyCnt; |
| | | } |
| | | } |
| | |
| | | |
| | | UpdatePackRedpoint(type); |
| | | } |
| | | |
| | | |
| | | |
| | | public void RefreshItemCount(H0707_tagItemCountRefresh refresh) |
| | | { |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 得到ID相同的物品数量 |
| | | /// 得到ID相同的物品数量; 也可以获得部分货币和物品绑定的数量 |
| | | /// </summary> |
| | | /// <param name="type"></param> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public int GetItemCountByID(PackType type, int id, bool includeAuction = true) |
| | | public ulong GetItemCountByID(PackType type, int id, bool includeAuction = true) |
| | | { |
| | | int count = 0; |
| | | ulong count = 0; |
| | | var singlePack = GetSinglePack(type); |
| | | if (singlePack != null) |
| | | { |
| | |
| | | |
| | | public void SetLookIndex(string guid, int singleRowCount = 5) |
| | | { |
| | | if (string.IsNullOrEmpty(guid) || guid == "") |
| | | { |
| | | lookLineIndex = -1; |
| | | lookItemGUID = ""; |
| | | } |
| | | else |
| | | { |
| | | int index = GetItemByGuid(guid).gridIndex; |
| | | lookLineIndex = index / singleRowCount; |
| | | lookItemGUID = guid; |
| | | } |
| | | return; |
| | | // if (string.IsNullOrEmpty(guid) || guid == "") |
| | | // { |
| | | // lookLineIndex = -1; |
| | | // lookItemGUID = ""; |
| | | // } |
| | | // else |
| | | // { |
| | | // int index = GetItemByGuid(guid).gridIndex; |
| | | // lookLineIndex = index / singleRowCount; |
| | | // lookItemGUID = guid; |
| | | // } |
| | | |
| | | if (lookEquipEvent != null) |
| | | { |
| | | lookEquipEvent(); |
| | | } |
| | | // if (lookEquipEvent != null) |
| | | // { |
| | | // lookEquipEvent(); |
| | | // } |
| | | } |
| | | |
| | | public event Action RefreshBagEvent; |