android: Add relative stick center toggle

This commit is contained in:
Charles Lombardo 2023-04-04 13:10:17 -04:00 committed by bunnei
parent 63819af214
commit bebc822334
3 changed files with 13 additions and 0 deletions

View file

@ -222,6 +222,8 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
popup.menuInflater.inflate(R.menu.menu_overlay_options, popup.menu) popup.menuInflater.inflate(R.menu.menu_overlay_options, popup.menu)
popup.menu.findItem(R.id.menu_rel_stick_center).isChecked = EmulationMenuSettings.joystickRelCenter
popup.setOnMenuItemClickListener { popup.setOnMenuItemClickListener {
when (it.itemId) { when (it.itemId) {
R.id.menu_edit_overlay -> { R.id.menu_edit_overlay -> {
@ -259,6 +261,11 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
true true
} }
R.id.menu_rel_stick_center -> {
it.isChecked = !it.isChecked
EmulationMenuSettings.joystickRelCenter = it.isChecked
true
}
R.id.menu_reset_overlay -> { R.id.menu_reset_overlay -> {
binding.drawerLayout.close() binding.drawerLayout.close()
resetInputOverlay() resetInputOverlay()

View file

@ -9,6 +9,11 @@
android:id="@+id/menu_toggle_controls" android:id="@+id/menu_toggle_controls"
android:title="@string/emulation_toggle_controls" /> android:title="@string/emulation_toggle_controls" />
<item
android:id="@+id/menu_rel_stick_center"
android:title="@string/emulation_rel_stick_center"
android:checkable="true" />
<item <item
android:id="@+id/menu_reset_overlay" android:id="@+id/menu_reset_overlay"
android:title="@string/emulation_touch_overlay_reset" /> android:title="@string/emulation_touch_overlay_reset" />

View file

@ -87,6 +87,7 @@
<string name="emulation_exit">Exit Emulation</string> <string name="emulation_exit">Exit Emulation</string>
<string name="emulation_done">Done</string> <string name="emulation_done">Done</string>
<string name="emulation_toggle_controls">Toggle Controls</string> <string name="emulation_toggle_controls">Toggle Controls</string>
<string name="emulation_rel_stick_center">Relative Stick Center</string>
<string name="emulation_toggle_all">Toggle All</string> <string name="emulation_toggle_all">Toggle All</string>
<string name="emulation_control_scale">Adjust Scale</string> <string name="emulation_control_scale">Adjust Scale</string>
<string name="emulation_touch_overlay_reset">Reset Overlay</string> <string name="emulation_touch_overlay_reset">Reset Overlay</string>