ARCodeWidget: Take game ID and revision directly instead of through GameFile.

This commit is contained in:
Admiral H. Curtiss 2021-06-06 21:18:02 +02:00
parent 684d09b342
commit 1fbe56210a
4 changed files with 7 additions and 11 deletions

View File

@ -193,7 +193,7 @@ void CheatsManager::OnStateChanged(Core::State state)
if (m_ar_code) if (m_ar_code)
m_ar_code->deleteLater(); m_ar_code->deleteLater();
m_ar_code = new ARCodeWidget(*m_game_file, false); m_ar_code = new ARCodeWidget(m_game_file->GetGameID(), m_game_file->GetRevision(), false);
m_tab_widget->insertTab(0, m_ar_code, tr("AR Code")); m_tab_widget->insertTab(0, m_ar_code, tr("AR Code"));
m_tab_widget->insertTab(1, new GeckoCodeWidget(*m_game_file, false), tr("Gecko Codes")); m_tab_widget->insertTab(1, new GeckoCodeWidget(*m_game_file, false), tr("Gecko Codes"));
} }

View File

@ -4,6 +4,8 @@
#include "DolphinQt/Config/ARCodeWidget.h" #include "DolphinQt/Config/ARCodeWidget.h"
#include <utility>
#include <QButtonGroup> #include <QButtonGroup>
#include <QCursor> #include <QCursor>
#include <QHBoxLayout> #include <QHBoxLayout>
@ -23,8 +25,8 @@
#include "UICommon/GameFile.h" #include "UICommon/GameFile.h"
ARCodeWidget::ARCodeWidget(const UICommon::GameFile& game, bool restart_required) ARCodeWidget::ARCodeWidget(std::string game_id, u16 game_revision, bool restart_required)
: m_game(game), m_game_id(game.GetGameID()), m_game_revision(game.GetRevision()), : m_game_id(std::move(game_id)), m_game_revision(game_revision),
m_restart_required(restart_required) m_restart_required(restart_required)
{ {
CreateWidgets(); CreateWidgets();

View File

@ -16,11 +16,6 @@ namespace ActionReplay
struct ARCode; struct ARCode;
} }
namespace UICommon
{
class GameFile;
}
class CheatWarningWidget; class CheatWarningWidget;
class QLabel; class QLabel;
class QListWidget; class QListWidget;
@ -31,7 +26,7 @@ class ARCodeWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ARCodeWidget(const UICommon::GameFile& game, bool restart_required = true); explicit ARCodeWidget(std::string game_id, u16 game_revision, bool restart_required = true);
~ARCodeWidget() override; ~ARCodeWidget() override;
void AddCode(ActionReplay::ARCode code); void AddCode(ActionReplay::ARCode code);
@ -56,7 +51,6 @@ private:
void OnListReordered(); void OnListReordered();
const UICommon::GameFile& m_game;
std::string m_game_id; std::string m_game_id;
u16 m_game_revision; u16 m_game_revision;

View File

@ -38,7 +38,7 @@ PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& ga
QTabWidget* tab_widget = new QTabWidget(this); QTabWidget* tab_widget = new QTabWidget(this);
InfoWidget* info = new InfoWidget(game); InfoWidget* info = new InfoWidget(game);
ARCodeWidget* ar = new ARCodeWidget(game); ARCodeWidget* ar = new ARCodeWidget(game.GetGameID(), game.GetRevision());
GeckoCodeWidget* gecko = new GeckoCodeWidget(game); GeckoCodeWidget* gecko = new GeckoCodeWidget(game);
PatchesWidget* patches = new PatchesWidget(game); PatchesWidget* patches = new PatchesWidget(game);
GameConfigWidget* game_config = new GameConfigWidget(game); GameConfigWidget* game_config = new GameConfigWidget(game);