mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-18 04:49:57 +00:00
android: Add additional check for hasMapping
Controls can have no mapping if they are either "[empty]" or and empty string. This was causing an issue if you reset mapping on all controllers and then tried to play a game. The check to determine whether auto mapping was required would fail and leave you will no mapped controllers. This feels a bit like user error but it smooths things out if you forget so I see it as necessary.
This commit is contained in:
parent
9a3fd76b25
commit
45f450fca5
1 changed files with 3 additions and 3 deletions
|
@ -64,17 +64,17 @@ data class PlayerInput(
|
||||||
fun hasMapping(): Boolean {
|
fun hasMapping(): Boolean {
|
||||||
var hasMapping = false
|
var hasMapping = false
|
||||||
buttons.forEach {
|
buttons.forEach {
|
||||||
if (it != "[empty]") {
|
if (it != "[empty]" && it.isNotEmpty()) {
|
||||||
hasMapping = true
|
hasMapping = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
analogs.forEach {
|
analogs.forEach {
|
||||||
if (it != "[empty]") {
|
if (it != "[empty]" && it.isNotEmpty()) {
|
||||||
hasMapping = true
|
hasMapping = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
motions.forEach {
|
motions.forEach {
|
||||||
if (it != "[empty]") {
|
if (it != "[empty]" && it.isNotEmpty()) {
|
||||||
hasMapping = true
|
hasMapping = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue