diff --git a/src/core/globals.cpp b/src/core/globals.cpp index aadbeace..c03130af 100644 --- a/src/core/globals.cpp +++ b/src/core/globals.cpp @@ -83,6 +83,15 @@ namespace big return true; } + bool menu_settings::write_default_config() + { + std::ofstream file(m_save_file->get_path(), std::ios::out | std::ios::trunc); + file << m_default_options.dump(4); + file.close(); + + return true; + } + bool menu_settings::deep_compare(nlohmann::json& current_settings, const nlohmann::json& default_settings, bool compare_value) { bool should_save = false; @@ -122,14 +131,4 @@ namespace big return true; } - - bool menu_settings::write_default_config() - { - std::ofstream file(m_save_file->get_path(), std::ios::out | std::ios::trunc); - nlohmann::json j = *this; - file << j.dump(4); - file.close(); - - return true; - } } \ No newline at end of file diff --git a/src/core/globals.hpp b/src/core/globals.hpp index 5f3f1b72..3cc21732 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -49,11 +49,11 @@ namespace big void attempt_save(); bool load(); + bool write_default_config(); private: bool deep_compare(nlohmann::json& current_settings, const nlohmann::json& default_settings, bool compare_value = false); bool save(); - bool write_default_config(); private: bool m_running; diff --git a/src/views/settings/view_settings.cpp b/src/views/settings/view_settings.cpp index e7a3026a..eb3ba3f4 100644 --- a/src/views/settings/view_settings.cpp +++ b/src/views/settings/view_settings.cpp @@ -4,7 +4,13 @@ namespace big { void view::settings() { - components::sub_title("SETTINGS_MISC"_T); + ImGui::SeparatorText("SETTINGS_MISC"_T.data()); ImGui::Checkbox("SETTINGS_MISC_DEV_DLC"_T.data(), &g.settings.dev_dlc); + + if (ImGui::Button("Reset Settings")) + { + g.write_default_config(); + g.load(); + } } } \ No newline at end of file