Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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 ;D

  • 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.

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.