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

Rewrite Settings System #77

Open
kennyrkun opened this issue Nov 20, 2017 · 1 comment
Open

Rewrite Settings System #77

kennyrkun opened this issue Nov 20, 2017 · 1 comment

Comments

@kennyrkun
Copy link

I feel like the current Settings System is a little bulky and inflexible. I suggest rewriting it using Settings Parser. This is a very simple and flexible configuration manager. (I would implement this myself but I haven't been able to get the project to compile properly yet anyway.)

Here's an example from one of my projects on how this could be used

{
	SettingsParser settings;

	if (settings.loadFromFile(".\\" + GBL::DIR::BASE + "kunlauncher.conf"))
	{
		settings.get("window_width", app->settings.width);
		settings.get("window_height", app->settings.height);
		settings.get("updatelauncheronstart", app->settings.updateLauncherOnStart);
		settings.get("checkforitemsonstart", app->settings.checkForNewItemsOnStart);
		settings.get("experimentalThemes", app->settings.experimentalThemes);
		settings.get("printdownloadprogress", app->settings.printdownloadprogress);
		settings.get("defaultTheme", app->settings.selectedTheme);
	}
	else
	{
		std::cout << "failed to load settings, using defaults" << std::endl;
	}
}

With this, it would be very simple to add and remove things from the list without breaking things.
And, things can very easily be changed whilst the game is running.

  • :D :communibb:
@IridescentRose
Copy link
Contributor

I'll look into this after the current update to settings and stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants