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/.
|
|
|
|
|
2020-04-11 12:57:35 -07:00
|
|
|
#include <cstdint>
|
2016-10-12 11:32:24 +02:00
|
|
|
#include <functional>
|
|
|
|
|
2013-08-23 22:28:21 -05:00
|
|
|
#include "ui/view.h"
|
|
|
|
#include "ui/ui_screen.h"
|
2013-08-22 19:46:30 -05:00
|
|
|
#include "ui/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;
|
|
|
|
|
2013-08-22 21:58:37 -05:00
|
|
|
extern std::string activeCheatFile;
|
2013-08-23 22:07:41 -05:00
|
|
|
extern std::string gameTitle;
|
2013-08-23 22:28:21 -05:00
|
|
|
|
|
|
|
class CwCheatScreen : public UIDialogScreenWithBackground {
|
|
|
|
public:
|
2016-06-20 00:18:35 +02:00
|
|
|
CwCheatScreen(std::string gamePath);
|
2020-04-11 11:22:11 -07:00
|
|
|
|
2020-04-11 12:43:55 -07:00
|
|
|
void LoadCheatInfo();
|
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);
|
2014-06-09 00:13:26 +02:00
|
|
|
UI::EventReturn OnEditCheatFile(UI::EventParams ¶ms);
|
2013-08-23 22:07:41 -05:00
|
|
|
UI::EventReturn OnEnableAll(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
|
|
|
|
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);
|
|
|
|
|
|
|
|
enum { INDEX_ALL = -1 };
|
|
|
|
bool RebuildCheatFile(int index);
|
|
|
|
|
|
|
|
UI::ScrollView *rightScroll_ = nullptr;
|
|
|
|
std::vector<CheatFileInfo> fileInfo_;
|
|
|
|
std::string gamePath_;
|
2020-04-11 12:57:35 -07:00
|
|
|
int fileCheckCounter_ = 0;
|
|
|
|
uint64_t fileCheckHash_;
|
2020-04-11 12:43:55 -07:00
|
|
|
bool enableAllFlag_ = false;
|
2013-08-23 22:28:21 -05:00
|
|
|
};
|