Merge pull request #11964 from JosJuice/android-hide-infinity

Android: Hide Infinity Base in MenuFragment when not relevant
This commit is contained in:
Charles Lombardo 2023-06-20 17:11:18 -04:00 committed by GitHub
commit deb37f0846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -58,12 +58,17 @@ class MenuFragment : Fragment(), View.OnClickListener {
if (!requireArguments().getBoolean(KEY_WII, true)) { if (!requireArguments().getBoolean(KEY_WII, true)) {
binding.menuRefreshWiimotes.visibility = View.GONE binding.menuRefreshWiimotes.visibility = View.GONE
binding.menuSkylanders.visibility = View.GONE binding.menuSkylanders.visibility = View.GONE
binding.menuInfinityBase.visibility = View.GONE
} }
if (!BooleanSetting.MAIN_EMULATE_SKYLANDER_PORTAL.boolean) { if (!BooleanSetting.MAIN_EMULATE_SKYLANDER_PORTAL.boolean) {
binding.menuSkylanders.visibility = View.GONE binding.menuSkylanders.visibility = View.GONE
} }
if (!BooleanSetting.MAIN_EMULATE_INFINITY_BASE.boolean) {
binding.menuInfinityBase.visibility = View.GONE
}
val options = binding.layoutOptions val options = binding.layoutOptions
for (childIndex in 0 until options.childCount) { for (childIndex in 0 until options.childCount) {
val button = options.getChildAt(childIndex) as Button val button = options.getChildAt(childIndex) as Button
@ -191,7 +196,7 @@ class MenuFragment : Fragment(), View.OnClickListener {
buttonsActionsMap.append(R.id.menu_settings, EmulationActivity.MENU_ACTION_SETTINGS) buttonsActionsMap.append(R.id.menu_settings, EmulationActivity.MENU_ACTION_SETTINGS)
buttonsActionsMap.append(R.id.menu_skylanders, EmulationActivity.MENU_ACTION_SKYLANDERS) buttonsActionsMap.append(R.id.menu_skylanders, EmulationActivity.MENU_ACTION_SKYLANDERS)
buttonsActionsMap.append( buttonsActionsMap.append(
R.id.menu_infinitybase, R.id.menu_infinity_base,
EmulationActivity.MENU_ACTION_INFINITY_BASE EmulationActivity.MENU_ACTION_INFINITY_BASE
) )
} }

View File

@ -107,7 +107,7 @@
style="@style/InGameMenuOption" /> style="@style/InGameMenuOption" />
<Button <Button
android:id="@+id/menu_infinitybase" android:id="@+id/menu_infinity_base"
android:text="@string/emulate_infinity_base" android:text="@string/emulate_infinity_base"
style="@style/InGameMenuOption" /> style="@style/InGameMenuOption" />