554593d39a
Some checks failed
suyu-ci / Check REUSE Specification (push) Has been cancelled
suyu verify / Verify Format (push) Has been cancelled
suyu verify / test build (linux-fresh, clang) (push) Has been cancelled
suyu verify / test build (linux-fresh, linux) (push) Has been cancelled
suyu verify / test build (linux-mingw, windows) (push) Has been cancelled
suyu verify / android (push) Has been cancelled
codespell / Check for spelling errors (push) Successful in 12s
Co-authored-by: palfaiate <syl.paulo.alfaiate@gmail.com> Co-authored-by: SylverDiscord51 <p71468162@gmail.com> Co-committed-by: SylverDiscord51 <p71468162@gmail.com>
30 lines
1 KiB
Kotlin
30 lines
1 KiB
Kotlin
// SPDX-FileCopyrightText: 2023 yuzu 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.utils.ParamPackage
|
|
import org.suyu.suyu_emu.features.input.NativeInput
|
|
import org.suyu.suyu_emu.features.input.model.InputType
|
|
import org.suyu.suyu_emu.features.input.model.NativeButton
|
|
|
|
class ButtonInputSetting(
|
|
override val playerIndex: Int,
|
|
val nativeButton: NativeButton,
|
|
@StringRes titleId: Int = 0,
|
|
titleString: String = ""
|
|
) : InputSetting(titleId, titleString) {
|
|
override val type = TYPE_INPUT
|
|
override val inputType = InputType.Button
|
|
|
|
override fun getSelectedValue(): String {
|
|
val params = NativeInput.getButtonParam(playerIndex, nativeButton)
|
|
val button = buttonToText(params)
|
|
return getDisplayString(params, button)
|
|
}
|
|
|
|
override fun setSelectedValue(param: ParamPackage) =
|
|
NativeInput.setButtonParam(playerIndex, nativeButton, param)
|
|
}
|