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

Fix map netId completions #5495

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

Conversation

IProduceWidgets
Copy link
Contributor

@IProduceWidgets IProduceWidgets commented Oct 16, 2024

Map netId's completion helpers didn't work because empty strings fail NetEntity.TryParse. I special cased it.
Also made the helper pull all maps because it would be unhelpful if it didn't.

Comment on lines +190 to 192

return Components<MapComponent>(string.Empty, entManager, limit: int.MaxValue); // faster just to pass the max value than bother unlimiting it.
}
Copy link
Contributor

Choose a reason for hiding this comment

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

At least it make it like 100 or something if you want higher than 20.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But if you have more than 100 maps it just wont work as expected.

Copy link
Member

Choose a reason for hiding this comment

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

The limit only applies to matching uids, so as you start typing the uid it would still eventually show the completions for the map you want, even if there are far more than 20 maps. It only really matters if you really want to get given the completion tooltip with 100+ maps that you want to manually read through to find the right uid.

Though TBH I'm not even sure if having the limit implemented like that is really of any use. Even with it there, the helper should still only ever be used when you know there's only going to be a handful of components. Calling with with something like TransformComponent could still result in it iterating over almost all entities . E.g., in my toolshed PR I just arbitrarily limited it to EntityManager.Count<TComp>() <= 128

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.

3 participants