shadPS4/src/qt_gui/cheats_patches.h
DanielSvoboda 61fb15b7d5 separate files
The code has been separated into separate files as suggested by georgemoralis.
Added the Patch tab, which has not been implemented yet.
Added the 'applyCheat' area to apply the modification, not implemented yet...
And added LOG_INFO.
2024-08-20 16:24:37 -03:00

57 lines
1.2 KiB
C++

#ifndef CHEATS_PATCHES_H
#define CHEATS_PATCHES_H
#include <QCheckBox>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QMap>
#include <QPixmap>
#include <QPushButton>
#include <QString>
#include <QVBoxLayout>
#include <QVector>
#include <QWidget>
class CheatsPatches : public QWidget {
Q_OBJECT
public:
CheatsPatches(const QString& gameName, const QString& gameSerial, const QString& gameVersion,
const QString& gameSize, const QPixmap& gameImage, QWidget* parent = nullptr);
~CheatsPatches();
private:
void setupUI();
void loadCheats(const QString& filePath);
void addMods(const QJsonArray& modsArray);
void applyCheat(const QString& modName, bool enabled);
struct MemoryMod {
QString offset;
QString on;
QString off;
};
struct Cheat {
QString name;
QString type;
QVector<MemoryMod> memoryMods;
};
QString m_gameName;
QString m_gameSerial;
QString m_gameVersion;
QString m_gameSize;
QPixmap m_gameImage;
QString m_cheatFilePath;
QVBoxLayout* rightLayout;
QString checkBoxStyle;
QString buttonStyle;
QMap<QString, Cheat> m_cheats;
};
#endif // CHEATS_PATCHES_H