android: add ability to disable yapb bots from our settings page

This commit is contained in:
Alibek Omarov
2026-03-25 00:51:21 +05:00
parent d85d813d62
commit 81fc511f0a
2 changed files with 15 additions and 1 deletions

View File

@@ -20,6 +20,12 @@ class GameSettingsPreferenceFragment(val game: Game) : PreferenceFragmentCompat(
packageList.setValueIndex(0);
}
if (game.basedir.name.equals("cstrike", ignoreCase = true)
|| game.basedir.name.equals("czero", ignoreCase = true)) {
val enableYaPBBots = findPreference<SwitchPreferenceCompat>("enable_yapb_bots")!!
enableYaPBBots.isVisible = true
}
val separatePackages = findPreference<SwitchPreferenceCompat>("separate_libraries")!!
val clientPackage = findPreference<ListPreference>("client_package")!!
val serverPackage = findPreference<ListPreference>("server_package")!!

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<EditTextPreference
app:defaultValue="-console -log"
app:key="arguments"
@@ -12,6 +13,13 @@
app:layout="@layout/switch_preference"
app:title="@string/game_settings_volume_buttons" />
<SwitchPreferenceCompat
app:key="enable_yapb_bots"
app:layout="@layout/switch_preference"
app:title="@string/game_settings_yapb_bots"
app:defaultValue="true"
app:isPreferenceVisible="false" />
<SwitchPreferenceCompat
app:key="separate_libraries"
app:layout="@layout/switch_preference"