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

Defer ConfigFile attribute-based events when using the OptionsMenuBuilder via RegisterModOptions<ConfigFile>. #232

Merged
merged 1 commit into from
Jul 10, 2021

Conversation

toebeann
Copy link
Contributor

@toebeann toebeann commented Jul 9, 2021

Changes made in this pull request

  • Defers all events for ConfigFiles making use of the OptionsMenuBuilder until the options menu has been successfully registered and the ConfigFile has been returned to the API consumer.

This is implemented by way of checking whether we have yet marked the options menu as being registered, and if not, wait until the first frame where it has been marked as registered, using UnityEngine's coroutines.

This enables consistency in all events - the API consumer can be sure that the ConfigFile instance has been passed back to them for use.

Builds de044d1

Subnautica

Stable
Experimental

Below Zero

Stable
Experimental

…lder` until the options menu has been successfully registered and the `ConfigFile` has been returned to the API consumer.
@toebeann toebeann merged commit f86c3d8 into dev Jul 10, 2021
@toebeann toebeann deleted the defer-configfile-attribute-events branch July 10, 2021 08:49
@toebeann toebeann mentioned this pull request Jul 10, 2021
toebeann added a commit that referenced this pull request Jul 25, 2021
…ing fired due to a missing `case` in the event router. 🤦
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants