-
Notifications
You must be signed in to change notification settings - Fork 26
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
added the option to specify categories and subcategories with the @Category and @SubCategory annotations. #292
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks good, just not 100% sure of the rationale behind this change and a couple formatting/api status nitpicks. also run generate abi
optionNames.put(optionName, option); | ||
} | ||
} | ||
logger.trace("Finished generating option list for {} subcategory (targetting={})", mod.name, targetClass.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of this code is reused from addCategory
, maybe they could be combined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they look simular but they pass a diffrent amount of arguments to some methods, so it wouldnt really work. i could try tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i presume its not possible to abstractify this? they really do look very similar
In my opinion this way of specifying categories is much better, and leads to less confusing varible names. Also wyvest said it would be better, so how could it not? |
Sorry for the delayed responses from Polyfrost - we've all been going through IRL stuff like school and other related activities can you run the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -215,7 +219,7 @@ protected final void generateOptionList(Object instance, OptionPage page, Mod mo | |||
} | |||
|
|||
/** | |||
* Generate the option list, for internal use only | |||
* Generate the option list, for use only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for [...] use only?
optionNames.put(optionName, option); | ||
} | ||
} | ||
logger.trace("Finished generating option list for {} subcategory (targetting={})", mod.name, targetClass.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i presume its not possible to abstractify this? they really do look very similar
@Target(ElementType.FIELD) | ||
public @interface SubCategory { | ||
String name(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is there a random return here -- also these two categories dont have any autocompletion or recommended category names? we dont want 100 categories one from each mod -- it will be a pain to look at, manage, and do i18n for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(return means a line space btw, you might not have been confused but i was very confused so)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- please abstract out the method paulie mentioned
- please run "reformat code" to align it with our code quality standards
I have a problem with running mc in the devolpment environment, so i cant test these changes right now, but this should work and reduce some code duplication |
Stopped working on this since 1.0 is releasing, I hope that 1.0 won't also have this problem |
Description
This allows mod developers to better organize their code by creating a diffrent class for each category/subcategory of options they have, this also allows the devolper to create custom categories. This will not effect the current api, which can still be used.
Documentation
This feature adds 2 new annotions, @category and @SubCategory, Which both need to be documanted.
Checklist