meow
This commit is contained in:
parent
427b7b48a5
commit
2ac6fbfdec
5 changed files with 294 additions and 194 deletions
|
@ -34,14 +34,21 @@ namespace {
|
|||
|
||||
fn Config::getInstance() -> Config {
|
||||
fs::path configPath = GetConfigPath();
|
||||
|
||||
// purely visual but whatever
|
||||
#ifdef _WIN32
|
||||
configPath /= "draconis++\\config.toml";
|
||||
#else
|
||||
configPath /= "draconis++/config.toml";
|
||||
#endif
|
||||
|
||||
const Result<Config> result = rfl::toml::load<Config>(configPath.string());
|
||||
|
||||
if (!result) {
|
||||
ERROR_LOG("Failed to load config file: {}", result.error().what());
|
||||
DEBUG_LOG("Failed to load config file: {}", result.error().what());
|
||||
|
||||
exit(1);
|
||||
// Use default values
|
||||
return {};
|
||||
}
|
||||
|
||||
return result.value();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue