add controller remapping GUI (#2311)

* Initial Version - controller remapping GUI

* rework saving to allow for multiple outputs to an input

* License header

* Remove PS logo from image

* Add per game checkbox, fix filename, better whitespace deletion

* Reorganize variables, correctly set common config label when selected

* Add option to unmap, set mapping to unmapped when config entry is absent

* Add XBox labels

* Remove parsing from save function, make window more compact

* Fix typo

* Code cleanup

* Additional cleanup

---------

Co-authored-by: rainmakerv2 <30595646+jpau02@users.noreply.github.com>
This commit is contained in:
rainmakerv2 2025-02-04 14:50:32 +08:00 committed by GitHub
parent 97441b62d1
commit e0d85a7e58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 1937 additions and 2 deletions

View file

@ -0,0 +1,52 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <QDialog>
#include "game_info.h"
namespace Ui {
class ControlSettings;
}
class ControlSettings : public QDialog {
Q_OBJECT
public:
explicit ControlSettings(std::shared_ptr<GameInfoClass> game_info_get,
QWidget* parent = nullptr);
~ControlSettings();
private Q_SLOTS:
void SaveControllerConfig(bool CloseOnSave);
void SetDefault();
private:
std::unique_ptr<Ui::ControlSettings> ui;
std::shared_ptr<GameInfoClass> m_game_info;
void AddBoxItems();
void SetUIValuestoMappings();
void GetGameTitle();
const std::vector<std::string> ControllerInputs = {
"cross", "circle", "square", "triangle", "l1",
"r1", "l2", "r2", "l3",
"r3", "options", "pad_up",
"pad_down",
"pad_left", "pad_right", "axis_left_x", "axis_left_y", "axis_right_x",
"axis_right_y", "back"};
const QStringList ButtonOutputs = {"cross", "circle", "square", "triangle", "l1",
"r1", "l2", "r2", "l3",
"r3", "options", "pad_up",
"pad_down",
"pad_left", "pad_right", "touchpad", "unmapped"};
const QStringList StickOutputs = {"axis_left_x", "axis_left_y", "axis_right_x", "axis_right_y",
"unmapped"};
};