2021-09-26 04:17:51 +00:00
|
|
|
// Copyright 2021 Dolphin Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <optional>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
#include "DiscIO/RiivolutionParser.h"
|
|
|
|
|
2023-11-15 17:03:21 +00:00
|
|
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
|
|
|
class HardcoreWarningWidget;
|
|
|
|
#endif // USE_RETRO_ACHIEVEMENTS
|
2021-09-26 04:17:51 +00:00
|
|
|
class QPushButton;
|
|
|
|
class QVBoxLayout;
|
|
|
|
|
|
|
|
class RiivolutionBootWidget : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit RiivolutionBootWidget(std::string game_id, std::optional<u16> revision,
|
2021-10-26 01:18:06 +00:00
|
|
|
std::optional<u8> disc, std::string base_game_path,
|
|
|
|
QWidget* parent = nullptr);
|
2021-09-26 04:17:51 +00:00
|
|
|
~RiivolutionBootWidget();
|
|
|
|
|
|
|
|
bool ShouldBoot() const { return m_should_boot; }
|
|
|
|
std::vector<DiscIO::Riivolution::Patch>& GetPatches() { return m_patches; }
|
|
|
|
|
2023-11-15 17:03:21 +00:00
|
|
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
|
|
|
signals:
|
|
|
|
void OpenAchievementSettings();
|
|
|
|
#endif // USE_RETRO_ACHIEVEMENTS
|
|
|
|
|
2021-09-26 04:17:51 +00:00
|
|
|
private:
|
|
|
|
void CreateWidgets();
|
2023-11-15 17:03:21 +00:00
|
|
|
void ConnectWidgets();
|
2021-09-26 04:17:51 +00:00
|
|
|
|
|
|
|
void LoadMatchingXMLs();
|
|
|
|
void OpenXML();
|
2021-10-26 01:18:06 +00:00
|
|
|
void MakeGUIForParsedFile(std::string path, std::string root,
|
2021-10-16 01:23:27 +00:00
|
|
|
DiscIO::Riivolution::Disc input_disc);
|
|
|
|
std::optional<DiscIO::Riivolution::Config> LoadConfigXML(const std::string& root_directory);
|
|
|
|
void SaveConfigXMLs();
|
2021-09-26 04:17:51 +00:00
|
|
|
void BootGame();
|
2021-10-26 01:18:06 +00:00
|
|
|
void SaveAsPreset();
|
2021-09-26 04:17:51 +00:00
|
|
|
|
2023-11-15 17:03:21 +00:00
|
|
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
|
|
|
HardcoreWarningWidget* m_hc_warning;
|
|
|
|
#endif // USE_RETRO_ACHIEVEMENTS
|
2021-09-26 04:17:51 +00:00
|
|
|
std::string m_game_id;
|
|
|
|
std::optional<u16> m_revision;
|
|
|
|
std::optional<u8> m_disc_number;
|
2021-10-26 01:18:06 +00:00
|
|
|
std::string m_base_game_path;
|
2021-09-26 04:17:51 +00:00
|
|
|
|
|
|
|
bool m_should_boot = false;
|
2021-10-19 21:29:22 +00:00
|
|
|
struct DiscWithRoot
|
|
|
|
{
|
|
|
|
DiscIO::Riivolution::Disc disc;
|
|
|
|
std::string root;
|
2021-10-26 01:18:06 +00:00
|
|
|
std::string path;
|
2021-10-19 21:29:22 +00:00
|
|
|
};
|
|
|
|
std::vector<DiscWithRoot> m_discs;
|
2021-09-26 04:17:51 +00:00
|
|
|
std::vector<DiscIO::Riivolution::Patch> m_patches;
|
|
|
|
|
|
|
|
QVBoxLayout* m_patch_section_layout;
|
|
|
|
};
|