2013-08-16 14:48:43 +00:00
|
|
|
// Copyright (c) 2013- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
2013-09-07 15:29:44 +00:00
|
|
|
#pragma once
|
|
|
|
|
2013-08-17 08:34:38 +00:00
|
|
|
#include "base/functional.h"
|
2013-08-16 14:48:43 +00:00
|
|
|
#include "ui/view.h"
|
|
|
|
#include "ui/ui_screen.h"
|
|
|
|
|
2013-08-17 08:34:38 +00:00
|
|
|
#include "UI/MiscScreens.h"
|
|
|
|
|
2013-08-17 10:09:50 +00:00
|
|
|
class ControlMappingScreen : public UIDialogScreenWithBackground {
|
2013-08-16 14:48:43 +00:00
|
|
|
public:
|
2013-08-17 08:34:38 +00:00
|
|
|
ControlMappingScreen() {}
|
|
|
|
protected:
|
|
|
|
virtual void CreateViews();
|
2013-09-14 05:53:28 +00:00
|
|
|
virtual void sendMessage(const char *message, const char *value);
|
2013-08-17 08:34:38 +00:00
|
|
|
|
|
|
|
private:
|
2013-08-17 22:41:19 +00:00
|
|
|
UI::EventReturn OnDefaultMapping(UI::EventParams ¶ms);
|
2013-08-17 08:34:38 +00:00
|
|
|
UI::EventReturn OnClearMapping(UI::EventParams ¶ms);
|
2014-05-19 21:29:35 +00:00
|
|
|
UI::EventReturn OnAutoConfigure(UI::EventParams ¶ms);
|
|
|
|
|
|
|
|
virtual void dialogFinished(const Screen *dialog, DialogResult result) override;
|
2013-08-16 14:48:43 +00:00
|
|
|
};
|
|
|
|
|
2013-08-16 15:16:11 +00:00
|
|
|
class KeyMappingNewKeyDialog : public PopupScreen {
|
2013-08-16 14:48:43 +00:00
|
|
|
public:
|
2013-08-19 22:49:25 +00:00
|
|
|
explicit KeyMappingNewKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback)
|
|
|
|
: PopupScreen("Map Key", "Cancel", ""), callback_(callback) {
|
2013-08-16 14:48:43 +00:00
|
|
|
pspBtn_ = btn;
|
|
|
|
}
|
2013-08-16 15:16:11 +00:00
|
|
|
|
2013-08-16 14:48:43 +00:00
|
|
|
void key(const KeyInput &key);
|
|
|
|
void axis(const AxisInput &axis);
|
|
|
|
|
|
|
|
protected:
|
2013-08-16 15:16:11 +00:00
|
|
|
void CreatePopupContents(UI::ViewGroup *parent);
|
|
|
|
|
2013-09-04 08:51:14 +00:00
|
|
|
virtual bool FillVertical() const { return false; }
|
|
|
|
virtual bool ShowButtons() const { return true; }
|
2013-08-16 14:48:43 +00:00
|
|
|
virtual void OnCompleted(DialogResult result) {}
|
2013-08-17 08:34:38 +00:00
|
|
|
|
2013-08-16 14:48:43 +00:00
|
|
|
private:
|
|
|
|
int pspBtn_;
|
2013-08-16 19:25:01 +00:00
|
|
|
bool replace_;
|
2013-08-17 08:34:38 +00:00
|
|
|
std::function<void(KeyDef)> callback_;
|
2013-08-16 14:48:43 +00:00
|
|
|
};
|