Add header descriptions for dpad axis and buttons

This commit is contained in:
David Griswold 2024-09-23 18:14:39 -03:00
parent 6335cb6155
commit 06a728ae98
3 changed files with 4 additions and 11 deletions

View file

@ -78,15 +78,6 @@ class InputBindingSetting(
else -> false else -> false
} }
fun isDpadButtons(): Boolean =
when (abstractSetting.key) {
Settings.KEY_BUTTON_DOWN,
Settings.KEY_BUTTON_LEFT,
Settings.KEY_BUTTON_UP,
Settings.KEY_BUTTON_RIGHT -> true
else -> false
}
/** /**
* Returns true if this key is for the 3DS L/R or ZL/ZR buttons. Note, these are not real * Returns true if this key is for the 3DS L/R or ZL/ZR buttons. Note, these are not real
* triggers on the 3DS, but we support them as such on a physical gamepad. * triggers on the 3DS, but we support them as such on a physical gamepad.

View file

@ -621,12 +621,12 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
add(InputBindingSetting(button, Settings.axisTitles[i])) add(InputBindingSetting(button, Settings.axisTitles[i]))
} }
add(HeaderSetting(R.string.controller_dpad_axis)) add(HeaderSetting(R.string.controller_dpad_axis,R.string.controller_dpad_axis_description))
Settings.dPadAxisKeys.forEachIndexed { i: Int, key: String -> Settings.dPadAxisKeys.forEachIndexed { i: Int, key: String ->
val button = getInputObject(key) val button = getInputObject(key)
add(InputBindingSetting(button, Settings.axisTitles[i])) add(InputBindingSetting(button, Settings.axisTitles[i]))
} }
add(HeaderSetting(R.string.controller_dpad_button)) add(HeaderSetting(R.string.controller_dpad_button,R.string.controller_dpad_button_description))
Settings.dPadButtonKeys.forEachIndexed { i: Int, key: String -> Settings.dPadButtonKeys.forEachIndexed { i: Int, key: String ->
val button = getInputObject(key) val button = getInputObject(key)
add(InputBindingSetting(button, Settings.dPadTitles[i])) add(InputBindingSetting(button, Settings.dPadTitles[i]))

View file

@ -109,7 +109,9 @@
<string name="controller_trigger">Trigger</string> <string name="controller_trigger">Trigger</string>
<string name="controller_dpad">D-Pad</string> <string name="controller_dpad">D-Pad</string>
<string name="controller_dpad_axis">D-Pad (Axis)</string> <string name="controller_dpad_axis">D-Pad (Axis)</string>
<string name="controller_dpad_axis_description">Some controllers will not be able to map their dpad as an axis. In that case, use the D-Pad (buttons) section below instead.</string>
<string name="controller_dpad_button">D-Pad (Buttons)</string> <string name="controller_dpad_button">D-Pad (Buttons)</string>
<string name="controller_dpad_button_description">Only map these buttons if the D-Pad (Axis) settings above do not work with your controller.</string>
<string name="controller_axis_vertical">Up/Down Axis</string> <string name="controller_axis_vertical">Up/Down Axis</string>
<string name="controller_axis_horizontal">Left/Right Axis</string> <string name="controller_axis_horizontal">Left/Right Axis</string>
<string name="direction_up">Up</string> <string name="direction_up">Up</string>