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
|
|
|
|
|
|
|
class CwCheatScreen : public UIDialogScreenWithBackground {
|
|
|
|
public:
|
2020-04-11 20:52:25 +00:00
|
|
|
CwCheatScreen(const std::string &gamePath);
|
|
|
|
~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);
|
2014-06-08 22:13:26 +00:00
|
|
|
UI::EventReturn OnEditCheatFile(UI::EventParams ¶ms);
|
2013-08-24 03:07:41 +00:00
|
|
|
UI::EventReturn OnEnableAll(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
|
|
|
|
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);
|
|
|
|
|
|
|
|
enum { INDEX_ALL = -1 };
|
|
|
|
bool RebuildCheatFile(int index);
|
|
|
|
|
|
|
|
UI::ScrollView *rightScroll_ = nullptr;
|
2020-04-11 20:52:25 +00:00
|
|
|
CWCheatEngine *engine_ = nullptr;
|
2020-04-11 19:43:55 +00:00
|
|
|
std::vector<CheatFileInfo> fileInfo_;
|
|
|
|
std::string gamePath_;
|
2020-04-11 20:52:25 +00:00
|
|
|
std::string gameID_;
|
2020-04-11 19:57:35 +00:00
|
|
|
int fileCheckCounter_ = 0;
|
|
|
|
uint64_t fileCheckHash_;
|
2020-04-11 19:43:55 +00:00
|
|
|
bool enableAllFlag_ = false;
|
2013-08-24 03:28:21 +00:00
|
|
|
};
|