GeckoCodeWidget: Take game ID and revision directly instead of through GameFile.
This commit is contained in:
parent
1fbe56210a
commit
414e0f4598
|
@ -195,7 +195,10 @@ void CheatsManager::OnStateChanged(Core::State state)
|
||||||
|
|
||||||
m_ar_code = new ARCodeWidget(m_game_file->GetGameID(), m_game_file->GetRevision(), 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"));
|
auto* gecko_code =
|
||||||
|
new GeckoCodeWidget(m_game_file->GetGameID(), m_game_file->GetGameTDBID(),
|
||||||
|
m_game_file->GetRevision(), false);
|
||||||
|
m_tab_widget->insertTab(1, gecko_code, tr("Gecko Codes"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "DolphinQt/Config/GeckoCodeWidget.h"
|
#include "DolphinQt/Config/GeckoCodeWidget.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
|
@ -28,9 +30,10 @@
|
||||||
|
|
||||||
#include "UICommon/GameFile.h"
|
#include "UICommon/GameFile.h"
|
||||||
|
|
||||||
GeckoCodeWidget::GeckoCodeWidget(const UICommon::GameFile& game, bool restart_required)
|
GeckoCodeWidget::GeckoCodeWidget(std::string game_id, std::string gametdb_id, u16 game_revision,
|
||||||
: m_game(game), m_game_id(game.GetGameID()), m_gametdb_id(game.GetGameTDBID()),
|
bool restart_required)
|
||||||
m_game_revision(game.GetRevision()), m_restart_required(restart_required)
|
: m_game_id(std::move(game_id)), m_gametdb_id(std::move(gametdb_id)),
|
||||||
|
m_game_revision(game_revision), m_restart_required(restart_required)
|
||||||
{
|
{
|
||||||
CreateWidgets();
|
CreateWidgets();
|
||||||
ConnectWidgets();
|
ConnectWidgets();
|
||||||
|
|
|
@ -23,16 +23,12 @@ namespace Gecko
|
||||||
class GeckoCode;
|
class GeckoCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace UICommon
|
|
||||||
{
|
|
||||||
class GameFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
class GeckoCodeWidget : public QWidget
|
class GeckoCodeWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit GeckoCodeWidget(const UICommon::GameFile& game, bool restart_required = true);
|
explicit GeckoCodeWidget(std::string game_id, std::string gametdb_id, u16 game_revision,
|
||||||
|
bool restart_required = true);
|
||||||
~GeckoCodeWidget() override;
|
~GeckoCodeWidget() override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -54,7 +50,6 @@ private:
|
||||||
void SaveCodes();
|
void SaveCodes();
|
||||||
void SortAlphabetically();
|
void SortAlphabetically();
|
||||||
|
|
||||||
const UICommon::GameFile& m_game;
|
|
||||||
std::string m_game_id;
|
std::string m_game_id;
|
||||||
std::string m_gametdb_id;
|
std::string m_gametdb_id;
|
||||||
u16 m_game_revision;
|
u16 m_game_revision;
|
||||||
|
|
|
@ -39,7 +39,8 @@ PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& ga
|
||||||
InfoWidget* info = new InfoWidget(game);
|
InfoWidget* info = new InfoWidget(game);
|
||||||
|
|
||||||
ARCodeWidget* ar = new ARCodeWidget(game.GetGameID(), game.GetRevision());
|
ARCodeWidget* ar = new ARCodeWidget(game.GetGameID(), game.GetRevision());
|
||||||
GeckoCodeWidget* gecko = new GeckoCodeWidget(game);
|
GeckoCodeWidget* gecko =
|
||||||
|
new GeckoCodeWidget(game.GetGameID(), game.GetGameTDBID(), game.GetRevision());
|
||||||
PatchesWidget* patches = new PatchesWidget(game);
|
PatchesWidget* patches = new PatchesWidget(game);
|
||||||
GameConfigWidget* game_config = new GameConfigWidget(game);
|
GameConfigWidget* game_config = new GameConfigWidget(game);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue