2017-06-13 04:52:19 +01:00
|
|
|
#pragma once
|
2016-09-06 00:23:31 +01:00
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QAbstractButton>
|
2017-05-23 16:08:53 +01:00
|
|
|
|
2018-11-19 13:20:46 -05:00
|
|
|
#include "../input/InputBindingManager.h"
|
2017-05-23 16:08:53 +01:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class ControllerConfigDialog;
|
2016-09-06 00:23:31 +01:00
|
|
|
}
|
|
|
|
|
2020-09-14 19:43:25 -04:00
|
|
|
class QTableView;
|
2023-04-22 09:02:24 -04:00
|
|
|
class QSlider;
|
|
|
|
class QLabel;
|
2023-10-30 22:16:06 +00:00
|
|
|
class QComboBox;
|
2023-04-20 19:03:13 -04:00
|
|
|
class CInputProviderQtKey;
|
|
|
|
class CInputProviderQtMouse;
|
2020-09-14 19:43:25 -04:00
|
|
|
|
2016-09-06 00:23:31 +01:00
|
|
|
class ControllerConfigDialog : public QDialog
|
|
|
|
{
|
2017-06-13 04:51:38 +01:00
|
|
|
Q_OBJECT
|
2016-09-06 00:23:31 +01:00
|
|
|
|
|
|
|
public:
|
2023-04-20 19:03:13 -04:00
|
|
|
explicit ControllerConfigDialog(CInputBindingManager*, CInputProviderQtKey*, CInputProviderQtMouse*, QWidget* parent = 0);
|
2017-06-13 04:51:38 +01:00
|
|
|
~ControllerConfigDialog();
|
2017-05-23 16:08:53 +01:00
|
|
|
|
2020-09-14 19:43:25 -04:00
|
|
|
static void AutoConfigureKeyboard(uint32 padIndex, CInputBindingManager*);
|
2018-11-28 22:32:27 -05:00
|
|
|
|
2016-09-06 00:23:31 +01:00
|
|
|
private slots:
|
2020-09-14 19:43:25 -04:00
|
|
|
void bindingsViewDoubleClicked(const QModelIndex& index);
|
2023-10-12 10:13:32 -04:00
|
|
|
void bindingsViewDeleteItem();
|
2023-04-22 09:02:24 -04:00
|
|
|
void analogSensitivityValueChanged(uint32, int);
|
2020-09-14 19:43:25 -04:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
void on_buttonBox_clicked(QAbstractButton* button);
|
2017-06-13 04:51:38 +01:00
|
|
|
void on_ConfigAllButton_clicked();
|
2016-09-06 00:23:31 +01:00
|
|
|
|
2020-02-25 18:47:50 +00:00
|
|
|
void on_comboBox_currentIndexChanged(int index);
|
|
|
|
void on_addProfileButton_clicked();
|
|
|
|
void on_delProfileButton_clicked();
|
|
|
|
|
2016-09-06 00:23:31 +01:00
|
|
|
private:
|
2023-04-22 09:02:24 -04:00
|
|
|
struct PadUiElements
|
|
|
|
{
|
|
|
|
QTableView* bindingsView = nullptr;
|
|
|
|
QSlider* analogSensitivitySlider = nullptr;
|
|
|
|
QLabel* analogSensitivityValueLabel = nullptr;
|
2023-10-30 22:16:06 +00:00
|
|
|
QComboBox* hapticFeedbackComboBox = nullptr;
|
2023-04-22 09:02:24 -04:00
|
|
|
};
|
|
|
|
|
2020-09-14 19:43:25 -04:00
|
|
|
void PrepareBindingsView(uint32 padIndex);
|
|
|
|
void PrepareProfiles();
|
|
|
|
int OpenBindConfigDialog(uint32 padIndex, uint32 buttonIndex);
|
2023-04-22 09:02:24 -04:00
|
|
|
void UpdateAnalogSensitivityValueLabel(uint32 padIndex);
|
2018-11-19 13:20:46 -05:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
Ui::ControllerConfigDialog* ui;
|
2018-11-19 13:20:46 -05:00
|
|
|
CInputBindingManager* m_inputManager = nullptr;
|
|
|
|
CInputProviderQtKey* m_qtKeyInputProvider = nullptr;
|
2023-04-20 19:03:13 -04:00
|
|
|
CInputProviderQtMouse* m_qtMouseInputProvider = nullptr;
|
2023-04-22 09:02:24 -04:00
|
|
|
std::vector<PadUiElements> m_padUiElements;
|
2016-09-06 00:23:31 +01:00
|
|
|
};
|