MCPcopy Create free account
hub / github.com/cemu-project/Cemu / SaveStateToConfig

Method SaveStateToConfig

src/gui/GraphicPacksWindow2.cpp:326–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326void GraphicPacksWindow2::SaveStateToConfig()
327{
328 auto& data = g_config.data();
329 data.graphic_pack_entries.clear();
330
331 for (const auto& gp : GraphicPack2::GetGraphicPacks())
332 {
333 auto filename = _utf8ToPath(gp->GetNormalizedPathString());
334 if (gp->IsEnabled())
335 {
336 data.graphic_pack_entries.try_emplace(filename);
337 auto& it = data.graphic_pack_entries[filename];
338 // otherwise store all selected presets
339 for (const auto& preset : gp->GetActivePresets())
340 it.try_emplace(preset->category, preset->name);
341 }
342 else if(gp->IsDefaultEnabled())
343 {
344 // save that its disabled
345 data.graphic_pack_entries.try_emplace(filename);
346 auto& it = data.graphic_pack_entries[filename];
347 it.try_emplace("_disabled", "false");
348 }
349 }
350
351 g_config.Save();
352}
353
354GraphicPacksWindow2::~GraphicPacksWindow2()
355{

Callers

nothing calls this directly

Calls 9

_utf8ToPathFunction · 0.85
try_emplaceMethod · 0.80
GetActivePresetsMethod · 0.80
IsDefaultEnabledMethod · 0.80
dataMethod · 0.45
clearMethod · 0.45
IsEnabledMethod · 0.45
SaveMethod · 0.45

Tested by

no test coverage detected