mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Add 'Enable Controller Input' checkbox to TAS dialogs
When disabled only inputs from TAS dialog are used. When enabled inputs from TAS dialog are used, except when a change in input is detected from a real controller, in this case the TAS value is replaced with the real controller value.
This commit is contained in:
44
Source/Core/DolphinQt/TAS/TASInputWindow.h
Normal file
44
Source/Core/DolphinQt/TAS/TASInputWindow.h
Normal file
@ -0,0 +1,44 @@
|
||||
// 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 TASInputWindow : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TASInputWindow(QWidget* parent);
|
||||
|
||||
protected:
|
||||
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, u16 max,
|
||||
Qt::Key shortcut_key, QWidget* shortcut_widget,
|
||||
bool invert = false);
|
||||
QSpinBox* CreateSliderValuePair(QBoxLayout* layout, u16 max, QKeySequence shortcut_key_sequence,
|
||||
Qt::Orientation orientation, QWidget* shortcut_widget,
|
||||
bool invert = false);
|
||||
template <typename UX>
|
||||
void GetButton(QCheckBox* button, UX& pad, UX mask);
|
||||
void GetSpinBoxU8(QSpinBox* spin, u8& controller_value);
|
||||
void GetSpinBoxU16(QSpinBox* spin, u16& controller_value);
|
||||
QCheckBox* m_use_controller;
|
||||
|
||||
private:
|
||||
std::map<QCheckBox*, 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;
|
||||
};
|
Reference in New Issue
Block a user