Added CheckForUpdate ini option

This commit is contained in:
cdozdil
2025-09-23 16:17:05 +03:00
parent 057133db75
commit c110b6396c
4 changed files with 26 additions and 3 deletions
+4
View File
@@ -1020,6 +1020,10 @@ MipmapBiasOverrideAll=auto
; -------------------------------------------------------
[Hotfix]
; -------------------------------------------------------
; Enables checking for latest version from Github
; true or false - Default (auto) is true
CheckForUpdate=auto
; Enables blocking of Steam and Epic overlays
; true or false - Default (auto) is false
DisableOverlays=auto
+8
View File
@@ -415,6 +415,8 @@ bool Config::Reload(std::filesystem::path iniPath)
if (AnisotropyOverride.has_value() && (AnisotropyOverride.value() > 16 || AnisotropyOverride.value() < 1))
AnisotropyOverride.reset();
CheckForUpdate.set_from_config(readBool("Hotfix", "CheckForUpdate"));
DisableOverlays.set_from_config(readBool("Hotfix", "DisableOverlays"));
AnisotropySkipPointFilter.set_from_config(readBool("Anisotropy", "SkipPointFilter"));
AnisotropyModifyComp.set_from_config(readBool("Anisotropy", "AFModifyComparison"));
@@ -933,6 +935,12 @@ bool Config::SaveIni()
ini.SetValue("Anisotropy", "SkipPointFilter",
GetBoolValue(Instance()->AnisotropySkipPointFilter.value_for_config()).c_str());
}
ini.SetValue("Hotfix", "CheckForUpdate",
Instance()->CheckForUpdate.has_value() ? (Instance()->CheckForUpdate.value() ? "true" : "false")
: "auto");
ini.SetValue("Hotfix", "DisableOverlays",
Instance()->DisableOverlays.has_value() ? (Instance()->DisableOverlays.value() ? "true" : "false")
: "auto");
// Mipmap
{
+1
View File
@@ -267,6 +267,7 @@ class Config
CustomOptional<float> QualityRatio_UltraPerformance { 3.0f };
// Hotfixes
CustomOptional<bool> CheckForUpdate { true };
CustomOptional<bool> DisableOverlays { false };
CustomOptional<float, NoDefault> MipmapBiasOverride; // disabled by default
+13 -3
View File
@@ -945,7 +945,8 @@ static void CheckWorkingMode()
LOG_ERROR("Failed to load igdext64.dll");
}
VersionCheck::Start();
if (Config::Instance()->CheckForUpdate.value_or_default())
VersionCheck::Start();
}
return;
@@ -1144,8 +1145,8 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
spdlog::warn("Nexus : https://www.nexusmods.com/site/mods/986");
spdlog::warn("If you paid for these files, you've been scammed!");
spdlog::warn("DO NOT USE IN MULTIPLAYER GAMES");
spdlog::warn("");
spdlog::warn("LogLevel: {0}", Config::Instance()->LogLevel.value_or_default());
spdlog::info("");
spdlog::info("LogLevel: {0}", Config::Instance()->LogLevel.value_or_default());
spdlog::info("");
if (Util::GetRealWindowsVersion(winVer))
@@ -1159,6 +1160,15 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
spdlog::info("Config parameters:");
for (const std::string& l : Config::Instance()->GetConfigLog())
spdlog::info(l);
#ifdef VER_PRE_RELEASE
spdlog::info("Pre-release build, disabling update checks");
Config::Instance()->CheckForUpdate.set_volatile_value(false);
#endif
// OptiFG & Overlay Checks
if (Config::Instance()->FGType.value_or_default() == FGType::OptiFG &&
!Config::Instance()->DisableOverlays.has_value())
Config::Instance()->DisableOverlays.set_volatile_value(true);
// Initial state of FG
State::Instance().activeFgInput = Config::Instance()->FGInput.value_or_default();