New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt: Implement mapping dialogs #5405
Conversation
4480379
to
6babb05
Compare
virtual void OnSaveProfile(const QString& profile) = 0; | ||
virtual void OnLoadProfile(const QString& profile) = 0; | ||
|
||
MappingWindow* GetParent(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
#include "DolphinQt2/Config/MappingWindow.h" | ||
|
||
MappingWindow::MappingWindow(const int portnr, QWidget* parent) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
MAPPING_WIIMOTE_HYBRID | ||
}; | ||
|
||
explicit MappingWindow(const int portnr, QWidget* parent); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
void CreateMainLayout(); | ||
void ConnectWidgets(); | ||
|
||
bool IsLayoutComplex(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
void RefreshDevices(); | ||
|
||
ControllerEmu::EmulatedController* controller; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
if (controller == nullptr) | ||
return; | ||
|
||
std::cout << "Refreshing devices..." << std::endl; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
g_controller_interface.RefreshDevices(); | ||
controller->UpdateReferences(g_controller_interface); | ||
|
||
std::cout << g_controller_interface.GetAllDeviceStrings().size() << " device(s) found." |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
std::cout << "Refreshing devices..." << std::endl; | ||
|
||
bool paused = Core::PauseAndLock(true); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
QTabWidget* m_tab_widget; | ||
|
||
int mapping_type; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
#include "DolphinQt2/Config/MappingWindow.h" | ||
|
||
MappingWindow::MappingWindow(const int portnr, QWidget* parent) | ||
: QDialog(parent), controller(nullptr), port(portnr) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
1e22c21
to
c9371c4
Compare
m_profiles_box->setHidden(!is_complex); | ||
m_devices_box->setHidden(!is_complex); | ||
|
||
this->m_is_complex = is_complex; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
void MappingWindow::ConnectWidgets() | ||
{ | ||
const QString& text = |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
connect(m_devices_refresh, &QPushButton::clicked, this, &MappingWindow::RefreshDevices); | ||
connect(m_devices_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), | ||
this, &MappingWindow::OnDeviceChanged); | ||
connect(m_reset_clear, &QPushButton::clicked, this, [this]() { emit ClearFields(); }); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
m_main_layout->addWidget(CreateGroupBox("Buttons", Pad::GetGroup(GetPort(), PadGroup::Buttons))); | ||
m_main_layout->addWidget( | ||
CreateGroupBox("Controlstick", Pad::GetGroup(GetPort(), PadGroup::MainStick))); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
QGroupBox* MappingWidget::CreateGroupBox(const char* name, ControllerEmu::ControlGroup* group) const | ||
{ | ||
QGroupBox* group_box = new QGroupBox(tr(name)); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
3704358
to
d4f952a
Compare
|
||
void MappingButton::OnButtonPressed() | ||
{ | ||
if (m_reference->IsInput()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
#include <QRegExp> | ||
#include <QString> | ||
#include <chrono> |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
connect(this, &MappingButton::clicked, this, &MappingButton::OnButtonPressed); | ||
} | ||
|
||
static inline QString |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
} | ||
|
||
static inline QString | ||
GetExpressionForControl(QString& control_name, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
#include "Core/HW/GCPad.h" | ||
#include "Core/HW/GCPadEmu.h" | ||
|
||
#include "DolphinQt2/Config/Mapping/GCPadEmu.h" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
#include <QFormLayout> | ||
#include <QGroupBox> | ||
#include <QPushButton> | ||
#include <iostream> |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
#include <QPushButton> | ||
#include <QTabWidget> | ||
#include <QVBoxLayout> | ||
#include <iostream> |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
int m_mapping_type; | ||
const int m_port; | ||
bool m_is_complex; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
public: | ||
explicit GCPadEmu(MappingWindow* window); | ||
|
||
protected: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
public: | ||
explicit GCPadWiiU(MappingWindow* window); | ||
|
||
protected: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
1387174
to
31f113e
Compare
502547f
to
9c3dd56
Compare
bdddb7e
to
242e3cb
Compare
case MAPPING_WIIMOTE_EMU: | ||
case MAPPING_WIIMOTE_HYBRID: | ||
widget = new WiimoteEmuGeneral(this); | ||
setWindowTitle(tr("Wiimote at Port %1").arg(GetPort() + 1)); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
242e3cb
to
0adafb2
Compare
Not everything is perfect or complete yet, but I want to implement the missing features later down the road in different PRs (Will also result in others being able to work on it in the meantime). |
|
||
void MappingButton::Clear() | ||
{ | ||
m_reference->expression = ""; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
m_first = false; | ||
return true; | ||
} | ||
else |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
{ | ||
if (!m_block) | ||
return QDialog::event(event); | ||
else |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
public: | ||
enum | ||
{ | ||
NONE = 0, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/DolphinQt2/Settings.h
Outdated
void SetGCAdapterRumbleEnabled(int port, bool enabled); | ||
|
||
bool IsGCAdapterSimulatingDKBongos(int port) const; | ||
void SetGCAdapterSimulatingDKBongos(int potr, bool enabled); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
{ | ||
Q_OBJECT | ||
public: | ||
enum |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
{ | ||
const QString value = m_extension_combo->currentText(); | ||
|
||
const static QMap<QString, int> value_map = { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
87d65d6
to
ec29706
Compare
ec29706
to
1736a4f
Compare
1736a4f
to
3089cd8
Compare
3089cd8
to
33e111e
Compare
Should be ready to merge now. |
Features:
Configure Outputs(Separate PR)Advanced Input Dialogs(Separate PR)Output Configuration Dialogs(Separate PR)Screenshots (Outdated):