2018-02-16 13:53:52 +00:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-02-16 13:53:52 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
2018-05-13 19:38:55 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2023-11-15 17:03:21 +00:00
|
|
|
#include "Core/PatchEngine.h"
|
2018-05-13 19:38:55 +00:00
|
|
|
|
2023-11-15 17:03:21 +00:00
|
|
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
|
|
|
class HardcoreWarningWidget;
|
|
|
|
#endif // USE_RETRO_ACHIEVEMENTS
|
2018-02-16 13:53:52 +00:00
|
|
|
class QListWidget;
|
|
|
|
class QListWidgetItem;
|
|
|
|
class QPushButton;
|
|
|
|
|
2018-05-13 19:38:55 +00:00
|
|
|
namespace UICommon
|
|
|
|
{
|
|
|
|
class GameFile;
|
|
|
|
}
|
|
|
|
|
2018-02-16 13:53:52 +00:00
|
|
|
class PatchesWidget : public QWidget
|
|
|
|
{
|
2023-11-15 17:03:21 +00:00
|
|
|
Q_OBJECT
|
2018-02-16 13:53:52 +00:00
|
|
|
public:
|
2017-12-31 19:33:36 +00:00
|
|
|
explicit PatchesWidget(const UICommon::GameFile& game);
|
2018-02-16 13:53:52 +00:00
|
|
|
|
2023-11-15 17:03:21 +00:00
|
|
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
|
|
|
signals:
|
|
|
|
void OpenAchievementSettings();
|
|
|
|
#endif // USE_RETRO_ACHIEVEMENTS
|
|
|
|
|
2018-02-16 13:53:52 +00:00
|
|
|
private:
|
|
|
|
void CreateWidgets();
|
|
|
|
void ConnectWidgets();
|
|
|
|
void SavePatches();
|
|
|
|
void Update();
|
|
|
|
void UpdateActions();
|
|
|
|
|
|
|
|
void OnItemChanged(QListWidgetItem*);
|
|
|
|
void OnAdd();
|
|
|
|
void OnRemove();
|
|
|
|
void OnEdit();
|
|
|
|
|
2023-11-15 17:03:21 +00:00
|
|
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
|
|
|
HardcoreWarningWidget* m_hc_warning;
|
|
|
|
#endif // USE_RETRO_ACHIEVEMENTS
|
2018-02-16 13:53:52 +00:00
|
|
|
QListWidget* m_list;
|
|
|
|
QPushButton* m_add_button;
|
|
|
|
QPushButton* m_edit_button;
|
|
|
|
QPushButton* m_remove_button;
|
|
|
|
|
|
|
|
std::vector<PatchEngine::Patch> m_patches;
|
|
|
|
std::string m_game_id;
|
|
|
|
u16 m_game_revision;
|
|
|
|
};
|