Backport 1.12.2 config subcategory behavior #58
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In 1.12.2 you can declare static instances of inner classes in your
@Config
annotated class, those instances will then be automatically treated and parsed as subcategories of that class.There's an example of it here https://github.com/GTNewHorizons/GTNHLib/blob/056959f0f51e3f2699274d264a9a7887a257f315/src/main/java/com/gtnewhorizon/gtnhlib/config/TestConfig.java
This will automagically be parsed into
I also made it possible to get categorized IConfigElements for the config gui so that it will look like this
As opposed to something like Hodgepodge's current config gui where all the elements are on one page with a humongous scrollbar.
Also adds a method to save the current field values to the config file & adds double as a config option, because why tf is double[] an option while double isn't