From 0c1070a07b4223bacef50df671c7a27317324500 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 22 Sep 2024 21:51:12 +0200 Subject: [PATCH] Android: Add the "Real Balance Board" setting --- .../settings/ui/SettingsFragmentPresenter.kt | 18 ++++++++++++++++++ .../app/src/main/res/values/strings.xml | 2 ++ 2 files changed, 20 insertions(+) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt index 6de39ed1e9..fdcaad4837 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt @@ -1226,6 +1226,24 @@ class SettingsFragmentPresenter( MenuTag.getWiimoteMenuTag(3) ) ) + sl.add(SwitchSetting(context, object : AbstractBooleanSetting { + override val isOverridden: Boolean = IntSetting.WIIMOTE_BB_SOURCE.isOverridden + + override val isRuntimeEditable: Boolean = IntSetting.WIIMOTE_BB_SOURCE.isRuntimeEditable + + override fun delete(settings: Settings): Boolean { + return IntSetting.WIIMOTE_BB_SOURCE.delete(settings) + } + + override val boolean: Boolean get() = IntSetting.WIIMOTE_BB_SOURCE.int == 2 + + override fun setBoolean(settings: Settings, newValue: Boolean) { + // 0 == None + // 1 == Emulated + // 2 == Real + IntSetting.WIIMOTE_BB_SOURCE.setInt(settings, if (newValue) 2 else 0) + } + }, R.string.real_balance_board, 0)) } private fun addGraphicsSettings(sl: ArrayList) { diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index a195ef08ea..a020887e0c 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -23,6 +23,8 @@ Wii Remote Extension 3 Wii Remote Extension 4 + Real Balance Board + Wii Remote Buttons Motion Simulation