From d1867be6eb13b228e181d27c92919f6c97a1994b Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Fri, 11 Sep 2026 00:23:01 -0400 Subject: [PATCH] More changes to UI. --- .../yuzu/yuzu_emu/dialogs/QuickSettings.kt | 56 +++++-- .../layout/item_quick_settings_frame_gen.xml | 141 ++++++++++++------ .../app/src/main/res/values/arrays.xml | 6 + .../app/src/main/res/values/strings.xml | 4 + 4 files changed, 147 insertions(+), 60 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/dialogs/QuickSettings.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/dialogs/QuickSettings.kt index 6aab69db72..c2ef683cfd 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/dialogs/QuickSettings.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/dialogs/QuickSettings.kt @@ -687,8 +687,9 @@ class QuickSettings(val emulationFragment: EmulationFragment) { val multiplierRow = itemView.findViewById(R.id.frame_gen_multipliers) val targetRow = itemView.findViewById(R.id.frame_gen_targets) - val motionView = itemView.findViewById(R.id.frame_gen_motion) - val motionSwitch = itemView.findViewById(R.id.frame_gen_motion_switch) + val targetSection = itemView.findViewById(R.id.frame_gen_target_section) + val flowRow = itemView.findViewById(R.id.frame_gen_flow) + val flowSection = itemView.findViewById(R.id.frame_gen_flow_section) val multiplierNames = emulationFragment.resources.getStringArray(R.array.frameGenMultiplierNames) @@ -696,10 +697,17 @@ class QuickSettings(val emulationFragment: EmulationFragment) { emulationFragment.resources.getIntArray(R.array.frameGenMultiplierValues) val targetValues = emulationFragment.resources.getIntArray(R.array.frameGenTargetRateValues) + val flowValues = + emulationFragment.resources.getIntArray(R.array.frameGenFlowScaleValues) - val columns = maxOf(multiplierValues.size + 1, targetValues.size).toFloat() + val columns = maxOf( + multiplierValues.size + 1, + targetValues.size, + flowValues.size + 1 + ).toFloat() multiplierRow.weightSum = columns targetRow.weightSum = columns + flowRow.weightSum = columns val powerCell = addFrameGenCell(inflater, multiplierRow) @@ -721,6 +729,16 @@ class QuickSettings(val emulationFragment: EmulationFragment) { targetCells.add(cell) } + val autoCell = addFrameGenCell(inflater, flowRow) + autoCell.setText(R.string.frame_gen_flow_auto) + + val flowCells = mutableListOf() + for (value in flowValues) { + val cell = addFrameGenCell(inflater, flowRow) + cell.text = "$value%" + flowCells.add(cell) + } + val inactiveAlpha = 0.38f fun refresh() { @@ -728,6 +746,9 @@ class QuickSettings(val emulationFragment: EmulationFragment) { val multiplier = IntSetting.RENDERER_FRAME_GEN_MULTIPLIER.getInt(needsGlobal = false) val target = IntSetting.RENDERER_FRAME_GEN_TARGET_RATE.getInt(needsGlobal = false) val fixed = target == 0 + val flowAuto = + BooleanSetting.RENDERER_FRAME_GEN_FLOW_SCALE_AUTO.getBoolean(needsGlobal = false) + val flowScale = IntSetting.RENDERER_FRAME_GEN_FLOW_SCALE.getInt(needsGlobal = false) var powerLabel = R.string.frame_gen_off var rowAlpha = inactiveAlpha @@ -750,15 +771,20 @@ class QuickSettings(val emulationFragment: EmulationFragment) { cell.alpha = multiplierAlpha } + targetSection.alpha = rowAlpha targetCells.forEachIndexed { index, cell -> cell.isEnabled = enabled cell.isSelected = enabled && targetValues[index] == target - cell.alpha = rowAlpha } - motionView.isEnabled = enabled - motionSwitch.isEnabled = enabled - motionView.alpha = rowAlpha + flowSection.alpha = rowAlpha + autoCell.isEnabled = enabled + autoCell.isSelected = enabled && flowAuto + + flowCells.forEachIndexed { index, cell -> + cell.isEnabled = enabled + cell.isSelected = enabled && !flowAuto && flowValues[index] == flowScale + } } powerCell.setOnClickListener { @@ -790,15 +816,19 @@ class QuickSettings(val emulationFragment: EmulationFragment) { } } - motionSwitch.isChecked = - BooleanSetting.RENDERER_FRAME_GEN_FLOW_SCALE_AUTO.getBoolean(needsGlobal = false) - motionSwitch.setOnCheckedChangeListener { _, checked -> - BooleanSetting.RENDERER_FRAME_GEN_FLOW_SCALE_AUTO.setBoolean(checked) + autoCell.setOnClickListener { + BooleanSetting.RENDERER_FRAME_GEN_FLOW_SCALE_AUTO.setBoolean(true) saveSettings() + refresh() } - motionView.setOnClickListener { - motionSwitch.toggle() + flowCells.forEachIndexed { index, cell -> + cell.setOnClickListener { + IntSetting.RENDERER_FRAME_GEN_FLOW_SCALE.setInt(flowValues[index]) + BooleanSetting.RENDERER_FRAME_GEN_FLOW_SCALE_AUTO.setBoolean(false) + saveSettings() + refresh() + } } refresh() diff --git a/src/android/app/src/main/res/layout/item_quick_settings_frame_gen.xml b/src/android/app/src/main/res/layout/item_quick_settings_frame_gen.xml index d02e5b5eb3..e5f8baa3d3 100644 --- a/src/android/app/src/main/res/layout/item_quick_settings_frame_gen.xml +++ b/src/android/app/src/main/res/layout/item_quick_settings_frame_gen.xml @@ -2,62 +2,109 @@ - - + android:orientation="vertical"> - - - - + android:orientation="vertical" + android:paddingStart="24dp" + android:paddingEnd="18dp" + android:paddingTop="12dp" + android:paddingBottom="8dp"> + android:layout_marginEnd="6dp" + android:text="@string/frame_gen" /> - + android:layout_marginTop="4dp" + android:layout_marginEnd="6dp" + android:text="@string/frame_gen_quick_description" + android:textColor="?attr/colorOnSurfaceVariant" /> + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index 7c06edcd5a..b3aed5758c 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml @@ -183,6 +183,12 @@ 120 + + 50 + 75 + 100 + + @string/frame_gen_queue_target_0 @string/frame_gen_queue_target_1 diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 1cf2948c41..8f5b905dd2 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -334,6 +334,10 @@ On Off Fixed + Auto + Turn frame generation on or off and choose the frame multiplier. + Generate frames up to a target frame rate. The multiplier adjusts on its own. + Resolution used to estimate motion between frames. Lower values save GPU time. Frame queue target How many finished frames may wait ahead of the display. Larger queues absorb GPU spikes at the cost of input latency. Lowest latency (Unbuffered)