From bebc822334bf0e974b161771acec720956acac46 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Tue, 4 Apr 2023 13:10:17 -0400 Subject: [PATCH] android: Add relative stick center toggle --- .../java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt | 7 +++++++ src/android/app/src/main/res/menu/menu_overlay_options.xml | 5 +++++ src/android/app/src/main/res/values/strings.xml | 1 + 3 files changed, 13 insertions(+) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt index 1d4641d5c0..79383b1dd5 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt @@ -222,6 +222,8 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { popup.menuInflater.inflate(R.menu.menu_overlay_options, popup.menu) + popup.menu.findItem(R.id.menu_rel_stick_center).isChecked = EmulationMenuSettings.joystickRelCenter + popup.setOnMenuItemClickListener { when (it.itemId) { R.id.menu_edit_overlay -> { @@ -259,6 +261,11 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { true } + R.id.menu_rel_stick_center -> { + it.isChecked = !it.isChecked + EmulationMenuSettings.joystickRelCenter = it.isChecked + true + } R.id.menu_reset_overlay -> { binding.drawerLayout.close() resetInputOverlay() diff --git a/src/android/app/src/main/res/menu/menu_overlay_options.xml b/src/android/app/src/main/res/menu/menu_overlay_options.xml index b9341c5081..151f305fb6 100644 --- a/src/android/app/src/main/res/menu/menu_overlay_options.xml +++ b/src/android/app/src/main/res/menu/menu_overlay_options.xml @@ -9,6 +9,11 @@ android:id="@+id/menu_toggle_controls" android:title="@string/emulation_toggle_controls" /> + + diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 98a06c45d0..441d889785 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -87,6 +87,7 @@ Exit Emulation Done Toggle Controls + Relative Stick Center Toggle All Adjust Scale Reset Overlay