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/GameScreen.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 <functional>
21
22
#include "UI/MiscScreens.h"
23
#include "Common/UI/UIScreen.h"
24
#include "Common/File/Path.h"
25
26
class NoticeView;
27
28
// Game screen: Allows you to start a game, delete saves, delete the game,
29
// set game specific settings, etc.
30
31
// Uses GameInfoCache heavily to implement the functionality.
32
// Should possibly merge this with the PauseScreen.
33
34
class GameScreen : public UIDialogScreenWithGameBackground {
35
public:
36
GameScreen(const Path &gamePath, bool inGame);
37
~GameScreen();
38
39
void update() override;
40
41
ScreenRenderFlags render(ScreenRenderMode mode) override;
42
43
const char *tag() const override { return "Game"; }
44
45
protected:
46
void CreateViews() override;
47
void CallbackDeleteConfig(bool yes);
48
void CallbackDeleteSaveData(bool yes);
49
void CallbackDeleteGame(bool yes);
50
bool isRecentGame(const Path &gamePath);
51
52
private:
53
UI::Choice *AddOtherChoice(UI::Choice *choice);
54
55
// Event handlers
56
UI::EventReturn OnPlay(UI::EventParams &e);
57
UI::EventReturn OnGameSettings(UI::EventParams &e);
58
UI::EventReturn OnDeleteSaveData(UI::EventParams &e);
59
UI::EventReturn OnDeleteGame(UI::EventParams &e);
60
UI::EventReturn OnSwitchBack(UI::EventParams &e);
61
UI::EventReturn OnRemoveFromRecent(UI::EventParams &e);
62
UI::EventReturn OnShowInFolder(UI::EventParams &e);
63
UI::EventReturn OnCreateConfig(UI::EventParams &e);
64
UI::EventReturn OnDeleteConfig(UI::EventParams &e);
65
UI::EventReturn OnCwCheat(UI::EventParams &e);
66
UI::EventReturn OnSetBackground(UI::EventParams &e);
67
UI::EventReturn OnDoCRC32(UI::EventParams& e);
68
69
// As we load metadata in the background, we need to be able to update these after the fact.
70
UI::TextView *tvTitle_ = nullptr;
71
UI::TextView *tvGameSize_ = nullptr;
72
UI::TextView *tvSaveDataSize_ = nullptr;
73
UI::TextView *tvInstallDataSize_ = nullptr;
74
UI::TextView *tvRegion_ = nullptr;
75
UI::TextView *tvPlayTime_ = nullptr;
76
UI::TextView *tvCRC_ = nullptr;
77
UI::TextView *tvID_ = nullptr;
78
UI::Button *tvCRCCopy_ = nullptr;
79
NoticeView *tvVerified_ = nullptr;
80
81
UI::Choice *btnGameSettings_ = nullptr;
82
UI::Choice *btnCreateGameConfig_ = nullptr;
83
UI::Choice *btnDeleteGameConfig_ = nullptr;
84
UI::Choice *btnDeleteSaveData_ = nullptr;
85
UI::Choice *btnSetBackground_ = nullptr;
86
87
UI::Choice *btnCalcCRC_ = nullptr;
88
89
std::vector<UI::Choice *> otherChoices_;
90
std::vector<Path> saveDirs;
91
std::string CRC32string;
92
93
bool isHomebrew_ = false;
94
bool inGame_ = false;
95
};
96
97