Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add "saving config" screen to the config menu #78

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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