2013-08-23 22:28:21 -05:00
|
|
|
// Copyright (c) 2013- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
2023-09-07 17:14:07 -07:00
|
|
|
#pragma once
|
|
|
|
|
2020-04-11 12:57:35 -07:00
|
|
|
#include <cstdint>
|
2016-10-12 11:32:24 +02:00
|
|
|
#include <functional>
|
|
|
|
|
2020-10-04 20:48:47 +02:00
|
|
|
#include "Common/UI/View.h"
|
|
|
|
#include "Common/UI/UIScreen.h"
|
|
|
|
#include "Common/UI/Context.h"
|
2013-08-23 22:28:21 -05:00
|
|
|
#include "UI/MiscScreens.h"
|
2013-12-29 23:28:31 +01:00
|
|
|
|
2020-04-11 12:43:55 -07:00
|
|
|
struct CheatFileInfo;
|
2020-04-11 13:52:25 -07:00
|
|
|
class CWCheatEngine;
|
2013-08-23 22:28:21 -05:00
|
|
|
|
2022-11-22 22:53:54 +01:00
|
|
|
class CwCheatScreen : public UIDialogScreenWithGameBackground {
|
2013-08-23 22:28:21 -05:00
|
|
|
public:
|
2021-05-06 01:31:38 +02:00
|
|
|
CwCheatScreen(const Path &gamePath);
|
2020-04-11 13:52:25 -07:00
|
|
|
~CwCheatScreen();
|
2020-04-11 11:22:11 -07:00
|
|
|
|
2024-01-20 20:07:38 +01:00
|
|
|
bool TryLoadCheatInfo();
|
2020-04-11 11:22:11 -07:00
|
|
|
|
2013-08-23 22:07:41 -05:00
|
|
|
UI::EventReturn OnAddCheat(UI::EventParams ¶ms);
|
|
|
|
UI::EventReturn OnImportCheat(UI::EventParams ¶ms);
|
2023-02-16 19:01:13 +01:00
|
|
|
UI::EventReturn OnImportBrowse(UI::EventParams ¶ms);
|
2014-06-09 00:13:26 +02:00
|
|
|
UI::EventReturn OnEditCheatFile(UI::EventParams ¶ms);
|
2023-03-23 10:32:11 +01:00
|
|
|
UI::EventReturn OnDisableAll(UI::EventParams ¶ms);
|
2013-10-23 16:10:11 +02:00
|
|
|
|
2020-04-11 12:57:35 -07:00
|
|
|
void update() override;
|
2017-12-03 17:49:49 -08:00
|
|
|
void onFinish(DialogResult result) override;
|
2020-04-11 12:43:55 -07:00
|
|
|
|
2022-09-16 10:14:00 +02:00
|
|
|
const char *tag() const override { return "CwCheat"; }
|
|
|
|
|
2013-08-23 22:28:21 -05:00
|
|
|
protected:
|
2017-12-03 17:49:49 -08:00
|
|
|
void CreateViews() override;
|
2013-08-23 22:28:21 -05:00
|
|
|
|
|
|
|
private:
|
2020-04-11 12:43:55 -07:00
|
|
|
UI::EventReturn OnCheckBox(int index);
|
2023-02-16 19:01:13 +01:00
|
|
|
bool ImportCheats(const Path &cheatFile);
|
2020-04-11 12:43:55 -07:00
|
|
|
|
|
|
|
enum { INDEX_ALL = -1 };
|
2022-08-07 12:48:00 +10:00
|
|
|
bool HasCheatWithName(const std::string &name);
|
2020-04-11 12:43:55 -07:00
|
|
|
bool RebuildCheatFile(int index);
|
|
|
|
|
|
|
|
UI::ScrollView *rightScroll_ = nullptr;
|
2023-02-16 19:01:13 +01:00
|
|
|
UI::TextView *errorMessageView_ = nullptr;
|
|
|
|
|
2020-04-11 13:52:25 -07:00
|
|
|
CWCheatEngine *engine_ = nullptr;
|
2020-04-11 12:43:55 -07:00
|
|
|
std::vector<CheatFileInfo> fileInfo_;
|
2020-04-11 13:52:25 -07:00
|
|
|
std::string gameID_;
|
2020-04-11 12:57:35 -07:00
|
|
|
int fileCheckCounter_ = 0;
|
2023-02-16 19:01:13 +01:00
|
|
|
uint64_t fileCheckHash_ = 0;
|
2020-04-11 12:43:55 -07:00
|
|
|
bool enableAllFlag_ = false;
|
2013-08-23 22:28:21 -05:00
|
|
|
};
|