mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-08-17 16:57:11 +00:00
Merge pull request #25 from SamZahreddine/v3
[Fixed] Config file changed to "toml"
This commit is contained in:
commit
d7d1a550cb
@ -9,8 +9,8 @@
|
|||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
|
||||||
void Launcher::LoadConfig() {
|
void Launcher::LoadConfig() {
|
||||||
if(fs::exists("Launcher.cfg")) {
|
if(fs::exists("Launcher.toml")) {
|
||||||
toml::parse_result config = toml::parse_file("Launcher.cfg");
|
toml::parse_result config = toml::parse_file("Launcher.toml");
|
||||||
auto ui = config["UI"];
|
auto ui = config["UI"];
|
||||||
auto build = config["Build"];
|
auto build = config["Build"];
|
||||||
if(ui.is_boolean()) {
|
if(ui.is_boolean()) {
|
||||||
@ -24,13 +24,13 @@ void Launcher::LoadConfig() {
|
|||||||
} else LOG(ERROR) << "Failed to get 'Build' string from config";
|
} else LOG(ERROR) << "Failed to get 'Build' string from config";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
std::ofstream cfg("Launcher.cfg");
|
std::ofstream tml("Launcher.toml");
|
||||||
if(cfg.is_open()){
|
if(tml.is_open()){
|
||||||
cfg <<
|
tml <<
|
||||||
R"(UI = true
|
R"(UI = true
|
||||||
Build = "Default"
|
Build = "Default"
|
||||||
)";
|
)";
|
||||||
cfg.close();
|
tml.close();
|
||||||
}else{
|
}else{
|
||||||
LOG(FATAL) << "Failed to write config on disk!";
|
LOG(FATAL) << "Failed to write config on disk!";
|
||||||
throw ShutdownException("Fatal Error");
|
throw ShutdownException("Fatal Error");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user