Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/UI/CustomButtonMappingScreen.h
5664 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 "UI/BaseScreens.h"
21
#include "UI/GamepadEmu.h"
22
#include "UI/SimpleDialogScreen.h"
23
24
namespace UI {
25
class CheckBox;
26
}
27
28
class CustomButtonMappingScreen : public UISimpleBaseDialogScreen {
29
public:
30
CustomButtonMappingScreen(DeviceOrientation deviceOrientation, const Path &gamePath, int id) : UISimpleBaseDialogScreen(gamePath, SimpleDialogFlags::Default), deviceOrientation_(deviceOrientation), id_(id) {}
31
32
const char *tag() const override { return "CustomButton"; }
33
34
void CreateDialogViews(UI::ViewGroup *parent) override;
35
void onFinish(DialogResult result) override;
36
37
protected:
38
void dialogFinished(const Screen *dialog, DialogResult result) override;
39
std::string_view GetTitle() const override;
40
41
private:
42
void saveArray();
43
44
bool array[ARRAY_SIZE(CustomKeyData::g_customKeyList)]{};
45
int id_;
46
47
class ChoiceEventHandler{
48
public:
49
ChoiceEventHandler(UI::CheckBox *checkbox) : checkbox_(checkbox) {}
50
void onChoiceClick(UI::EventParams &e);
51
private:
52
UI::CheckBox *checkbox_;
53
};
54
55
DeviceOrientation deviceOrientation_;
56
};
57
58