2016-07-29 08:45:49 -04:00
|
|
|
|
// Copyright 2016 Citra Emulator Project
|
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2017-01-22 16:02:29 -03:00
|
|
|
|
#include <array>
|
|
|
|
|
#include <functional>
|
2016-09-20 12:21:23 -03:00
|
|
|
|
#include <memory>
|
2018-10-30 01:03:25 -03:00
|
|
|
|
#include <optional>
|
2017-01-22 16:02:29 -03:00
|
|
|
|
#include <string>
|
2017-12-06 01:26:29 -03:00
|
|
|
|
#include <unordered_map>
|
2018-10-30 01:03:25 -03:00
|
|
|
|
|
2016-07-29 08:45:49 -04:00
|
|
|
|
#include <QKeyEvent>
|
2016-09-17 21:38:01 -03:00
|
|
|
|
#include <QWidget>
|
2018-10-30 01:03:25 -03:00
|
|
|
|
|
2017-01-22 16:02:29 -03:00
|
|
|
|
#include "common/param_package.h"
|
2016-07-29 08:45:49 -04:00
|
|
|
|
#include "core/settings.h"
|
2017-12-06 01:26:29 -03:00
|
|
|
|
#include "input_common/main.h"
|
2016-07-29 08:45:49 -04:00
|
|
|
|
#include "ui_configure_input.h"
|
2018-11-01 23:06:48 -03:00
|
|
|
|
#include "yuzu/configuration/config.h"
|
2016-07-29 08:45:49 -04:00
|
|
|
|
|
|
|
|
|
class QPushButton;
|
|
|
|
|
class QString;
|
|
|
|
|
class QTimer;
|
|
|
|
|
|
|
|
|
|
namespace Ui {
|
2016-09-17 21:38:01 -03:00
|
|
|
|
class ConfigureInput;
|
2016-07-29 08:45:49 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class ConfigureInput : public QWidget {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit ConfigureInput(QWidget* parent = nullptr);
|
|
|
|
|
|
|
|
|
|
/// Save all button configurations to settings file
|
|
|
|
|
void applyConfiguration();
|
|
|
|
|
|
|
|
|
|
private:
|
2018-11-01 23:06:48 -03:00
|
|
|
|
void updateUIEnabled();
|
2017-12-06 01:26:29 -03:00
|
|
|
|
|
2018-11-01 23:06:48 -03:00
|
|
|
|
template <typename Dialog, typename... Args>
|
2018-11-03 13:55:39 -03:00
|
|
|
|
void CallConfigureDialog(Args&&... args);
|
2017-12-06 01:26:29 -03:00
|
|
|
|
|
2016-12-09 20:59:09 -03:00
|
|
|
|
/// Load configuration settings.
|
|
|
|
|
void loadConfiguration();
|
2016-07-29 08:45:49 -04:00
|
|
|
|
/// Restore all buttons to their default values.
|
|
|
|
|
void restoreDefaults();
|
2018-08-26 05:23:12 -03:00
|
|
|
|
|
2018-11-01 23:06:48 -03:00
|
|
|
|
std::unique_ptr<Ui::ConfigureInput> ui;
|
2017-12-06 01:26:29 -03:00
|
|
|
|
|
2018-11-01 23:06:48 -03:00
|
|
|
|
std::array<QCheckBox*, 8> players_enabled;
|
|
|
|
|
std::array<QComboBox*, 8> player_controller;
|
|
|
|
|
std::array<QPushButton*, 8> player_configure;
|
2016-07-29 08:45:49 -04:00
|
|
|
|
};
|