MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / Save

Method Save

Goldleaf/source/cfg/cfg_Settings.cpp:178–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176 }
177
178 void Settings::Save() {
179 this->json_settings.general.value().language = GetLanguageCode(this->lang);
180
181 this->json_settings.ui.value().light_color_scheme = json::UiColorScheme{};
182 GenerateColorScheme(this->light_color_scheme, this->json_settings.ui.value().light_color_scheme.value(), DefaultLightScheme);
183
184 this->json_settings.ui.value().dark_color_scheme = json::UiColorScheme{};
185 GenerateColorScheme(this->dark_color_scheme, this->json_settings.ui.value().dark_color_scheme.value(), DefaultDarkScheme);
186
187 GLEAF_ASSERT_TRUE(!glz::write_file_json<PartialJsonOptions{}>(this->json_settings, "sdmc:/" GLEAF_PATH_SETTINGS_FILE, std::string{}));
188 }
189
190 std::string Settings::PathForResource(const std::string &res_path) {
191 auto romfs_exp = fs::GetRomFsExplorer();

Callers 3

input_DefaultKeyMethod · 0.80
bookmark_DefaultKeyMethod · 0.80
SaveChangesFunction · 0.80

Calls 2

GetLanguageCodeFunction · 0.85
GenerateColorSchemeFunction · 0.85

Tested by

no test coverage detected