2018-07-07 05:51:34 +00:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-07-07 05:51:34 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
struct GCPadStatus;
|
|
|
|
class QBoxLayout;
|
|
|
|
class QCheckBox;
|
|
|
|
class QDialog;
|
|
|
|
class QGroupBox;
|
|
|
|
class QSpinBox;
|
|
|
|
class QString;
|
2019-03-31 02:49:57 +00:00
|
|
|
class TASCheckBox;
|
2018-07-07 05:51:34 +00:00
|
|
|
|
|
|
|
class TASInputWindow : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit TASInputWindow(QWidget* parent);
|
|
|
|
|
2020-06-30 19:07:25 +00:00
|
|
|
int GetTurboPressFrames() const;
|
|
|
|
int GetTurboReleaseFrames() const;
|
|
|
|
|
2018-07-07 05:51:34 +00:00
|
|
|
protected:
|
2020-06-30 19:07:25 +00:00
|
|
|
TASCheckBox* CreateButton(const QString& name);
|
2018-07-07 05:51:34 +00:00
|
|
|
QGroupBox* CreateStickInputs(QString name, QSpinBox*& x_value, QSpinBox*& y_value, u16 max_x,
|
|
|
|
u16 max_y, Qt::Key x_shortcut_key, Qt::Key y_shortcut_key);
|
2020-10-18 11:47:00 +00:00
|
|
|
QBoxLayout* CreateSliderValuePairLayout(QString name, QSpinBox*& value, int default_, u16 max,
|
2018-07-07 05:51:34 +00:00
|
|
|
Qt::Key shortcut_key, QWidget* shortcut_widget,
|
|
|
|
bool invert = false);
|
2020-10-18 11:47:00 +00:00
|
|
|
QSpinBox* CreateSliderValuePair(QBoxLayout* layout, int default_, u16 max,
|
|
|
|
QKeySequence shortcut_key_sequence, Qt::Orientation orientation,
|
|
|
|
QWidget* shortcut_widget, bool invert = false);
|
2018-07-07 05:51:34 +00:00
|
|
|
template <typename UX>
|
2019-03-31 02:49:57 +00:00
|
|
|
void GetButton(TASCheckBox* button, UX& pad, UX mask);
|
2018-07-07 05:51:34 +00:00
|
|
|
void GetSpinBoxU8(QSpinBox* spin, u8& controller_value);
|
|
|
|
void GetSpinBoxU16(QSpinBox* spin, u16& controller_value);
|
2020-06-30 19:07:25 +00:00
|
|
|
|
|
|
|
QGroupBox* m_settings_box;
|
2018-07-07 05:51:34 +00:00
|
|
|
QCheckBox* m_use_controller;
|
2020-06-30 19:07:25 +00:00
|
|
|
QSpinBox* m_turbo_press_frames;
|
|
|
|
QSpinBox* m_turbo_release_frames;
|
2018-07-07 05:51:34 +00:00
|
|
|
|
|
|
|
private:
|
2019-03-31 02:49:57 +00:00
|
|
|
std::map<TASCheckBox*, bool> m_checkbox_set_by_controller;
|
2018-07-07 05:51:34 +00:00
|
|
|
std::map<QSpinBox*, u8> m_spinbox_most_recent_values_u8;
|
|
|
|
std::map<QSpinBox*, u8> m_spinbox_most_recent_values_u16;
|
|
|
|
};
|