mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
fix: some games never loaded their own Steam touch layout, and the sticks could not be placed (#1058)
This commit is contained in:
1 parent
2f4fe2c5be
commit
400325fa8f
35 files changed
+40
-37
No files matched your search
@@ -211,7 +211,7 @@ object SteamTouchBindings {
|
||||
fun libraryDir(context: Context) = File(SteamTouchConfig.steamRoot(context), "tenfoot/resource/images/library/controller/binding_icons")
|
||||
|
||||
fun gameIconsDir(context: Context, appId: Int): File? = try {
|
||||
val manifest = File(SteamTouchConfig.steamRoot(context), "steamapps/appmanifest_$appId.acf")
|
||||
val manifest = File(SteamTouchConfig.steamRoot(context), "steamapps/appmanifest_${SteamTouchConfig.steamId(appId)}.acf")
|
||||
val installDir = KeyValues.parse(manifest.readText()).let { it.child("AppState") ?: it }.string("installdir")
|
||||
installDir?.let { File(SteamTouchConfig.steamRoot(context), "steamapps/common/$it/TouchMenuIcons") }?.takeIf { it.isDirectory }
|
||||
} catch (_: Exception) {
|
||||
|
||||
@@ -126,7 +126,11 @@ object SteamTouchConfig {
|
||||
}
|
||||
}
|
||||
|
||||
private val DEFAULT_SET = setOf(DPAD, A, B, X, Y, SELECT, START)
|
||||
private val DEFAULT_SET = setOf(
|
||||
JOYSTICK_LEFT, JOYSTICK_LEFT_BUTTON, JOYSTICK_RIGHT, JOYSTICK_RIGHT_BUTTON,
|
||||
DPAD, A, B, X, Y, SELECT, START,
|
||||
BUMPER_LEFT, BUMPER_RIGHT, TRIGGER_LEFT, TRIGGER_RIGHT,
|
||||
)
|
||||
private val ALWAYS = setOf(STEAM, THUMB, KEYBOARD)
|
||||
|
||||
fun steamId(appId: Int): String = Integer.toUnsignedString(appId)
|
||||
|
||||
@@ -301,9 +301,8 @@ class SteamTouchControls(
|
||||
}
|
||||
}
|
||||
SteamTouchConfig.STEAM -> {
|
||||
if (pressed) canvas.drawCircle(x, y, r, fill)
|
||||
canvas.drawCircle(x, y, r, stroke)
|
||||
drawMark(canvas, x, y, r * 0.5f, if (pressed) Color.argb(alpha, 23, 26, 33) else ink, alpha)
|
||||
if (isSelected) canvas.drawCircle(x, y, r, stroke)
|
||||
drawMark(canvas, x, y, r * 0.5f, if (pressed) accent else ink, alpha)
|
||||
}
|
||||
SteamTouchConfig.SELECT, SteamTouchConfig.START -> {
|
||||
val binding = visuals[e.type]?.firstOrNull()?.binding
|
||||
|
||||
Reference in new issue
Block a user