Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/UI/GameScreen.h
5665 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/BaseScreens.h"
23
#include "Common/UI/UIScreen.h"
24
#include "Common/File/Path.h"
25
#include "UI/GameInfoCache.h"
26
#include "UI/SimpleDialogScreen.h"
27
28
29
class NoticeView;
30
31
// Game screen: Allows you to start a game, delete saves, delete the game,
32
// set game specific settings, etc.
33
34
// Uses GameInfoCache heavily to implement the functionality.
35
// Should possibly merge this with the PauseScreen.
36
37
class GameScreen : public UITwoPaneBaseDialogScreen {
38
public:
39
GameScreen(const Path &gamePath, bool inGame);
40
~GameScreen();
41
42
void update() override;
43
44
const char *tag() const override { return "Game"; }
45
46
protected:
47
void CreateContentViews(UI::ViewGroup *parent) override;
48
void CreateSettingsViews(UI::ViewGroup *parent) override;
49
void CreateContextMenu(UI::ViewGroup *parent) override;
50
51
std::string_view GetTitle() const override;
52
53
private:
54
// Event handlers
55
void OnPlay(UI::EventParams &e);
56
void OnGameSettings(UI::EventParams &e);
57
void OnDeleteSaveData(UI::EventParams &e);
58
void OnDeleteGame(UI::EventParams &e);
59
void OnSwitchBack(UI::EventParams &e);
60
void OnRemoveFromRecent(UI::EventParams &e);
61
void OnCreateConfig(UI::EventParams &e);
62
void OnDeleteConfig(UI::EventParams &e);
63
void OnCwCheat(UI::EventParams &e);
64
void OnSetBackground(UI::EventParams &e);
65
66
std::string CRC32string;
67
68
bool isHomebrew_ = false;
69
bool inGame_ = false;
70
71
// Keep track of progressive loading of metadata.
72
GameInfoFlags knownFlags_ = GameInfoFlags::EMPTY;
73
74
bool knownHasCRC_ = false;
75
76
std::shared_ptr<GameInfo> info_;
77
mutable std::string titleCache_;
78
};
79
80