diff options
author | Charles Lombardo <clombardo169@gmail.com> | 2023-04-04 19:15:27 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-03 09:05:50 +0200 |
commit | fcbf08ca984e7a0250bf6c0973f4b6071c20209f (patch) | |
tree | a6c1a10ad4e92c0b65f445bdcd768c9bda6782b4 /src/android/app | |
parent | android: Add relative stick center toggle (diff) | |
download | yuzu-fcbf08ca984e7a0250bf6c0973f4b6071c20209f.tar yuzu-fcbf08ca984e7a0250bf6c0973f4b6071c20209f.tar.gz yuzu-fcbf08ca984e7a0250bf6c0973f4b6071c20209f.tar.bz2 yuzu-fcbf08ca984e7a0250bf6c0973f4b6071c20209f.tar.lz yuzu-fcbf08ca984e7a0250bf6c0973f4b6071c20209f.tar.xz yuzu-fcbf08ca984e7a0250bf6c0973f4b6071c20209f.tar.zst yuzu-fcbf08ca984e7a0250bf6c0973f4b6071c20209f.zip |
Diffstat (limited to 'src/android/app')
5 files changed, 14 insertions, 2 deletions
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 79383b1dd..c7e44a0fb 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 @@ -223,6 +223,7 @@ 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.menu.findItem(R.id.menu_dpad_slide).isChecked = EmulationMenuSettings.dpadSlide popup.setOnMenuItemClickListener { when (it.itemId) { @@ -266,6 +267,11 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { EmulationMenuSettings.joystickRelCenter = it.isChecked true } + R.id.menu_dpad_slide -> { + it.isChecked = !it.isChecked + EmulationMenuSettings.dpadSlide = it.isChecked + true + } R.id.menu_reset_overlay -> { binding.drawerLayout.close() resetInputOverlay() diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt index 97e0ba3df..7bff0a9cd 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt @@ -127,7 +127,7 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context } for (dpad in overlayDpads) { - if (!dpad.updateStatus(event, EmulationMenuSettings.dpadSlideEnable)) { + if (!dpad.updateStatus(event, EmulationMenuSettings.dpadSlide)) { continue } NativeLibrary.onGamePadButtonEvent( diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt index e51ac1cc1..021698d15 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt @@ -26,7 +26,7 @@ object EmulationMenuSettings { .putBoolean(Settings.PREF_MENU_SETTINGS_JOYSTICK_REL_CENTER, value) .apply() } - var dpadSlideEnable: Boolean + var dpadSlide: Boolean get() = preferences.getBoolean(Settings.PREF_MENU_SETTINGS_DPAD_SLIDE, true) set(value) { preferences.edit() 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 151f305fb..36c710f14 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 @@ -15,6 +15,11 @@ android:checkable="true" /> <item + android:id="@+id/menu_dpad_slide" + android:title="@string/emulation_dpad_slide" + android:checkable="true" /> + + <item android:id="@+id/menu_reset_overlay" android:title="@string/emulation_touch_overlay_reset" /> diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 441d88978..70bff5749 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -88,6 +88,7 @@ <string name="emulation_done">Done</string> <string name="emulation_toggle_controls">Toggle Controls</string> <string name="emulation_rel_stick_center">Relative Stick Center</string> + <string name="emulation_dpad_slide">DPad Slide</string> <string name="emulation_toggle_all">Toggle All</string> <string name="emulation_control_scale">Adjust Scale</string> <string name="emulation_touch_overlay_reset">Reset Overlay</string> |