Add GFX property tabs to game properties window, allowing them to be set to the user game ini. Additionally, refactor ConfigWidgets to reduce duplication. Refactor GameConfigWidget to use config system.

Creates a layer outside the game config layer system and passes it to the created gfx widows, so as to not interfere with the global config system.

Supports multiple game properties being open at once.
Supports editing while a game is playing, but the options only save and update the active game when the window is closed.
Right-clicking will remove a property from the game ini.
This commit is contained in:
TryTwo
2024-09-17 23:29:13 -07:00
parent 08df9a66e0
commit 84a937ae65
24 changed files with 573 additions and 464 deletions

View File

@ -7,19 +7,21 @@
#include <QString>
#include <QWidget>
#include "Common/IniFile.h"
namespace UICommon
{
class GameFile;
}
class QCheckBox;
class QComboBox;
namespace Config
{
class Layer;
} // namespace Config
class ConfigBool;
class ConfigInteger;
class ConfigSlider;
class ConfigStringChoice;
class QPushButton;
class QSlider;
class QSpinBox;
class QTabWidget;
class GameConfigWidget : public QWidget
@ -27,45 +29,33 @@ class GameConfigWidget : public QWidget
Q_OBJECT
public:
explicit GameConfigWidget(const UICommon::GameFile& game);
~GameConfigWidget();
private:
void CreateWidgets();
void ConnectWidgets();
void LoadSettings();
void SaveSettings();
void SetItalics();
void SaveCheckBox(QCheckBox* checkbox, const std::string& section, const std::string& key,
bool reverse = false);
void LoadCheckBox(QCheckBox* checkbox, const std::string& section, const std::string& key,
bool reverse = false);
QString m_gameini_sys_path;
QString m_gameini_local_path;
QTabWidget* m_default_tab;
QTabWidget* m_local_tab;
QCheckBox* m_enable_dual_core;
QCheckBox* m_enable_mmu;
QCheckBox* m_enable_fprf;
QCheckBox* m_sync_gpu;
QCheckBox* m_emulate_disc_speed;
QCheckBox* m_use_dsp_hle;
QCheckBox* m_use_monoscopic_shadows;
QCheckBox* m_manual_texture_sampling;
ConfigBool* m_enable_dual_core;
ConfigBool* m_enable_mmu;
ConfigBool* m_enable_fprf;
ConfigBool* m_sync_gpu;
ConfigBool* m_emulate_disc_speed;
ConfigBool* m_use_dsp_hle;
ConfigBool* m_use_monoscopic_shadows;
QPushButton* m_refresh_config;
QComboBox* m_deterministic_dual_core;
QSlider* m_depth_slider;
QSpinBox* m_convergence_spin;
ConfigStringChoice* m_deterministic_dual_core;
ConfigSlider* m_depth_slider;
ConfigInteger* m_convergence_spin;
const UICommon::GameFile& m_game;
std::string m_game_id;
Common::IniFile m_gameini_local;
Common::IniFile m_gameini_default;
std::unique_ptr<Config::Layer> m_layer;
std::unique_ptr<Config::Layer> m_global_layer;
int m_prev_tab_index = 0;
};