Compare commits

..

1 Commits

Author SHA1 Message Date
DeaTh-G 460bc583a5 Respect update check timeout without the same session too 2026-02-01 19:35:54 +01:00
4 changed files with 12 additions and 12 deletions
+3
View File
@@ -1,5 +1,8 @@
#pragma once #pragma once
// 6 hour long timeout between checks.
static constexpr double g_timeBetweenUpdateChecksInSeconds = 6 * 60 * 60;
struct UpdateChecker struct UpdateChecker
{ {
enum class Result enum class Result
+3 -3
View File
@@ -307,11 +307,11 @@ int main(int argc, char *argv[])
} }
#endif #endif
// Check the time since the last time an update was checked. Store the new time if the difference is more than six hours. // Check the time since the last time an update was checked.
constexpr double TimeBetweenUpdateChecksInSeconds = 6 * 60 * 60; // Store the new time if the difference is more than g_timeBetweenUpdateChecksInSeconds hours.
time_t timeNow = std::time(nullptr); time_t timeNow = std::time(nullptr);
double timeDifferenceSeconds = difftime(timeNow, Config::LastChecked); double timeDifferenceSeconds = difftime(timeNow, Config::LastChecked);
if (timeDifferenceSeconds > TimeBetweenUpdateChecksInSeconds) if (timeDifferenceSeconds > g_timeBetweenUpdateChecksInSeconds)
{ {
UpdateChecker::initialize(); UpdateChecker::initialize();
UpdateChecker::start(); UpdateChecker::start();
@@ -129,7 +129,9 @@ PPC_FUNC(sub_822C55B0)
void PressStartSaveLoadThreadMidAsmHook() void PressStartSaveLoadThreadMidAsmHook()
{ {
if (UpdateChecker::check() == UpdateChecker::Result::UpdateAvailable) time_t timeNow = std::time(nullptr);
double timeDifferenceSeconds = difftime(timeNow, Config::LastChecked);
if (UpdateChecker::check() == UpdateChecker::Result::UpdateAvailable && timeDifferenceSeconds > g_timeBetweenUpdateChecksInSeconds)
{ {
g_updateAvailableMessageOpen = true; g_updateAvailableMessageOpen = true;
g_updateAvailableMessageOpen.wait(true); g_updateAvailableMessageOpen.wait(true);
+3 -8
View File
@@ -1255,14 +1255,9 @@ static void DrawConfigOptions()
case 3: // VIDEO case 3: // VIDEO
{ {
auto displayModeCount = (int32_t)GameWindow::GetDisplayModes().size(); DrawConfigOption(rowCount++, yOffset, &Config::WindowSize,
auto canChangeWindowSize = !Config::Fullscreen && displayModeCount > 1; !Config::Fullscreen, &Localise("Options_Desc_NotAvailableFullscreen"),
auto windowSizeReason = &Localise("Options_Desc_NotAvailableFullscreen"); 0, 0, (int32_t)GameWindow::GetDisplayModes().size() - 1, false);
if (!Config::Fullscreen && displayModeCount <= 1)
windowSizeReason = &Localise("Options_Desc_NotAvailableHardware");
DrawConfigOption(rowCount++, yOffset, &Config::WindowSize, canChangeWindowSize, windowSizeReason, 0, 0, displayModeCount - 1, false);
auto displayCount = GameWindow::GetDisplayCount(); auto displayCount = GameWindow::GetDisplayCount();
auto canChangeMonitor = Config::Fullscreen && displayCount > 1; auto canChangeMonitor = Config::Fullscreen && displayCount > 1;