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

Dynamic config values #164

Closed
kingstefan26 opened this issue Nov 9, 2022 · 4 comments
Closed

Dynamic config values #164

kingstefan26 opened this issue Nov 9, 2022 · 4 comments
Labels
api related Issue/PR related to the public API enhancement New feature or request

Comments

@kingstefan26
Copy link

Why

currently, there are no ways to create fields and associated config options on runtime without class reloading,
the current annotation design is simple and well put together, but it breaks down when the project gets big. You end up with a massive class and all of your code ties back to one class

Why not

I can't really think how this would affect other parts of the code base in a meaningfully bad way, it would definitely be a advanced feature not intended for simple small mods

How it would look

I propose a api that would bypass the annotation part, and allow the dev to manually register an option, and retrieve its value. Something like config.registerOption(id, new Slider(min, max, name, category)) and then config.getOptionValue(id)

@kingstefan26
Copy link
Author

This would also allow devs to create their own abstracts around the config, like bundles of options that always go together could be created with one function call

@kingstefan26
Copy link
Author

kingstefan26 commented Nov 9, 2022

Another downside i can think of is someone relying too much on oneconfigs internal structure, but that can be avoided with strong encapsulation and a stable API

@xtrm-en xtrm-en added enhancement New feature or request api related Issue/PR related to the public API labels Feb 5, 2023
@Wyvest Wyvest linked a pull request Feb 10, 2023 that will close this issue
@Wyvest
Copy link
Member

Wyvest commented Jul 27, 2024

@nextdayy Would this be possible in V1? I assume so, right?

@Wyvest
Copy link
Member

Wyvest commented Aug 2, 2024

It is possible in V1.

@Wyvest Wyvest closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api related Issue/PR related to the public API enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants