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

Comments in Flint configs #205

Open
juliarn opened this issue May 29, 2021 · 7 comments
Open

Comments in Flint configs #205

juliarn opened this issue May 29, 2021 · 7 comments
Labels
feature A feature that needs to be implemented

Comments

@juliarn
Copy link
Member

juliarn commented May 29, 2021

Is your feature request related to a problem? Please describe.
It would be a nice feature if one could add comments to properties in Flint configs.

Describe the solution you'd like
A @Comment annotation with a String[] as value could be good for this. But as JSON does not support comments, this would only work for YAML or TOML for example. So what has to be done too is adding serializers for YAML and TOML, which would be great anyway.

Describe alternatives you've considered
/

@derrop derrop added the feature A feature that needs to be implemented label May 29, 2021
@Janrupf
Copy link
Contributor

Janrupf commented May 29, 2021

Alternatives:

  • Use a Json parser which supports comments
  • Use a Json derivative which supports comments

I don't really like they idea of having configurations in multiple formats for different packages, so if we decide to use YAML or TOML I would like to not use JSON anymore.

@juliarn
Copy link
Member Author

juliarn commented May 29, 2021

I think giving users the possibility to use their preferred format via annotation would be a nice thing. As the files are not directly accessed by other packages etc, I don’t see a problem there.

@zortax
Copy link
Contributor

zortax commented May 29, 2021

Why do we need comments in the first place? These configuration files are not supposed to be edited manually. Default values should be provided via annotations, not via a file. Just comment in the configuration interface.

@Janrupf
Copy link
Contributor

Janrupf commented May 29, 2021

I think comments generally make sense, sometimes you need to edit the configuration manually, either because your game wont start anymore or because some options are hidden from the GUI as they are debug only options.

@zortax
Copy link
Contributor

zortax commented May 29, 2021

Both cases should only be necessary for developers that have access to the original model interface. Debug options should still be visible in GUI, just hiddem behind a "Show Debug Options" setting or something like that. In my opinion it should be considered an implementation detail how and where we store serialized configurations. We might as well use a SQLite databse...
If the game doesn't start because of a configuration issue then that is clearly a bug in the package that is causing the crash. We could consider a "Safe Mode Startup" that automatically uses default configurations for all configs.

Anyways, if you wanna add this feature, go ahead, I'm fine with it, though I really think it is unnecessary and we shouldn't support manual config editing in this way.

@zortax
Copy link
Contributor

zortax commented May 29, 2021

I'm willing to reconsider my opinion on this once (or should I say if) we support serverside modding.

@juliarn
Copy link
Member Author

juliarn commented May 29, 2021

Yeah, that’s a point where this can be useful. In general, the config system is not depending on Minecraft, so it might be used in other contexts where comments and editing the config directly can be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A feature that needs to be implemented
Projects
None yet
Development

No branches or pull requests

4 participants