| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <optional> |
| 7 |
#include <string> |
| 8 |
|
| 9 |
#include <QWidget> |
| 10 |
|
| 11 |
#include "Common/CommonTypes.h" |
| 12 |
#include "VideoCommon/GraphicsModSystem/Config/GraphicsModGroup.h" |
| 13 |
|
| 14 |
class GraphicsModWarningWidget; |
| 15 |
class QHBoxLayout; |
| 16 |
class QLabel; |
| 17 |
class QListWidget; |
| 18 |
class QListWidgetItem; |
| 19 |
class QModelIndex; |
| 20 |
class QPushButton; |
| 21 |
class QVBoxLayout; |
| 22 |
|
| 23 |
namespace Core |
| 24 |
{ |
| 25 |
enum class State; |
| 26 |
} |
| 27 |
|
| 28 |
namespace UICommon |
| 29 |
{ |
| 30 |
class GameFile; |
| 31 |
} |
| 32 |
|
| 33 |
class GraphicsModListWidget : public QWidget |
| 34 |
{ |
| 35 |
Q_OBJECT |
| 36 |
public: |
| 37 |
explicit GraphicsModListWidget(const UICommon::GameFile& game); |
| 38 |
~GraphicsModListWidget() override; |
| 39 |
|
| 40 |
void SaveToDisk(); |
| 41 |
|
| 42 |
const GraphicsModGroupConfig& GetGraphicsModConfig() const; |
| 43 |
|
| 44 |
signals: |
| 45 |
void OpenGraphicsSettings(); |
| 46 |
|
| 47 |
private: |
| 48 |
void CreateWidgets(); |
| 49 |
void ConnectWidgets(); |
| 50 |
|
| 51 |
void RefreshModList(); |
| 52 |
void ModSelectionChanged(); |
| 53 |
void ModItemChanged(QListWidgetItem* item); |
| 54 |
|
| 55 |
void OnModChanged(const std::optional<std::string>& absolute_path); |
| 56 |
|
| 57 |
void SaveModList(); |
| 58 |
|
| 59 |
void OpenGraphicsModDir(); |
| 60 |
|
| 61 |
void CalculateGameRunning(Core::State state); |
| 62 |
bool m_loaded_game_is_running = false; |
| 63 |
bool m_needs_save = false; |
| 64 |
|
| 65 |
QListWidget* m_mod_list; |
| 66 |
|
| 67 |
QLabel* m_selected_mod_name; |
| 68 |
QVBoxLayout* m_mod_meta_layout; |
| 69 |
|
| 70 |
QPushButton* m_open_directory_button; |
| 71 |
QPushButton* m_refresh; |
| 72 |
GraphicsModWarningWidget* m_warning; |
| 73 |
|
| 74 |
std::string m_game_id; |
| 75 |
GraphicsModGroupConfig m_mod_group; |
| 76 |
}; |