mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Merge pull request #10443 from JosJuice/port-wiimote-source
Port Wiimote source settings to the new config system
This commit is contained in:
@ -17,7 +17,10 @@
|
||||
#include <map>
|
||||
#include <optional>
|
||||
|
||||
#include "Common/Config/Config.h"
|
||||
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/Config/WiimoteSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
@ -301,9 +304,9 @@ void WiimoteControllersWidget::LoadSettings()
|
||||
{
|
||||
for (size_t i = 0; i < m_wiimote_groups.size(); i++)
|
||||
{
|
||||
m_wiimote_boxes[i]->setCurrentIndex(int(WiimoteCommon::GetSource(u32(i))));
|
||||
m_wiimote_boxes[i]->setCurrentIndex(int(Config::Get(Config::GetInfoForWiimoteSource(int(i)))));
|
||||
}
|
||||
m_wiimote_real_balance_board->setChecked(WiimoteCommon::GetSource(WIIMOTE_BALANCE_BOARD) ==
|
||||
m_wiimote_real_balance_board->setChecked(Config::Get(Config::WIIMOTE_BB_SOURCE) ==
|
||||
WiimoteSource::Real);
|
||||
m_wiimote_speaker_data->setChecked(Config::Get(Config::MAIN_WIIMOTE_ENABLE_SPEAKER));
|
||||
m_wiimote_ciface->setChecked(Config::Get(Config::MAIN_CONNECT_WIIMOTES_FOR_CONTROLLER_INTERFACE));
|
||||
@ -328,17 +331,15 @@ void WiimoteControllersWidget::SaveSettings()
|
||||
Config::SetBaseOrCurrent(Config::MAIN_BLUETOOTH_PASSTHROUGH_ENABLED,
|
||||
m_wiimote_passthrough->isChecked());
|
||||
|
||||
WiimoteCommon::SetSource(WIIMOTE_BALANCE_BOARD, m_wiimote_real_balance_board->isChecked() ?
|
||||
WiimoteSource::Real :
|
||||
WiimoteSource::None);
|
||||
const WiimoteSource bb_source =
|
||||
m_wiimote_real_balance_board->isChecked() ? WiimoteSource::Real : WiimoteSource::None;
|
||||
Config::SetBaseOrCurrent(Config::WIIMOTE_BB_SOURCE, bb_source);
|
||||
|
||||
for (size_t i = 0; i < m_wiimote_groups.size(); i++)
|
||||
{
|
||||
const int index = m_wiimote_boxes[i]->currentIndex();
|
||||
WiimoteCommon::SetSource(u32(i), WiimoteSource(index));
|
||||
Config::SetBaseOrCurrent(Config::GetInfoForWiimoteSource(int(i)), WiimoteSource(index));
|
||||
}
|
||||
|
||||
UICommon::SaveWiimoteSources();
|
||||
|
||||
SConfig::GetInstance().SaveSettings();
|
||||
}
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "Core/CommonTitles.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/Config/NetplaySettings.h"
|
||||
#include "Core/Config/WiimoteSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/FreeLookManager.h"
|
||||
@ -1735,7 +1736,7 @@ void MainWindow::OnStartRecording()
|
||||
controllers[i] = Movie::ControllerType::GC;
|
||||
else
|
||||
controllers[i] = Movie::ControllerType::None;
|
||||
wiimotes[i] = WiimoteCommon::GetSource(i) != WiimoteSource::None;
|
||||
wiimotes[i] = Config::Get(Config::GetInfoForWiimoteSource(i)) != WiimoteSource::None;
|
||||
}
|
||||
|
||||
if (Movie::BeginRecordingInput(controllers, wiimotes))
|
||||
@ -1795,7 +1796,7 @@ void MainWindow::ShowTASInput()
|
||||
|
||||
for (int i = 0; i < num_wii_controllers; i++)
|
||||
{
|
||||
if (WiimoteCommon::GetSource(i) == WiimoteSource::Emulated &&
|
||||
if (Config::Get(Config::GetInfoForWiimoteSource(i)) == WiimoteSource::Emulated &&
|
||||
(!Core::IsRunning() || SConfig::GetInstance().bWii))
|
||||
{
|
||||
m_wii_tas_input_windows[i]->show();
|
||||
|
Reference in New Issue
Block a user