|
@@ -7,20 +7,20 @@ import org.yuzu.yuzu_emu.features.settings.model.AbstractSetting
|
|
|
import org.yuzu.yuzu_emu.features.settings.model.AbstractStringSetting
|
|
import org.yuzu.yuzu_emu.features.settings.model.AbstractStringSetting
|
|
|
|
|
|
|
|
class StringSingleChoiceSetting(
|
|
class StringSingleChoiceSetting(
|
|
|
- val key: String? = null,
|
|
|
|
|
setting: AbstractSetting?,
|
|
setting: AbstractSetting?,
|
|
|
titleId: Int,
|
|
titleId: Int,
|
|
|
descriptionId: Int,
|
|
descriptionId: Int,
|
|
|
- val choicesId: Array<String>,
|
|
|
|
|
- private val valuesId: Array<String>?,
|
|
|
|
|
|
|
+ val choices: Array<String>,
|
|
|
|
|
+ val values: Array<String>?,
|
|
|
|
|
+ val key: String? = null,
|
|
|
private val defaultValue: String? = null
|
|
private val defaultValue: String? = null
|
|
|
) : SettingsItem(setting, titleId, descriptionId) {
|
|
) : SettingsItem(setting, titleId, descriptionId) {
|
|
|
override val type = TYPE_STRING_SINGLE_CHOICE
|
|
override val type = TYPE_STRING_SINGLE_CHOICE
|
|
|
|
|
|
|
|
fun getValueAt(index: Int): String? {
|
|
fun getValueAt(index: Int): String? {
|
|
|
- if (valuesId == null) return null
|
|
|
|
|
- return if (index >= 0 && index < valuesId.size) {
|
|
|
|
|
- valuesId[index]
|
|
|
|
|
|
|
+ if (values == null) return null
|
|
|
|
|
+ return if (index >= 0 && index < values.size) {
|
|
|
|
|
+ values[index]
|
|
|
} else {
|
|
} else {
|
|
|
""
|
|
""
|
|
|
}
|
|
}
|
|
@@ -36,8 +36,8 @@ class StringSingleChoiceSetting(
|
|
|
val selectValueIndex: Int
|
|
val selectValueIndex: Int
|
|
|
get() {
|
|
get() {
|
|
|
val selectedValue = selectedValue
|
|
val selectedValue = selectedValue
|
|
|
- for (i in valuesId!!.indices) {
|
|
|
|
|
- if (valuesId[i] == selectedValue) {
|
|
|
|
|
|
|
+ for (i in values!!.indices) {
|
|
|
|
|
+ if (values[i] == selectedValue) {
|
|
|
return i
|
|
return i
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|