add configuration option to enable compatibility data

This commit is contained in:
faith 2024-12-22 15:29:59 +08:00
parent 2e5c2e03fd
commit 9a9becdce8
4 changed files with 35 additions and 3 deletions

View File

@ -64,6 +64,8 @@ static bool vkCrashDiagnostic = false;
static s16 cursorState = HideCursorState::Idle; static s16 cursorState = HideCursorState::Idle;
static int cursorHideTimeout = 5; // 5 seconds (default) static int cursorHideTimeout = 5; // 5 seconds (default)
static bool separateupdatefolder = false; static bool separateupdatefolder = false;
static bool compatibilityData = false;
static bool checkCompatibilityOnStartup = false;
// Gui // Gui
std::vector<std::filesystem::path> settings_install_dirs = {}; std::vector<std::filesystem::path> settings_install_dirs = {};
@ -224,6 +226,14 @@ bool getSeparateUpdateEnabled() {
return separateupdatefolder; return separateupdatefolder;
} }
bool getCompatibilityEnabled() {
return compatibilityData;
}
bool getCheckCompatibilityOnStartup() {
return checkCompatibilityOnStartup;
}
void setGpuId(s32 selectedGpuId) { void setGpuId(s32 selectedGpuId) {
gpuId = selectedGpuId; gpuId = selectedGpuId;
} }
@ -344,6 +354,14 @@ void setSeparateUpdateEnabled(bool use) {
separateupdatefolder = use; separateupdatefolder = use;
} }
void setCompatibilityEnabled(bool use) {
compatibilityData = use;
}
void setCheckCompatibilityOnStartup(bool use) {
checkCompatibilityOnStartup = use;
}
void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h) { void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h) {
main_window_geometry_x = x; main_window_geometry_x = x;
main_window_geometry_y = y; main_window_geometry_y = y;
@ -544,6 +562,8 @@ void load(const std::filesystem::path& path) {
isShowSplash = toml::find_or<bool>(general, "showSplash", true); isShowSplash = toml::find_or<bool>(general, "showSplash", true);
isAutoUpdate = toml::find_or<bool>(general, "autoUpdate", false); isAutoUpdate = toml::find_or<bool>(general, "autoUpdate", false);
separateupdatefolder = toml::find_or<bool>(general, "separateUpdateEnabled", false); separateupdatefolder = toml::find_or<bool>(general, "separateUpdateEnabled", false);
compatibilityData = toml::find_or<bool>(general, "compatibilityEnabled", false);
checkCompatibilityOnStartup = toml::find_or<bool>(general, "checkCompatibilityOnStartup", false);
} }
if (data.contains("Input")) { if (data.contains("Input")) {
@ -656,6 +676,8 @@ void save(const std::filesystem::path& path) {
data["General"]["showSplash"] = isShowSplash; data["General"]["showSplash"] = isShowSplash;
data["General"]["autoUpdate"] = isAutoUpdate; data["General"]["autoUpdate"] = isAutoUpdate;
data["General"]["separateUpdateEnabled"] = separateupdatefolder; data["General"]["separateUpdateEnabled"] = separateupdatefolder;
data["General"]["compatibilityEnabled"] = compatibilityData;
data["General"]["checkCompatibilityOnStartup"] = checkCompatibilityOnStartup;
data["Input"]["cursorState"] = cursorState; data["Input"]["cursorState"] = cursorState;
data["Input"]["cursorHideTimeout"] = cursorHideTimeout; data["Input"]["cursorHideTimeout"] = cursorHideTimeout;
data["Input"]["backButtonBehavior"] = backButtonBehavior; data["Input"]["backButtonBehavior"] = backButtonBehavior;
@ -775,6 +797,8 @@ void setDefaultValues() {
m_language = 1; m_language = 1;
gpuId = -1; gpuId = -1;
separateupdatefolder = false; separateupdatefolder = false;
compatibilityData = false;
checkCompatibilityOnStartup = false;
} }
} // namespace Config } // namespace Config

View File

@ -21,6 +21,8 @@ bool getPlayBGM();
int getBGMvolume(); int getBGMvolume();
bool getEnableDiscordRPC(); bool getEnableDiscordRPC();
bool getSeparateUpdateEnabled(); bool getSeparateUpdateEnabled();
bool getCompatibilityEnabled();
bool getCheckCompatibilityOnStartup();
std::string getLogFilter(); std::string getLogFilter();
std::string getLogType(); std::string getLogType();
@ -69,6 +71,8 @@ void setUserName(const std::string& type);
void setUpdateChannel(const std::string& type); void setUpdateChannel(const std::string& type);
void setSeparateUpdateEnabled(bool use); void setSeparateUpdateEnabled(bool use);
void setGameInstallDirs(const std::vector<std::filesystem::path>& settings_install_dirs_config); void setGameInstallDirs(const std::vector<std::filesystem::path>& settings_install_dirs_config);
void setCompatibilityEnabled(bool use);
void setCheckCompatibilityOnStartup(bool use);
void setCursorState(s16 cursorState); void setCursorState(s16 cursorState);
void setCursorHideTimeout(int newcursorHideTimeout); void setCursorHideTimeout(int newcursorHideTimeout);

View File

@ -81,8 +81,10 @@ GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get,
} }
}); });
// Disable status column for now // Do not show status column if it is not enabled
if (!Config::getCompatibilityEnabled()) {
this->setColumnHidden(2, true); this->setColumnHidden(2, true);
}
} }
void GameListFrame::onCurrentCellChanged(int currentRow, int currentColumn, int previousRow, void GameListFrame::onCurrentCellChanged(int currentRow, int currentColumn, int previousRow,

View File

@ -185,7 +185,9 @@ void MainWindow::CreateDockWindows() {
void MainWindow::LoadGameLists() { void MainWindow::LoadGameLists() {
// Update compatibility database // Update compatibility database
// m_compat_info->UpdateCompatibilityDatabase(this); if (Config::getCheckCompatibilityOnStartup()) {
m_compat_info->UpdateCompatibilityDatabase(this);
}
// Get game info from game folders. // Get game info from game folders.
m_game_info->GetGameInfo(this); m_game_info->GetGameInfo(this);
if (isTableList) { if (isTableList) {