mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
6670226a44
This is a feature which existed in DolphinWX. Seems like it got implemented in DolphinQt for IRWidget/StickWidget but not sliders.
54 lines
1.7 KiB
C++
54 lines
1.7 KiB
C++
// Copyright 2018 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <QDialog>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
struct GCPadStatus;
|
|
class QBoxLayout;
|
|
class QCheckBox;
|
|
class QDialog;
|
|
class QGroupBox;
|
|
class QSpinBox;
|
|
class QString;
|
|
class TASCheckBox;
|
|
|
|
class TASInputWindow : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit TASInputWindow(QWidget* parent);
|
|
|
|
int GetTurboPressFrames() const;
|
|
int GetTurboReleaseFrames() const;
|
|
|
|
protected:
|
|
TASCheckBox* CreateButton(const QString& name);
|
|
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);
|
|
QBoxLayout* CreateSliderValuePairLayout(QString name, QSpinBox*& value, int default_, u16 max,
|
|
Qt::Key shortcut_key, QWidget* shortcut_widget,
|
|
bool invert = false);
|
|
QSpinBox* CreateSliderValuePair(QBoxLayout* layout, int default_, u16 max,
|
|
QKeySequence shortcut_key_sequence, Qt::Orientation orientation,
|
|
QWidget* shortcut_widget, bool invert = false);
|
|
template <typename UX>
|
|
void GetButton(TASCheckBox* button, UX& pad, UX mask);
|
|
void GetSpinBoxU8(QSpinBox* spin, u8& controller_value);
|
|
void GetSpinBoxU16(QSpinBox* spin, u16& controller_value);
|
|
|
|
QGroupBox* m_settings_box;
|
|
QCheckBox* m_use_controller;
|
|
QSpinBox* m_turbo_press_frames;
|
|
QSpinBox* m_turbo_release_frames;
|
|
|
|
private:
|
|
std::map<TASCheckBox*, bool> m_checkbox_set_by_controller;
|
|
std::map<QSpinBox*, u8> m_spinbox_most_recent_values_u8;
|
|
std::map<QSpinBox*, u8> m_spinbox_most_recent_values_u16;
|
|
};
|