CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/UI/CwCheatScreen.h
Views: 1401
1
// Copyright (c) 2013- PPSSPP Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#pragma once
19
20
#include <cstdint>
21
#include <functional>
22
23
#include "Common/UI/View.h"
24
#include "Common/UI/UIScreen.h"
25
#include "Common/UI/Context.h"
26
#include "UI/MiscScreens.h"
27
28
struct CheatFileInfo;
29
class CWCheatEngine;
30
31
class CwCheatScreen : public UIDialogScreenWithGameBackground {
32
public:
33
CwCheatScreen(const Path &gamePath);
34
~CwCheatScreen();
35
36
bool TryLoadCheatInfo();
37
38
UI::EventReturn OnAddCheat(UI::EventParams &params);
39
UI::EventReturn OnImportCheat(UI::EventParams &params);
40
UI::EventReturn OnImportBrowse(UI::EventParams &params);
41
UI::EventReturn OnEditCheatFile(UI::EventParams &params);
42
UI::EventReturn OnDisableAll(UI::EventParams &params);
43
44
void update() override;
45
void onFinish(DialogResult result) override;
46
47
const char *tag() const override { return "CwCheat"; }
48
49
protected:
50
void CreateViews() override;
51
52
private:
53
UI::EventReturn OnCheckBox(int index);
54
bool ImportCheats(const Path &cheatFile);
55
56
enum { INDEX_ALL = -1 };
57
bool HasCheatWithName(const std::string &name);
58
bool RebuildCheatFile(int index);
59
60
UI::ScrollView *rightScroll_ = nullptr;
61
UI::TextView *errorMessageView_ = nullptr;
62
63
CWCheatEngine *engine_ = nullptr;
64
std::vector<CheatFileInfo> fileInfo_;
65
std::string gameID_;
66
int fileCheckCounter_ = 0;
67
uint64_t fileCheckHash_ = 0;
68
bool enableAllFlag_ = false;
69
};
70
71