Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.16d Hide the equipped items and In Team characters #146

Closed
xcygame opened this issue Mar 18, 2021 · 10 comments
Closed

v1.16d Hide the equipped items and In Team characters #146

xcygame opened this issue Mar 18, 2021 · 10 comments

Comments

@xcygame
Copy link

xcygame commented Mar 18, 2021

Hi Suriyun,
I tested the new features for the first time. So I checked "not show items and characters".
00

But they still exist in the inventory (when equip items or characters in team, there is no reduction of a grid)

For example, when I have 3 items and 2 items equipped, there shuould be 1 item lin the inventory , Instead of the current 3 objects in the inventory.
0
1

Am I miss something? Or does the current version not support this feature?

Thanks.

@insthync
Copy link
Member

There is no new settings for UI yet, those settings I made for just don't show "In Team" or "Equipped" message above icons.

@xcygame
Copy link
Author

xcygame commented Mar 18, 2021

There is no new settings for UI yet, those settings I made for just don't show "In Team" or "Equipped" message above icons.

I see. is there a way to subtract or hidden them from the inventory ? when items is equip and characters is in team.

@insthync
Copy link
Member

In UIInventoryManager.cs you can changes filter codes in Show function line 25

@xcygame
Copy link
Author

xcygame commented Mar 18, 2021

In UIInventoryManager.cs you can changes filter codes in Show function line 25

I found the code, but I'm not sure how to modify it. Could you take a screenshot?

@HajiyevEl
Copy link

HajiyevEl commented Mar 18, 2021

In UIInventoryManager.cs you can changes filter codes in Show function line 25

I found the code, but I'm not sure how to modify it. Could you take a screenshot?

In UIInventoryManager.cs find this line:
var list = PlayerItem.DataMap.Values.Where(a => UIItemListFilter.Filter(a, filterSetting)).ToList();
change to this:
var list = PlayerItem.DataMap.Values.Where(a => UIItemListFilter.Filter(a, filterSetting) && a.EquippedByItem != null).ToList();

@xcygame
Copy link
Author

xcygame commented Mar 19, 2021

In UIInventoryManager.cs you can changes filter codes in Show function line 25

I found the code, but I'm not sure how to modify it. Could you take a screenshot?

In UIInventoryManager.cs find this line:
var list = PlayerItem.DataMap.Values.Where(a => UIItemListFilter.Filter(a, filterSetting)).ToList();
change to this:
var list = PlayerItem.DataMap.Values.Where(a => UIItemListFilter.Filter(a, filterSetting) && a.EquippedByItem != null).ToList();

Thank you for your reply, but it doesn't seem to work. Here are some screenshots after modified code:

Inventory become unusable
0
In team character is still in the inventory
1

@HajiyevEl
Copy link

HajiyevEl commented Mar 19, 2021

In team character is still in the inventory

Oh my, sorry, it was evening and i didn't look properly at script hierarchy. Actually it should be UIEquipmentManager and not UIInventoryManager.

I changed my project and script too much so i can't tell which line it is, just find it yourself. Find this line in UIEquipmentManager:

var list = PlayerItem.DataMap.Values.Where(a => a.PlayerId == playerId && a.EquipmentData != null).ToList();

change to:

var list = PlayerItem.DataMap.Values.Where(a => a.PlayerId == playerId && a.EquipmentData != null && a.EquippedByItem == null).ToList();

This will hide already equipped items in character equipment window ONLY. (The one you did screenshot in first comment)

If you want to hide all equipped items from global inventory :

In UIInventoryManager.cs find this line:
var list = PlayerItem.DataMap.Values.Where(a => UIItemListFilter.Filter(a, filterSetting)).ToList();

change to this:

var list = PlayerItem.DataMap.Values.Where(a => UIItemListFilter.Filter(a, filterSetting) && a.EquippedByItem == null).ToList();

(Yesterday i had mistake here - a.EquippedByItem != null. It should have been a.EquippedByItem == null)

By the way, when checkmarking Not Show In Team Status, it just disables 'In Team' text component.
If you want to remove Characters that are already in Formation (Team) from inventory grid, once again change that line in UIInventoryManager to this:

var list = PlayerItem.DataMap.Values.Where(a => UIItemListFilter.Filter(a, filterSetting) && a.EquippedByItem == null && !(a.InTeamFormations.Count > 0)).ToList();

But even this is not all. Because inventory in Arena Formations uses UIItemList and not UIInventoryManager, so, if you want to filter heroes in Arena Formation inventory too, go to UIFormationManager, find this line:

var list = PlayerItem.DataMap.Values.Where(a => a.PlayerId == playerId && a.CharacterData != null).ToList();

change to:

var list = PlayerItem.DataMap.Values.Where(a => a.PlayerId == playerId && a.CharacterData != null && !(a.InTeamFormations.Count > 0)).ToList();

I think that's all. What a pain in the a## isn't it ?

@xcygame
Copy link
Author

xcygame commented Mar 19, 2021

In team character is still in the inventory

Oh my, sorry, it was evening and i didn't look properly at script hierarchy. Actually it should be UIEquipmentManager and not UIInventoryManager.

I changed my project and script too much so i can't tell which line it is, just find it yourself. Find this line in UIEquipmentManager:

var list = PlayerItem.DataMap.Values.Where(a => a.PlayerId == playerId && a.EquipmentData != null).ToList();

change to:

var list = PlayerItem.DataMap.Values.Where(a => a.PlayerId == playerId && a.EquipmentData != null && a.EquippedByItem == null).ToList();

This will hide already equipped items in character equipment window ONLY. (The one you did screenshot in first comment)

If you want to hide all equipped items from global inventory :

In UIInventoryManager.cs find this line:
var list = PlayerItem.DataMap.Values.Where(a => UIItemListFilter.Filter(a, filterSetting)).ToList();

change to this:

var list = PlayerItem.DataMap.Values.Where(a => UIItemListFilter.Filter(a, filterSetting) && a.EquippedByItem == null).ToList();

(Yesterday i had mistake here - a.EquippedByItem != null. It should have been a.EquippedByItem == null)

By the way, when checkmarking Not Show In Team Status, it just disables 'In Team' text component.
If you want to remove Characters that are already in Formation (Team) from inventory grid, once again change that line in UIInventoryManager to this:

var list = PlayerItem.DataMap.Values.Where(a => UIItemListFilter.Filter(a, filterSetting) && a.EquippedByItem == null && !(a.InTeamFormations.Count > 0)).ToList();

But even this is not all. Because inventory in Arena Formations uses UIItemList and not UIInventoryManager, so, if you want to filter heroes in Arena Formation inventory too, go to UIFormationManager, find this line:

var list = PlayerItem.DataMap.Values.Where(a => a.PlayerId == playerId && a.CharacterData != null).ToList();

change to:

var list = PlayerItem.DataMap.Values.Where(a => a.PlayerId == playerId && a.CharacterData != null && !(a.InTeamFormations.Count > 0)).ToList();

I think that's all. What a pain in the a## isn't it ?

Hello, I really appreciate your detailed explanation. The equipment works.

But there are still some problems with the character in the team (it didn't refresh immediately)

  1. When the character is in the team, the UI doesn't refresh immediately (but it actually works)
    0

  2. I close and reopen the UI interface, which actually works
    1

  3. When the character is not in the team, the UI interface does not refresh immediately too. In fact, it also works. Just close and reopen the UI interface.
    2

Maybe a little bit of setup is missing?

@HajiyevEl
Copy link

Maybe a little bit of setup is missing?

I would want to help, but i don't know myself what could be the problem. Let's ask @insthync together.

By the way, @insthync , how to find which character equipped which item?

@xcygame
Copy link
Author

xcygame commented Mar 19, 2021

Maybe a little bit of setup is missing?

I would want to help, but i don't know myself what could be the problem. Let's ask @insthync together.

By the way, @insthync , how to find which character equipped which item?

Anyway, I appreciate your help. On this question, it is a breakthrough (handshake) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants