mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-01 15:02:40 +00:00
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.
57 lines
1.2 KiB
C++
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
|