Offer the mode default in the in-game profile list for all games

This commit is contained in:
Kurt Himebauch committed 2026-12-04 16:56:36 -05:00
1 parent 5bad82d736
commit 1f9064ad59
2 files changed
+5 -3

No files matched your search

@@ -66,7 +66,7 @@ internal val sampleActions: FrontEndActions = FrontEndActions(
/** The in-game menu's actions with settled sample values; its switches do nothing. */
internal fun sampleDrawerActions(
steam: Boolean = true, desktop: Boolean = false, secondScreen: SecondScreenMode? = null,
steam: Boolean = true, desktop: Boolean = false, secondScreen: SecondScreenMode? = null, inputGame: Pair<String, String>? = null,
): DrawerActions = DrawerActions(
steam = steam, desktop = desktop, title = if (!steam && !desktop) "Hades" else null,
isHomeApp = false, androidApps = emptyList(),
@@ -85,4 +85,5 @@ internal fun sampleDrawerActions(
onKeyboard = {}, onHardwareKeyboard = {},
onSteamMenu = if (steam) ({}) else null, onQam = if (steam) ({}) else null,
onLaunchAndroidApp = { _, _ -> }, onBackground = {}, onShareLogs = {}, onStop = {}, onClose = {},
inputGame = inputGame, onEditLayout = {},
)
@@ -54,8 +54,9 @@ internal fun DrawerControlsGroup(host: MenuHost, a: DrawerActions, track: (Strin
val named = library.profiles.map { it.id to profileLabel(context, it) }
// For one game the first choice follows whatever all games use; for all games the profile itself is the choice.
val profiles = if (gameScope) listOf(InputProfiles.AUTO to stringResource(R.string.flow_same_as_all,
profileLabel(context, library.profile(library.activeId(a.desktop))))) + named else named
val selected = if (gameScope) own?.profile ?: InputProfiles.AUTO else library.activeId(a.desktop)
profileLabel(context, library.profile(library.activeId(a.desktop))))) + named
else listOf(InputProfiles.AUTO to stringResource(R.string.flow_default_profile, profileLabel(context, library.profile(library.defaultId(a.desktop))))) + named
val selected = if (gameScope) own?.profile ?: InputProfiles.AUTO else library.selection(a.desktop).profile
val detail = listOfNotNull(profileLabel(context, active), if (changes > 0 && game != null) stringResource(R.string.flow_game_changes, game.second, changes) else null).joinToString(" · ")
SettingsGroup(stringResource(R.string.flow_controls), key = "controller-input", detail = detail) {
if (game != null) ChoiceRow(host, "input-scope", stringResource(R.string.flow_apply_to), null,