2018-03-26 02:17:47 +00:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-03-26 02:17:47 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-10-03 22:17:45 +00:00
|
|
|
#include <functional>
|
2018-03-26 02:17:47 +00:00
|
|
|
#include <memory>
|
2021-08-22 05:13:00 +00:00
|
|
|
#include <optional>
|
2018-03-26 02:17:47 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
2021-08-22 05:13:00 +00:00
|
|
|
#include "Core/CheatSearch.h"
|
2023-10-28 23:30:22 +00:00
|
|
|
#include "DolphinQt/GameList/GameListModel.h"
|
|
|
|
#include "VideoCommon/VideoEvents.h"
|
2021-08-22 05:13:00 +00:00
|
|
|
|
2018-03-26 02:17:47 +00:00
|
|
|
class ARCodeWidget;
|
2021-08-22 05:13:00 +00:00
|
|
|
class GeckoCodeWidget;
|
|
|
|
class CheatSearchFactoryWidget;
|
2018-03-26 02:17:47 +00:00
|
|
|
class QDialogButtonBox;
|
2023-10-28 23:30:22 +00:00
|
|
|
class QHideEvent;
|
|
|
|
class QShowEvent;
|
2021-08-22 05:13:00 +00:00
|
|
|
class PartiallyClosableTabWidget;
|
2018-03-26 02:17:47 +00:00
|
|
|
|
|
|
|
namespace Core
|
|
|
|
{
|
|
|
|
enum class State;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CheatsManager : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-06-06 19:56:34 +00:00
|
|
|
explicit CheatsManager(QWidget* parent = nullptr);
|
2018-07-10 18:29:17 +00:00
|
|
|
~CheatsManager();
|
2018-03-26 02:17:47 +00:00
|
|
|
|
2021-09-16 04:49:03 +00:00
|
|
|
signals:
|
|
|
|
void OpenGeneralSettings();
|
2023-06-08 01:53:38 +00:00
|
|
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
|
|
|
void OpenAchievementSettings();
|
|
|
|
#endif // USE_RETRO_ACHIEVEMENTS
|
2022-05-28 00:34:47 +00:00
|
|
|
void ShowMemory(u32 address);
|
2022-12-23 07:07:17 +00:00
|
|
|
void RequestWatch(QString name, u32 address);
|
2021-09-16 04:49:03 +00:00
|
|
|
|
2023-10-28 23:30:22 +00:00
|
|
|
protected:
|
|
|
|
void hideEvent(QHideEvent* event) override;
|
|
|
|
void showEvent(QShowEvent* event) override;
|
|
|
|
|
2018-03-26 02:17:47 +00:00
|
|
|
private:
|
|
|
|
void CreateWidgets();
|
|
|
|
void ConnectWidgets();
|
|
|
|
void OnStateChanged(Core::State state);
|
2023-10-28 23:30:22 +00:00
|
|
|
void OnFrameEnd();
|
|
|
|
void RegisterAfterFrameEventCallback();
|
|
|
|
void RemoveAfterFrameEventCallback();
|
2021-08-22 05:13:00 +00:00
|
|
|
void OnNewSessionCreated(const Cheats::CheatSearchSessionBase& session);
|
|
|
|
void OnTabCloseRequested(int index);
|
2018-03-26 02:17:47 +00:00
|
|
|
|
2021-09-16 05:35:15 +00:00
|
|
|
void RefreshCodeTabs(Core::State state, bool force);
|
2023-10-28 23:30:22 +00:00
|
|
|
void UpdateAllCheatSearchWidgetCurrentValues();
|
2021-09-16 05:35:15 +00:00
|
|
|
|
2021-06-06 19:56:34 +00:00
|
|
|
std::string m_game_id;
|
|
|
|
std::string m_game_tdb_id;
|
|
|
|
u16 m_revision = 0;
|
|
|
|
|
2018-03-26 02:17:47 +00:00
|
|
|
QDialogButtonBox* m_button_box;
|
2021-08-22 05:13:00 +00:00
|
|
|
PartiallyClosableTabWidget* m_tab_widget = nullptr;
|
2018-03-26 02:17:47 +00:00
|
|
|
|
|
|
|
ARCodeWidget* m_ar_code = nullptr;
|
2021-08-22 05:13:00 +00:00
|
|
|
GeckoCodeWidget* m_gecko_code = nullptr;
|
|
|
|
CheatSearchFactoryWidget* m_cheat_search_new = nullptr;
|
2023-10-28 23:30:22 +00:00
|
|
|
|
|
|
|
Common::EventHook m_VI_end_field_event;
|
2018-03-26 02:17:47 +00:00
|
|
|
};
|