mirror of
https://github.com/hedge-dev/UnleashedRecomp
synced 2026-06-08 20:30:02 -04:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 12f2e6a42a |
@@ -1,8 +1,5 @@
|
|||||||
#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
|
||||||
|
|||||||
@@ -307,11 +307,11 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Check the time since the last time an update was checked.
|
// Check the time since the last time an update was checked. Store the new time if the difference is more than six hours.
|
||||||
// Store the new time if the difference is more than g_timeBetweenUpdateChecksInSeconds hours.
|
constexpr double TimeBetweenUpdateChecksInSeconds = 6 * 60 * 60;
|
||||||
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 > g_timeBetweenUpdateChecksInSeconds)
|
if (timeDifferenceSeconds > TimeBetweenUpdateChecksInSeconds)
|
||||||
{
|
{
|
||||||
UpdateChecker::initialize();
|
UpdateChecker::initialize();
|
||||||
UpdateChecker::start();
|
UpdateChecker::start();
|
||||||
|
|||||||
@@ -129,9 +129,7 @@ PPC_FUNC(sub_822C55B0)
|
|||||||
|
|
||||||
void PressStartSaveLoadThreadMidAsmHook()
|
void PressStartSaveLoadThreadMidAsmHook()
|
||||||
{
|
{
|
||||||
time_t timeNow = std::time(nullptr);
|
if (UpdateChecker::check() == UpdateChecker::Result::UpdateAvailable)
|
||||||
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);
|
||||||
|
|||||||
@@ -1255,9 +1255,14 @@ static void DrawConfigOptions()
|
|||||||
|
|
||||||
case 3: // VIDEO
|
case 3: // VIDEO
|
||||||
{
|
{
|
||||||
DrawConfigOption(rowCount++, yOffset, &Config::WindowSize,
|
auto displayModeCount = (int32_t)GameWindow::GetDisplayModes().size();
|
||||||
!Config::Fullscreen, &Localise("Options_Desc_NotAvailableFullscreen"),
|
auto canChangeWindowSize = !Config::Fullscreen && displayModeCount > 1;
|
||||||
0, 0, (int32_t)GameWindow::GetDisplayModes().size() - 1, false);
|
auto windowSizeReason = &Localise("Options_Desc_NotAvailableFullscreen");
|
||||||
|
|
||||||
|
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user