mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-05-20 12:58:19 -04:00
1648d189d3
Co-authored-by: palfaiate <syl.paulo.alfaiate@gmail.com> Co-authored-by: SylverDiscord51 <p71468162@gmail.com> Co-committed-by: SylverDiscord51 <p71468162@gmail.com>
24 lines
853 B
Kotlin
24 lines
853 B
Kotlin
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
|
|
// SPDX-FileCopyrightText: 2024 suyu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
package org.suyu.suyu_emu.features.settings.model.view
|
|
|
|
import androidx.annotation.StringRes
|
|
import org.suyu.suyu_emu.features.settings.model.AbstractStringSetting
|
|
|
|
class StringInputSetting(
|
|
setting: AbstractStringSetting,
|
|
@StringRes titleId: Int = 0,
|
|
titleString: String = "",
|
|
@StringRes descriptionId: Int = 0,
|
|
descriptionString: String = ""
|
|
) : SettingsItem(setting, titleId, titleString, descriptionId, descriptionString) {
|
|
override val type = TYPE_STRING_INPUT
|
|
|
|
fun getSelectedValue(needsGlobal: Boolean = false) = setting.getValueAsString(needsGlobal)
|
|
|
|
fun setSelectedValue(selection: String) =
|
|
(setting as AbstractStringSetting).setString(selection)
|
|
}
|