fixed some more stuff

This commit is contained in:
Mars 2024-06-21 23:07:31 -04:00
parent 3cf13c45bc
commit 164a68c5ee
4 changed files with 36 additions and 32 deletions

View file

@ -1,6 +1,12 @@
#include "config.h"
fn Config::getInstance() -> const Config& {
static const Config* INSTANCE = new Config(rfl::toml::load<Config>("./config.toml").value());
fn Config::getInstance()->const Config& {
#ifdef __WIN32__
const string path = string(getenv("LOCALAPPDATA")) + "\\draconis++\\config.toml";
#else
const string path = string(getenv("HOME")) + "/.config/draconis++/config.toml";
#endif
// ReSharper disable once CppDFAMemoryLeak
static const Config* INSTANCE = new Config(rfl::toml::load<Config>(path).value());
return *INSTANCE;
}