mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
Replace Back inversion toggle with order menu
This commit is contained in:
1 parent
c013252a59
commit
d567185fc0
4 files changed
+25
-15
No files matched your search
@@ -13,6 +13,12 @@ object SessionPrefs {
|
|||||||
const val OSC_STEAM_QAM = "steam-qam"
|
const val OSC_STEAM_QAM = "steam-qam"
|
||||||
const val OSC_NEVER = "never"
|
const val OSC_NEVER = "never"
|
||||||
|
|
||||||
|
const val BACK_MENU_THEN_QAM = "1: menu 2: QAM"
|
||||||
|
const val BACK_QAM_THEN_MENU = "1: QAM 2: menu"
|
||||||
|
|
||||||
|
fun backActionsOrder(inverted: Boolean): String =
|
||||||
|
if (inverted) BACK_QAM_THEN_MENU else BACK_MENU_THEN_QAM
|
||||||
|
|
||||||
private fun prefs(context: Context) = context.getSharedPreferences("session", Context.MODE_PRIVATE)
|
private fun prefs(context: Context) = context.getSharedPreferences("session", Context.MODE_PRIVATE)
|
||||||
|
|
||||||
fun hudEnabled(context: Context): Boolean = prefs(context).getBoolean("hud", true)
|
fun hudEnabled(context: Context): Boolean = prefs(context).getBoolean("hud", true)
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ import coil.compose.AsyncImage
|
|||||||
import com.steamdeck.launcher.R
|
import com.steamdeck.launcher.R
|
||||||
import com.steamdeck.launcher.frontend.Library
|
import com.steamdeck.launcher.frontend.Library
|
||||||
import com.steamdeck.launcher.gpu.FrameGen
|
import com.steamdeck.launcher.gpu.FrameGen
|
||||||
|
import com.steamdeck.launcher.session.SessionPrefs
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
@@ -694,11 +695,12 @@ private fun SetupPanel(s: FrontEndState, a: FrontEndActions) {
|
|||||||
ActionRow("ROMs folder", s.romsDir ?: "Choose where emulator games are stored", "Choose", a.onRoms)
|
ActionRow("ROMs folder", s.romsDir ?: "Choose where emulator games are stored", "Choose", a.onRoms)
|
||||||
}
|
}
|
||||||
SettingsGroup("Session") {
|
SettingsGroup("Session") {
|
||||||
ToggleRow(
|
ChoiceRow(
|
||||||
host, "back-actions", "Invert Back actions",
|
host, "back-actions", "Back", SessionPrefs.backActionsOrder(s.backActionsInverted),
|
||||||
if (s.backActionsInverted) "Back once opens Steam QAM; twice opens the in-session menu."
|
listOf(
|
||||||
else "Back once opens the in-session menu; twice opens Steam QAM.",
|
false to SessionPrefs.BACK_MENU_THEN_QAM,
|
||||||
s.backActionsInverted, onChange = a.onBackActionsInverted,
|
true to SessionPrefs.BACK_QAM_THEN_MENU,
|
||||||
|
), s.backActionsInverted, onPick = a.onBackActionsInverted,
|
||||||
)
|
)
|
||||||
SettingsRow("Frame generation", "Select the frame generation mode") {
|
SettingsRow("Frame generation", "Select the frame generation mode") {
|
||||||
Box {
|
Box {
|
||||||
|
|||||||
@@ -229,11 +229,12 @@ fun ModeSettingsPage(s: ModeSettings, a: ModeSettingsActions) {
|
|||||||
), s.oscMode,
|
), s.oscMode,
|
||||||
note = "Auto shows all controls without a controller. Steam + QAM shows only those buttons.", onPick = a.onOsc,
|
note = "Auto shows all controls without a controller. Steam + QAM shows only those buttons.", onPick = a.onOsc,
|
||||||
)
|
)
|
||||||
if (steam) ToggleRow(
|
if (steam) ChoiceRow(
|
||||||
host, "back-actions", "Invert Back actions",
|
host, "back-actions", "Back", SessionPrefs.backActionsOrder(s.backActionsInverted),
|
||||||
if (s.backActionsInverted) "Back once opens Steam QAM; twice opens the session menu."
|
listOf(
|
||||||
else "Back once opens the session menu; twice opens Steam QAM.",
|
false to SessionPrefs.BACK_MENU_THEN_QAM,
|
||||||
s.backActionsInverted, onChange = a.onBackActionsInverted,
|
true to SessionPrefs.BACK_QAM_THEN_MENU,
|
||||||
|
), s.backActionsInverted, onPick = a.onBackActionsInverted,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
SettingsGroup("Session") {
|
SettingsGroup("Session") {
|
||||||
|
|||||||
@@ -298,11 +298,12 @@ fun SessionDrawer(open: Boolean, a: DrawerActions) {
|
|||||||
listOf(SessionPrefs.OSC_AUTO to "Auto", SessionPrefs.OSC_ALWAYS to "Always", SessionPrefs.OSC_STEAM_QAM to "Steam + QAM", SessionPrefs.OSC_NEVER to "Never"), a.oscMode,
|
listOf(SessionPrefs.OSC_AUTO to "Auto", SessionPrefs.OSC_ALWAYS to "Always", SessionPrefs.OSC_STEAM_QAM to "Steam + QAM", SessionPrefs.OSC_NEVER to "Never"), a.oscMode,
|
||||||
onPick = a.onOsc,
|
onPick = a.onOsc,
|
||||||
)
|
)
|
||||||
if (a.steam) ToggleRow(
|
if (a.steam) ChoiceRow(
|
||||||
host, "back-actions", "Invert Back actions",
|
host, "back-actions", "Back", SessionPrefs.backActionsOrder(a.backActionsInverted),
|
||||||
if (a.backActionsInverted) "Back once opens Steam QAM; twice opens the session menu."
|
listOf(
|
||||||
else "Back once opens the session menu; twice opens Steam QAM.",
|
false to SessionPrefs.BACK_MENU_THEN_QAM,
|
||||||
a.backActionsInverted, onChange = a.onBackActionsInverted,
|
true to SessionPrefs.BACK_QAM_THEN_MENU,
|
||||||
|
), a.backActionsInverted, onPick = a.onBackActionsInverted,
|
||||||
)
|
)
|
||||||
ActionRow("Keyboard", null, "Show") { host.open = null; a.onKeyboard() }
|
ActionRow("Keyboard", null, "Show") { host.open = null; a.onKeyboard() }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user