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

Add IGameInventory.GetInventoryItems #2008

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Haselnussbomber
Copy link
Contributor

This PR adds a new GetInventoryItems function to IGameInventory, which returns a ReadOnlySpan<GameInventoryItem> of all slots in the container.

I can't think of any inventory container that ues symbolic links. My guess is that they are only used in Agents and such, so we don't have to worry about it. I even checked the containers MailEdit and HandIn, surprisingly no symbolic links.
I guess we'll hear when someone has trouble with it.

Screenshot

@Haselnussbomber Haselnussbomber requested a review from a team as a code owner August 11, 2024 16:07
@@ -403,6 +403,9 @@ internal class GameInventoryPluginScoped : IInternalDisposableService, IGameInve
/// <inheritdoc/>
public event IGameInventory.InventoryChangedDelegate<InventoryItemMergedArgs>? ItemMergedExplicit;

/// <inheritdoc/>
public ReadOnlySpan<GameInventoryItem> GetInventoryItems(GameInventoryType type) => GameInventoryItem.GetReadOnlySpanOfInventory(type);
Copy link
Member

@KazWolfe KazWolfe Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it that this use case hasn't come up yet?

No, legitimately. It seems weird to the point of being intentional that this has yet to be a thing.

Copy link
Contributor Author

@Haselnussbomber Haselnussbomber Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because everyone that needs inventory items uses InventoryManager directly? I don't know. 🤷‍♂️
I think its weird that Dalamud has a IGameInventory service and you can't even read the inventories with it.

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

Successfully merging this pull request may close these issues.

2 participants