Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/UI/GameScreen.h
3185 views
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
48
private:
49
UI::Choice *AddOtherChoice(UI::Choice *choice);
50
51
// Event handlers
52
UI::EventReturn OnPlay(UI::EventParams &e);
53
UI::EventReturn OnGameSettings(UI::EventParams &e);
54
UI::EventReturn OnDeleteSaveData(UI::EventParams &e);
55
UI::EventReturn OnDeleteGame(UI::EventParams &e);
56
UI::EventReturn OnSwitchBack(UI::EventParams &e);
57
UI::EventReturn OnRemoveFromRecent(UI::EventParams &e);
58
UI::EventReturn OnCreateConfig(UI::EventParams &e);
59
UI::EventReturn OnDeleteConfig(UI::EventParams &e);
60
UI::EventReturn OnCwCheat(UI::EventParams &e);
61
UI::EventReturn OnSetBackground(UI::EventParams &e);
62
UI::EventReturn OnDoCRC32(UI::EventParams& e);
63
64
// As we load metadata in the background, we need to be able to update these after the fact.
65
UI::TextView *tvTitle_ = nullptr;
66
UI::TextView *tvGameSize_ = nullptr;
67
UI::TextView *tvSaveDataSize_ = nullptr;
68
UI::TextView *tvInstallDataSize_ = nullptr;
69
UI::TextView *tvRegion_ = nullptr;
70
UI::TextView *tvPlayTime_ = nullptr;
71
UI::TextView *tvCRC_ = nullptr;
72
UI::TextView *tvID_ = nullptr;
73
UI::Button *tvCRCCopy_ = nullptr;
74
NoticeView *tvVerified_ = nullptr;
75
76
UI::Choice *btnGameSettings_ = nullptr;
77
UI::Choice *btnCreateGameConfig_ = nullptr;
78
UI::Choice *btnDeleteGameConfig_ = nullptr;
79
UI::Choice *btnDeleteSaveData_ = nullptr;
80
UI::Choice *btnSetBackground_ = nullptr;
81
82
UI::Choice *btnCalcCRC_ = nullptr;
83
84
std::vector<UI::Choice *> otherChoices_;
85
std::string CRC32string;
86
87
bool isHomebrew_ = false;
88
bool inGame_ = false;
89
};
90
91