Only hide validation_layer setting on release instead of debug category

This commit is contained in:
lynxnb 2023-02-24 12:36:38 +01:00 committed by Niccolò Betto
parent b2228a93da
commit 485bd2031c
3 changed files with 16 additions and 6 deletions

View File

@ -62,10 +62,10 @@ class GameSettingsFragment : PreferenceFragmentCompat() {
true
}
// Only show debug settings in debug builds
// Only show validation layer setting in debug builds
@Suppress("SENSELESS_COMPARISON")
if (BuildConfig.BUILD_TYPE != "release")
findPreference<Preference>("category_debug")?.isVisible = true
findPreference<Preference>("validation_layer")?.isVisible = true
if (!GpuDriverHelper.supportsForceMaxGpuClocks()) {
val forceMaxGpuClocksPref = findPreference<CheckBoxPreference>("force_max_gpu_clocks")!!
@ -75,6 +75,16 @@ class GameSettingsFragment : PreferenceFragmentCompat() {
}
findPreference<GpuDriverPreference>("gpu_driver")?.item = item
// Hide settings that don't support per-game configuration
findPreference<Preference>("profile_picture_value")?.isVisible = false
findPreference<Preference>("log_level")?.isVisible = false
// TODO: remove this once we have more settings under the debug category
// Avoid showing the debug category if no settings under it are visible
@Suppress("SENSELESS_COMPARISON")
if (BuildConfig.BUILD_TYPE == "release")
findPreference<PreferenceCategory>("category_debug")?.isVisible = false
}
override fun onDisplayPreferenceDialog(preference : Preference) {

View File

@ -48,10 +48,10 @@ class GlobalSettingsFragment : PreferenceFragmentCompat() {
true
}
// Only show debug settings in debug builds
// Only show validation layer setting in debug builds
@Suppress("SENSELESS_COMPARISON")
if (BuildConfig.BUILD_TYPE != "release")
findPreference<Preference>("category_debug")?.isVisible = true
findPreference<Preference>("validation_layer")?.isVisible = true
if (!GpuDriverHelper.supportsForceMaxGpuClocks()) {
val forceMaxGpuClocksPref = findPreference<CheckBoxPreference>("force_max_gpu_clocks")!!

View File

@ -155,8 +155,7 @@
</PreferenceCategory>
<PreferenceCategory
android:key="category_debug"
android:title="@string/debug"
app:isPreferenceVisible="false">
android:title="@string/debug">
<emu.skyline.preference.LogLevelPreference
android:defaultValue="2"
android:entries="@array/log_level"
@ -168,6 +167,7 @@
android:summaryOff="@string/validation_layer_disabled"
android:summaryOn="@string/validation_layer_enabled"
app:key="validation_layer"
app:isPreferenceVisible="false"
app:title="@string/validation_layer" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>