Config: Port WiimoteControllerInterface setting to new config system.
This commit is contained in:
parent
2354fb4466
commit
ed1a1c1fae
|
@ -97,6 +97,8 @@ const Info<bool> MAIN_WII_KEYBOARD{{System::Main, "Core", "WiiKeyboard"}, false}
|
|||
const Info<bool> MAIN_WIIMOTE_CONTINUOUS_SCANNING{
|
||||
{System::Main, "Core", "WiimoteContinuousScanning"}, false};
|
||||
const Info<bool> MAIN_WIIMOTE_ENABLE_SPEAKER{{System::Main, "Core", "WiimoteEnableSpeaker"}, false};
|
||||
const Info<bool> MAIN_CONNECT_WIIMOTES_FOR_CONTROLLER_INTERFACE{
|
||||
{System::Main, "Core", "WiimoteControllerInterface"}, false};
|
||||
const Info<bool> MAIN_MMU{{System::Main, "Core", "MMU"}, false};
|
||||
const Info<int> MAIN_BB_DUMP_PORT{{System::Main, "Core", "BBDumpPort"}, -1};
|
||||
const Info<bool> MAIN_SYNC_GPU{{System::Main, "Core", "SyncGPU"}, false};
|
||||
|
|
|
@ -72,6 +72,7 @@ extern const Info<bool> MAIN_WII_SD_CARD;
|
|||
extern const Info<bool> MAIN_WII_KEYBOARD;
|
||||
extern const Info<bool> MAIN_WIIMOTE_CONTINUOUS_SCANNING;
|
||||
extern const Info<bool> MAIN_WIIMOTE_ENABLE_SPEAKER;
|
||||
extern const Info<bool> MAIN_CONNECT_WIIMOTES_FOR_CONTROLLER_INTERFACE;
|
||||
extern const Info<bool> MAIN_MMU;
|
||||
extern const Info<int> MAIN_BB_DUMP_PORT;
|
||||
extern const Info<bool> MAIN_SYNC_GPU;
|
||||
|
|
|
@ -109,6 +109,7 @@ bool IsSettingSaveable(const Config::Location& config_location)
|
|||
&Config::MAIN_WII_KEYBOARD.GetLocation(),
|
||||
&Config::MAIN_WIIMOTE_CONTINUOUS_SCANNING.GetLocation(),
|
||||
&Config::MAIN_WIIMOTE_ENABLE_SPEAKER.GetLocation(),
|
||||
&Config::MAIN_CONNECT_WIIMOTES_FOR_CONTROLLER_INTERFACE.GetLocation(),
|
||||
|
||||
// UI.General
|
||||
|
||||
|
|
|
@ -111,7 +111,6 @@ void SConfig::SaveCoreSettings(IniFile& ini)
|
|||
{
|
||||
core->Set(fmt::format("SIDevice{}", i), m_SIDevice[i]);
|
||||
}
|
||||
core->Set("WiimoteControllerInterface", connect_wiimotes_for_ciface);
|
||||
core->Set("MMU", bMMU);
|
||||
}
|
||||
|
||||
|
@ -139,7 +138,6 @@ void SConfig::LoadCoreSettings(IniFile& ini)
|
|||
core->Get(fmt::format("SIDevice{}", i), &m_SIDevice[i],
|
||||
(i == 0) ? SerialInterface::SIDEVICE_GC_CONTROLLER : SerialInterface::SIDEVICE_NONE);
|
||||
}
|
||||
core->Get("WiimoteControllerInterface", &connect_wiimotes_for_ciface, false);
|
||||
core->Get("MMU", &bMMU, bMMU);
|
||||
core->Get("BBDumpPort", &iBBDumpPort, -1);
|
||||
core->Get("SyncGPU", &bSyncGPU, false);
|
||||
|
|
|
@ -49,9 +49,6 @@ struct BootParameters;
|
|||
|
||||
struct SConfig
|
||||
{
|
||||
// Wii Devices
|
||||
bool connect_wiimotes_for_ciface;
|
||||
|
||||
// Settings
|
||||
bool bAutomaticStart = false;
|
||||
bool bBootToPause = false;
|
||||
|
|
|
@ -111,7 +111,7 @@ void ProcessWiimotePool()
|
|||
for (u32 index = 0; index != MAX_WIIMOTES; ++index)
|
||||
TryToFillWiimoteSlot(index);
|
||||
|
||||
if (SConfig::GetInstance().connect_wiimotes_for_ciface)
|
||||
if (Config::Get(Config::MAIN_CONNECT_WIIMOTES_FOR_CONTROLLER_INTERFACE))
|
||||
{
|
||||
for (auto& entry : s_wiimote_pool)
|
||||
ciface::WiimoteController::AddDevice(std::move(entry.wiimote));
|
||||
|
@ -686,7 +686,7 @@ void WiimoteScanner::ThreadFunc()
|
|||
continue;
|
||||
|
||||
// If we don't want Wiimotes in ControllerInterface, we may not need them at all.
|
||||
if (!SConfig::GetInstance().connect_wiimotes_for_ciface)
|
||||
if (!Config::Get(Config::MAIN_CONNECT_WIIMOTES_FOR_CONTROLLER_INTERFACE))
|
||||
{
|
||||
// We don't want any remotes in passthrough mode or running in GC mode.
|
||||
const bool core_running = Core::GetState() != Core::State::Uninitialized;
|
||||
|
|
|
@ -306,7 +306,7 @@ void WiimoteControllersWidget::LoadSettings()
|
|||
m_wiimote_real_balance_board->setChecked(WiimoteCommon::GetSource(WIIMOTE_BALANCE_BOARD) ==
|
||||
WiimoteSource::Real);
|
||||
m_wiimote_speaker_data->setChecked(Config::Get(Config::MAIN_WIIMOTE_ENABLE_SPEAKER));
|
||||
m_wiimote_ciface->setChecked(SConfig::GetInstance().connect_wiimotes_for_ciface);
|
||||
m_wiimote_ciface->setChecked(Config::Get(Config::MAIN_CONNECT_WIIMOTES_FOR_CONTROLLER_INTERFACE));
|
||||
m_wiimote_continuous_scanning->setChecked(Config::Get(Config::MAIN_WIIMOTE_CONTINUOUS_SCANNING));
|
||||
|
||||
if (Config::Get(Config::MAIN_BLUETOOTH_PASSTHROUGH_ENABLED))
|
||||
|
@ -321,7 +321,8 @@ void WiimoteControllersWidget::SaveSettings()
|
|||
{
|
||||
Config::SetBaseOrCurrent(Config::MAIN_WIIMOTE_ENABLE_SPEAKER,
|
||||
m_wiimote_speaker_data->isChecked());
|
||||
SConfig::GetInstance().connect_wiimotes_for_ciface = m_wiimote_ciface->isChecked();
|
||||
Config::SetBaseOrCurrent(Config::MAIN_CONNECT_WIIMOTES_FOR_CONTROLLER_INTERFACE,
|
||||
m_wiimote_ciface->isChecked());
|
||||
Config::SetBaseOrCurrent(Config::MAIN_WIIMOTE_CONTINUOUS_SCANNING,
|
||||
m_wiimote_continuous_scanning->isChecked());
|
||||
Config::SetBaseOrCurrent(Config::MAIN_BLUETOOTH_PASSTHROUGH_ENABLED,
|
||||
|
|
Loading…
Reference in New Issue