feat(Globals): Added handling window

This commit is contained in:
Yimura 2021-07-25 21:06:49 +02:00
parent 35febb4f62
commit dd2bcbd898

View File

@ -39,8 +39,9 @@ struct globals {
}; };
struct window { struct window {
bool main = true; bool handling = false;
bool log = false; bool log = false;
bool main = true;
bool users = true; bool users = true;
bool player = false; bool player = false;
@ -74,6 +75,7 @@ struct globals {
this->weapons.custom_weapon = (CustomWeapon)j["weapons"]["custom_weapon"]; this->weapons.custom_weapon = (CustomWeapon)j["weapons"]["custom_weapon"];
this->window.handling = j["window"]["handling"];
this->window.log = j["window"]["log"]; this->window.log = j["window"]["log"];
this->window.main = j["window"]["main"]; this->window.main = j["window"]["main"];
this->window.users = j["window"]["users"]; this->window.users = j["window"]["users"];
@ -108,6 +110,7 @@ struct globals {
}, },
{ {
"window", { "window", {
{ "handling", this->window.handling },
{ "log", this->window.log }, { "log", this->window.log },
{ "main", this->window.main }, { "main", this->window.main },
{ "users", this->window.users } { "users", this->window.users }
@ -121,11 +124,8 @@ struct globals {
nlohmann::json& j = this->to_json(); nlohmann::json& j = this->to_json();
if (deep_compare(this->options, j, true)) if (deep_compare(this->options, j, true))
{
LOG(INFO) << "Settings changed, saving...";
this->save(); this->save();
} }
}
bool load() bool load()
{ {