2016-07-29 07:45:49 -05: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 13:02:29 -06:00
|
|
|
|
#include <array>
|
2016-09-20 10:21:23 -05:00
|
|
|
|
#include <memory>
|
2018-10-29 23:03:25 -05:00
|
|
|
|
|
2018-11-22 14:27:07 -06:00
|
|
|
|
#include <QDialog>
|
2016-07-29 07:45:49 -05:00
|
|
|
|
#include <QKeyEvent>
|
2018-10-29 23:03:25 -05:00
|
|
|
|
|
2016-07-29 07:45:49 -05:00
|
|
|
|
#include "ui_configure_input.h"
|
|
|
|
|
|
|
|
|
|
class QPushButton;
|
|
|
|
|
class QString;
|
|
|
|
|
class QTimer;
|
|
|
|
|
|
|
|
|
|
namespace Ui {
|
2016-09-17 19:38:01 -05:00
|
|
|
|
class ConfigureInput;
|
2016-07-29 07:45:49 -05:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-04 21:01:01 -06:00
|
|
|
|
void OnDockedModeChanged(bool last_state, bool new_state);
|
|
|
|
|
|
2018-11-22 14:27:07 -06:00
|
|
|
|
class ConfigureInput : public QDialog {
|
2016-07-29 07:45:49 -05:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit ConfigureInput(QWidget* parent = nullptr);
|
2018-12-02 13:06:39 -06:00
|
|
|
|
~ConfigureInput() override;
|
2016-07-29 07:45:49 -05:00
|
|
|
|
|
|
|
|
|
/// Save all button configurations to settings file
|
2019-05-25 23:39:23 -05:00
|
|
|
|
void ApplyConfiguration();
|
2016-07-29 07:45:49 -05:00
|
|
|
|
|
|
|
|
|
private:
|
2019-06-05 17:39:46 -05:00
|
|
|
|
void changeEvent(QEvent* event) override;
|
|
|
|
|
void RetranslateUI();
|
|
|
|
|
void RetranslateControllerComboBoxes();
|
|
|
|
|
|
2019-05-25 23:39:23 -05:00
|
|
|
|
void UpdateUIEnabled();
|
2017-12-05 22:26:29 -06:00
|
|
|
|
|
2016-12-09 17:59:09 -06:00
|
|
|
|
/// Load configuration settings.
|
2019-05-25 23:39:23 -05:00
|
|
|
|
void LoadConfiguration();
|
2019-06-05 17:39:46 -05:00
|
|
|
|
void LoadPlayerControllerIndices();
|
|
|
|
|
|
2016-07-29 07:45:49 -05:00
|
|
|
|
/// Restore all buttons to their default values.
|
2019-05-25 23:39:23 -05:00
|
|
|
|
void RestoreDefaults();
|
2018-08-26 03:23:12 -05:00
|
|
|
|
|
2018-11-01 21:06:48 -05:00
|
|
|
|
std::unique_ptr<Ui::ConfigureInput> ui;
|
2017-12-05 22:26:29 -06:00
|
|
|
|
|
2018-11-04 09:18:59 -06:00
|
|
|
|
std::array<QComboBox*, 8> players_controller;
|
|
|
|
|
std::array<QPushButton*, 8> players_configure;
|
2016-07-29 07:45:49 -05:00
|
|
|
|
};
|