2013-08-24 03:28:21 +00: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/.
|
|
|
|
|
2020-04-11 19:57:35 +00:00
|
|
|
#include <cstdint>
|
2016-10-12 09:32:24 +00:00
|
|
|
#include <functional>
|
|
|
|
|
2020-10-04 18:48:47 +00:00
|
|
|
#include "Common/UI/View.h"
|
|
|
|
#include "Common/UI/UIScreen.h"
|
|
|
|
#include "Common/UI/Context.h"
|
2013-08-24 03:28:21 +00:00
|
|
|
#include "UI/MiscScreens.h"
|
2013-12-29 22:28:31 +00:00
|
|
|
|
2020-04-11 19:43:55 +00:00
|
|
|
struct CheatFileInfo;
|
2020-04-11 20:52:25 +00:00
|
|
|
class CWCheatEngine;
|
2013-08-24 03:28:21 +00:00
|
|
|
|
2022-11-22 21:53:54 +00:00
|
|
|
class CwCheatScreen : public UIDialogScreenWithGameBackground {
|
2013-08-24 03:28:21 +00:00
|
|
|
public:
|
2021-05-05 23:31:38 +00:00
|
|
|
CwCheatScreen(const Path &gamePath);
|
2020-04-11 20:52:25 +00:00
|
|
|
~CwCheatScreen();
|
2020-04-11 18:22:11 +00:00
|
|
|
|
2020-04-11 19:43:55 +00:00
|
|
|
void LoadCheatInfo();
|
2020-04-11 18:22:11 +00:00
|
|
|
|
2013-08-24 03:07:41 +00:00
|
|
|
UI::EventReturn OnAddCheat(UI::EventParams ¶ms);
|
|
|
|
UI::EventReturn OnImportCheat(UI::EventParams ¶ms);
|
2023-02-16 18:01:13 +00:00
|
|
|
UI::EventReturn OnImportBrowse(UI::EventParams ¶ms);
|
2014-06-08 22:13:26 +00:00
|
|
|
UI::EventReturn OnEditCheatFile(UI::EventParams ¶ms);
|
2023-03-23 09:32:11 +00:00
|
|
|
UI::EventReturn OnDisableAll(UI::EventParams ¶ms);
|
2013-10-23 14:10:11 +00:00
|
|
|
|
2020-04-11 19:57:35 +00:00
|
|
|
void update() override;
|
2017-12-04 01:49:49 +00:00
|
|
|
void onFinish(DialogResult result) override;
|
2020-04-11 19:43:55 +00:00
|
|
|
|
2022-09-16 08:14:00 +00:00
|
|
|
const char *tag() const override { return "CwCheat"; }
|
|
|
|
|
2013-08-24 03:28:21 +00:00
|
|
|
protected:
|
2017-12-04 01:49:49 +00:00
|
|
|
void CreateViews() override;
|
2013-08-24 03:28:21 +00:00
|
|
|
|
|
|
|
private:
|
2020-04-11 19:43:55 +00:00
|
|
|
UI::EventReturn OnCheckBox(int index);
|
2023-02-16 18:01:13 +00:00
|
|
|
bool ImportCheats(const Path &cheatFile);
|
2020-04-11 19:43:55 +00:00
|
|
|
|
|
|
|
enum { INDEX_ALL = -1 };
|
2022-08-07 02:48:00 +00:00
|
|
|
bool HasCheatWithName(const std::string &name);
|
2020-04-11 19:43:55 +00:00
|
|
|
bool RebuildCheatFile(int index);
|
|
|
|
|
|
|
|
UI::ScrollView *rightScroll_ = nullptr;
|
2023-02-16 18:01:13 +00:00
|
|
|
UI::TextView *errorMessageView_ = nullptr;
|
|
|
|
|
2020-04-11 20:52:25 +00:00
|
|
|
CWCheatEngine *engine_ = nullptr;
|
2020-04-11 19:43:55 +00:00
|
|
|
std::vector<CheatFileInfo> fileInfo_;
|
2020-04-11 20:52:25 +00:00
|
|
|
std::string gameID_;
|
2020-04-11 19:57:35 +00:00
|
|
|
int fileCheckCounter_ = 0;
|
2023-02-16 18:01:13 +00:00
|
|
|
uint64_t fileCheckHash_ = 0;
|
2020-04-11 19:43:55 +00:00
|
|
|
bool enableAllFlag_ = false;
|
2013-08-24 03:28:21 +00:00
|
|
|
};
|