mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
A drawer on Back: HUD, frame generation, on-screen controls, background, stop
Back used to background the app outright. It now opens a slim panel on the right with the switches a player reaches for mid-game — the performance HUD, the frame-generation picker (shared with the main screen), the on-screen controls' mode (auto / always / never, replacing the file-only override) — and the two things that leave the session: send it to the background, or stop it. Back again, or a tap outside, closes it.
This commit is contained in:
1 parent
3582186951
commit
51303fa342
9 files changed
+260
-42
No files matched your search
@@ -44,7 +44,7 @@ class MainActivity : Activity() {
|
||||
playButton = findViewById(R.id.play)
|
||||
runtimeButton = findViewById(R.id.runtime)
|
||||
frameGenButton = findViewById(R.id.frame_gen)
|
||||
frameGenButton.setOnClickListener { pickFrameGen() }
|
||||
frameGenButton.setOnClickListener { FrameGen.showPicker(this) { render() } }
|
||||
|
||||
playButton.setOnClickListener { startActivity(Intent(this, SessionActivity::class.java)) }
|
||||
runtimeButton.setOnClickListener { onRuntimeButton() }
|
||||
@@ -123,34 +123,6 @@ class MainActivity : Activity() {
|
||||
ui.post { render() }
|
||||
}
|
||||
|
||||
/** Off, or an engine at 2x/3x/4x. Saved, and pushed to a running session on the next resume. */
|
||||
private fun pickFrameGen() {
|
||||
val choices = arrayOf("Off",
|
||||
"Win-FG 2×", "Win-FG 3×", "Win-FG 4×",
|
||||
"LSFG 2× (needs Lossless Scaling)", "LSFG 3× (needs Lossless Scaling)", "LSFG 4× (needs Lossless Scaling)")
|
||||
val engine = FrameGen.engine(this)
|
||||
val current = when (engine) {
|
||||
FrameGen.ENGINE_WINFG -> FrameGen.multiplier(this) - 1
|
||||
FrameGen.ENGINE_LSFG -> FrameGen.multiplier(this) + 2
|
||||
else -> 0
|
||||
}
|
||||
AlertDialog.Builder(this)
|
||||
.setTitle(R.string.frame_gen_title)
|
||||
.setSingleChoiceItems(choices, current) { dialog, which ->
|
||||
when (which) {
|
||||
0 -> FrameGen.set(this, FrameGen.ENGINE_OFF, 2)
|
||||
in 1..3 -> FrameGen.set(this, FrameGen.ENGINE_WINFG, which + 1)
|
||||
else -> FrameGen.set(this, FrameGen.ENGINE_LSFG, which - 2)
|
||||
}
|
||||
dialog.dismiss()
|
||||
render()
|
||||
}
|
||||
.setNeutralButton(android.R.string.ok, null)
|
||||
.setMessage(null)
|
||||
.show()
|
||||
Log.i(TAG, "frame generation picker: " + FrameGen.label(this))
|
||||
}
|
||||
|
||||
private fun render() {
|
||||
frameGenButton.text = getString(R.string.frame_gen, FrameGen.label(this))
|
||||
val installed = LinuxRuntimeInstaller.installedVersion(this)
|
||||
|
||||
Reference in new issue
Block a user