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

ItemAPI ItemDisplay fixes #371

Merged
merged 3 commits into from Mar 27, 2022
Merged

Conversation

Nebby1999
Copy link
Contributor

This PR fixes issue #370.

ItemAPI no longer checks if the pickup model prefab contains the ItemDisplay component, as in reality that prefab does not require said component, but instead checks the followerPrefab for the rules in the item/equipment's ItemDisplayDictionary.

The ItemDisplayDictionary now has a Validation method, the validation method does not prohibit the addition of a new item/equipment, instead, it's sole purpose is to ensure the Dictionary has valid ItemDisplayRules, the validation method logs the faulty rules using a string builder, which is later logged into the console using R2API.Logger.DebugLog().

The validator looks for:
ItemDisplayRules where the follower prefab is null
ItemDisplayRules where the follower prefab is not null, but does not have an ItemDisplay component
ItemDisplayRules where the follower prefab is not null, has an ItemDisplay Component, but said component's RendererInfos is empty.

Copy link
Member

@tristanmcpherson tristanmcpherson left a comment

Choose a reason for hiding this comment

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

Looks good

@tristanmcpherson tristanmcpherson merged commit cc80f77 into risk-of-thunder:master Mar 27, 2022
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.

None yet

2 participants