mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 08:52:36 +00:00
Add show game size toggle
This commit is contained in:
parent
82cb298c5c
commit
e05a6afa98
@ -72,6 +72,7 @@ static bool checkCompatibilityOnStartup = false;
|
||||
static std::string trophyKey;
|
||||
|
||||
// Gui
|
||||
static bool load_game_size = true;
|
||||
std::vector<std::filesystem::path> settings_install_dirs = {};
|
||||
std::filesystem::path settings_addon_install_dir = {};
|
||||
u32 main_window_geometry_x = 400;
|
||||
@ -102,6 +103,14 @@ void setTrophyKey(std::string key) {
|
||||
trophyKey = key;
|
||||
}
|
||||
|
||||
bool GetLoadGameSizeEnabled() {
|
||||
return load_game_size;
|
||||
}
|
||||
|
||||
void setLoadGameSizeEnabled(bool enable) {
|
||||
load_game_size = enable;
|
||||
}
|
||||
|
||||
bool isNeoModeConsole() {
|
||||
return isNeo;
|
||||
}
|
||||
@ -650,6 +659,7 @@ void load(const std::filesystem::path& path) {
|
||||
if (data.contains("GUI")) {
|
||||
const toml::value& gui = data.at("GUI");
|
||||
|
||||
load_game_size = toml::find_or<bool>(gui, "loadGameSizeEnabled", true);
|
||||
m_icon_size = toml::find_or<int>(gui, "iconSize", 0);
|
||||
m_icon_size_grid = toml::find_or<int>(gui, "iconSizeGrid", 0);
|
||||
m_slider_pos = toml::find_or<int>(gui, "sliderPos", 0);
|
||||
@ -755,6 +765,7 @@ void save(const std::filesystem::path& path) {
|
||||
install_dirs.emplace_back(std::string{fmt::UTF(dirString.u8string()).data});
|
||||
}
|
||||
data["GUI"]["installDirs"] = install_dirs;
|
||||
data["GUI"]["loadGameSizeEnabled"] = load_game_size;
|
||||
|
||||
data["GUI"]["addonInstallDir"] =
|
||||
std::string{fmt::UTF(settings_addon_install_dir.u8string()).data};
|
||||
|
@ -17,6 +17,8 @@ void saveMainWindow(const std::filesystem::path& path);
|
||||
|
||||
std::string getTrophyKey();
|
||||
void setTrophyKey(std::string key);
|
||||
bool GetLoadGameSizeEnabled();
|
||||
void setLoadGameSizeEnabled(bool enable);
|
||||
bool getIsFullscreen();
|
||||
std::string getFullscreenMode();
|
||||
bool isNeoModeConsole();
|
||||
|
@ -106,6 +106,8 @@ void GameListFrame::PlayBackgroundMusic(QTableWidgetItem* item) {
|
||||
void GameListFrame::PopulateGameList() {
|
||||
// Do not show status column if it is not enabled
|
||||
this->setColumnHidden(2, !Config::getCompatibilityEnabled());
|
||||
this->setColumnHidden(6, !Config::GetLoadGameSizeEnabled());
|
||||
|
||||
this->setRowCount(m_game_info->m_games.size());
|
||||
ResizeIcons(icon_size);
|
||||
|
||||
|
@ -62,6 +62,10 @@ public:
|
||||
QDir dir(dirPath);
|
||||
QDirIterator it(dir.absolutePath(), QDirIterator::Subdirectories);
|
||||
qint64 total = 0;
|
||||
if (!Config::GetLoadGameSizeEnabled()) {
|
||||
game.size = FormatSize(0).toStdString();
|
||||
return;
|
||||
}
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
total += it.fileInfo().size();
|
||||
|
@ -315,6 +315,7 @@ void SettingsDialog::LoadValuesFromConfig() {
|
||||
toml::find_or<std::string>(data, "General", "FullscreenMode", "Borderless")));
|
||||
ui->separateUpdatesCheckBox->setChecked(
|
||||
toml::find_or<bool>(data, "General", "separateUpdateEnabled", false));
|
||||
ui->gameSizeCheckBox->setChecked(toml::find_or<bool>(data, "GUI", "loadGameSizeEnabled", true));
|
||||
ui->showSplashCheckBox->setChecked(toml::find_or<bool>(data, "General", "showSplash", false));
|
||||
ui->logTypeComboBox->setCurrentText(
|
||||
QString::fromStdString(toml::find_or<std::string>(data, "General", "logType", "async")));
|
||||
@ -568,6 +569,7 @@ void SettingsDialog::UpdateSettings() {
|
||||
Config::setDumpShaders(ui->dumpShadersCheckBox->isChecked());
|
||||
Config::setNullGpu(ui->nullGpuCheckBox->isChecked());
|
||||
Config::setSeparateUpdateEnabled(ui->separateUpdatesCheckBox->isChecked());
|
||||
Config::setLoadGameSizeEnabled(ui->gameSizeCheckBox->isChecked());
|
||||
Config::setShowSplash(ui->showSplashCheckBox->isChecked());
|
||||
Config::setDebugDump(ui->debugDump->isChecked());
|
||||
Config::setVkValidation(ui->vkValidationCheckBox->isChecked());
|
||||
|
@ -170,6 +170,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="gameSizeCheckBox">
|
||||
<property name="text">
|
||||
<string>Show Game Size In List</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showSplashCheckBox">
|
||||
<property name="text">
|
||||
|
Loading…
Reference in New Issue
Block a user