Skip to content

Commit

Permalink
Add "saving config" screen to the config menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Maschell committed May 10, 2024
1 parent 4225d8f commit b372d78
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/utils/config/ConfigUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ void ConfigUtils::displayMenu() {

gOnlyAcceptFromThread = OSGetCurrentThread();
while (true) {
startTime = OSGetTime();
if (gConfigMenuShouldClose) {
gConfigMenuShouldClose = false;
break;
Expand Down Expand Up @@ -212,6 +213,9 @@ void ConfigUtils::displayMenu() {
}
}

startTime = OSGetTime();
renderBasicScreen("Saving configs...");

for (const auto &plugin : gLoadedPlugins) {
const auto configData = plugin.getConfigData();
if (configData) {
Expand All @@ -224,6 +228,12 @@ void ConfigUtils::displayMenu() {
}

WUPSConfigAPIBackend::Intern::CleanAllHandles();

// we want wait at least 300ms to avoid leaking inputs from the config menu to the application
auto diffTime = OSTicksToMilliseconds(OSGetTime() - startTime);
if (diffTime < 300) {
OSSleepTicks(OSMillisecondsToTicks(300 - diffTime));
}
}

extern "C" uint32_t __OSPhysicalToEffectiveUncached(uint32_t);
Expand Down

0 comments on commit b372d78

Please # to comment.