| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <optional> |
| 7 |
#include <string> |
| 8 |
|
| 9 |
#include <QDialog> |
| 10 |
|
| 11 |
#include "Common/CommonTypes.h" |
| 12 |
#include "DiscIO/RiivolutionParser.h" |
| 13 |
|
| 14 |
#ifdef USE_RETRO_ACHIEVEMENTS |
| 15 |
class HardcoreWarningWidget; |
| 16 |
#endif |
| 17 |
class QPushButton; |
| 18 |
class QVBoxLayout; |
| 19 |
|
| 20 |
class RiivolutionBootWidget : public QDialog |
| 21 |
{ |
| 22 |
Q_OBJECT |
| 23 |
public: |
| 24 |
explicit RiivolutionBootWidget(std::string game_id, std::optional<u16> revision, |
| 25 |
std::optional<u8> disc, std::string base_game_path, |
| 26 |
QWidget* parent = nullptr); |
| 27 |
~RiivolutionBootWidget() override; |
| 28 |
|
| 29 |
bool ShouldBoot() const { return m_should_boot; } |
| 30 |
std::vector<DiscIO::Riivolution::Patch>& GetPatches() { return m_patches; } |
| 31 |
|
| 32 |
#ifdef USE_RETRO_ACHIEVEMENTS |
| 33 |
signals: |
| 34 |
void OpenAchievementSettings(); |
| 35 |
#endif |
| 36 |
|
| 37 |
private: |
| 38 |
void CreateWidgets(); |
| 39 |
void ConnectWidgets(); |
| 40 |
|
| 41 |
void LoadMatchingXMLs(); |
| 42 |
void OpenXML(); |
| 43 |
void MakeGUIForParsedFile(std::string path, std::string root, |
| 44 |
DiscIO::Riivolution::Disc input_disc); |
| 45 |
std::optional<DiscIO::Riivolution::Config> LoadConfigXML(const std::string& root_directory); |
| 46 |
void SaveConfigXMLs(); |
| 47 |
void BootGame(); |
| 48 |
void SaveAsPreset(); |
| 49 |
|
| 50 |
#ifdef USE_RETRO_ACHIEVEMENTS |
| 51 |
HardcoreWarningWidget* m_hc_warning; |
| 52 |
#endif |
| 53 |
std::string m_game_id; |
| 54 |
std::optional<u16> m_revision; |
| 55 |
std::optional<u8> m_disc_number; |
| 56 |
std::string m_base_game_path; |
| 57 |
|
| 58 |
bool m_should_boot = false; |
| 59 |
struct DiscWithRoot |
| 60 |
{ |
| 61 |
DiscIO::Riivolution::Disc disc; |
| 62 |
std::string root; |
| 63 |
std::string path; |
| 64 |
}; |
| 65 |
std::vector<DiscWithRoot> m_discs; |
| 66 |
std::vector<DiscIO::Riivolution::Patch> m_patches; |
| 67 |
|
| 68 |
QVBoxLayout* m_patch_section_layout; |
| 69 |
}; |