WiimoteEmu: Major renaming and cleanup.

This commit is contained in:
Jordan Woyak
2019-01-01 08:32:39 -06:00
parent b1f350ab1c
commit 0d1fbe7bbc
64 changed files with 4140 additions and 3185 deletions

View File

@ -16,7 +16,7 @@
#include "DolphinQt/Config/Mapping/MappingWindow.h"
#include "DolphinQt/Config/Mapping/WiimoteEmuExtension.h"
#include "InputCommon/ControllerEmu/ControlGroup/Extension.h"
#include "InputCommon/ControllerEmu/ControlGroup/Attachments.h"
#include "InputCommon/ControllerEmu/Setting/BooleanSetting.h"
#include "InputCommon/InputConfig.h"
@ -40,12 +40,13 @@ void WiimoteEmuGeneral::CreateMainLayout()
m_main_layout->addWidget(CreateGroupBox(
tr("Hotkeys"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Hotkeys)));
auto* extension_group = Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Extension);
auto* extension_group =
Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Attachments);
auto* extension = CreateGroupBox(tr("Extension"), extension_group);
auto* ce_extension = static_cast<ControllerEmu::Extension*>(extension_group);
auto* ce_extension = static_cast<ControllerEmu::Attachments*>(extension_group);
m_extension_combo = new QComboBox();
for (const auto& attachment : ce_extension->attachments)
for (const auto& attachment : ce_extension->GetAttachmentList())
{
// TODO: Figure out how to localize this
m_extension_combo->addItem(QString::fromStdString(attachment->GetName()));
@ -88,18 +89,18 @@ void WiimoteEmuGeneral::OnAttachmentChanged(int extension)
m_extension_widget->ChangeExtensionType(value_map[value]);
auto* ce_extension = static_cast<ControllerEmu::Extension*>(
Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Extension));
ce_extension->switch_extension = extension;
auto* ce_extension = static_cast<ControllerEmu::Attachments*>(
Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Attachments));
ce_extension->SetSelectedAttachment(extension);
SaveSettings();
}
void WiimoteEmuGeneral::Update()
{
auto* ce_extension = static_cast<ControllerEmu::Extension*>(
Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Extension));
auto* ce_extension = static_cast<ControllerEmu::Attachments*>(
Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Attachments));
m_extension_combo->setCurrentIndex(ce_extension->switch_extension);
m_extension_combo->setCurrentIndex(ce_extension->GetSelectedAttachment());
}
void WiimoteEmuGeneral::LoadSettings()