Posted October 25, 20169 yr Is calling ConfigManager.load the correct way to save the config and inject the new values when ConfigChangedEvent.OnConfigChangedEvent is fired? Is there any way to get a list of ConfigCategory or IConfigElement from the new config system for use with GuiConfig ? Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
October 25, 20169 yr Hey choonster ^^ If you want to save something to your config when config changed event gets fired, you should compare the event modid with yours and in the if statement call the methods from your config class! And if you want a list with your config categories, you could do something like this (if you meant that): ArrayList<ConfigCategory> list=new ArrayList<ConfigCategory>(); for(String str:config.getCategoryNames()) list.add(config.getCategory(str)); Maybe that should also work with your config elements! Hope that helps Like music? https://www.youtube.com/channel/UCd-ak4MZEzotsR4XtbTWMSQ
October 26, 20169 yr Author I'm asking about the config system added in this commit, which automatically creates the Configuration object and doesn't give you direct access to it. This means you can't simply call Configuration#get for each property when changes have been made in the config GUI and you can't call Configuration#getCategoryNames to get a list of category names. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
October 26, 20169 yr Author Lex responded here. I ended up with this. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
October 26, 20169 yr Why do you load your config this way now and no more as before? You should have the ability to update values with properties! Or do I misunderstand what? Please tell me exactly what you need, because I misunderstand many things! Like music? https://www.youtube.com/channel/UCd-ak4MZEzotsR4XtbTWMSQ
October 26, 20169 yr Author Why do you load your config this way now and no more as before? You should have the ability to update values with properties! Or do I misunderstand what? Please tell me exactly what you need, because I misunderstand many things! I updated to the new config system to test it out. The new system automatically creates the Configuration instance when you annotate a class with @Config . Each public static field of this class is a property (if it's a primitive, primitive wrapper, String , Map or Enum ) or sub-category (if it's a custom class that directly extends Object ). You can annotate these fields with the sub-annotations of @Config to set the language key, comment or numeric range of the property. ConfigManager creates the properties and categories for you, you don't call any methods of Configuration yourself. The difficulty is that GuiConfig still expects you to have access to the Configuration instance so you can create the IConfigElement s from the properties and categories; but ConfigManager doesn't give you this access without resorting to reflection. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.