mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-06 02:33:44 -04:00
Cleanup
This commit is contained in:
parent
47004dfa63
commit
580986116f
7 changed files with 11 additions and 33 deletions
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
package org.citra.citra_emu.features.settings.model
|
||||
|
||||
import org.citra.citra_emu.NativeLibrary
|
||||
import org.citra.citra_emu.CitraApplication
|
||||
import org.citra.citra_emu.R
|
||||
|
||||
enum class IntListSetting(
|
||||
override val key: String,
|
||||
|
|
@ -14,17 +15,9 @@ enum class IntListSetting(
|
|||
) : AbstractListSetting<Int> {
|
||||
|
||||
LAYOUTS_TO_CYCLE("layouts_to_cycle", Settings.SECTION_LAYOUT, listOf(0, 1, 2, 3, 4, 5), canBeEmpty = false),
|
||||
COMBO_KEYS("combo_keys", Settings.SECTION_CONTROLS, listOf
|
||||
(NativeLibrary.ButtonType.BUTTON_A,
|
||||
NativeLibrary.ButtonType.BUTTON_B,
|
||||
NativeLibrary.ButtonType.BUTTON_X,
|
||||
NativeLibrary.ButtonType.BUTTON_Y,
|
||||
NativeLibrary.ButtonType.TRIGGER_L,
|
||||
NativeLibrary.ButtonType.TRIGGER_R,
|
||||
NativeLibrary.ButtonType.BUTTON_ZL,
|
||||
NativeLibrary.ButtonType.BUTTON_ZR,
|
||||
NativeLibrary.ButtonType.BUTTON_START,
|
||||
NativeLibrary.ButtonType.BUTTON_SELECT), canBeEmpty = true);
|
||||
COMBO_KEYS("combo_keys", Settings.SECTION_CONTROLS,
|
||||
CitraApplication.appContext.resources.getIntArray(R.array.comboOptionValues).toCollection(ArrayList()),
|
||||
canBeEmpty = true);
|
||||
|
||||
private var backingList: List<Int> = defaultValue
|
||||
private var lastValidList : List<Int> = defaultValue
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ class Settings {
|
|||
const val SECTION_STORAGE = "Storage"
|
||||
const val SECTION_MISC = "Miscellaneous"
|
||||
|
||||
|
||||
const val KEY_BUTTON_A = "button_a"
|
||||
const val KEY_BUTTON_B = "button_b"
|
||||
const val KEY_BUTTON_X = "button_x"
|
||||
|
|
@ -255,4 +254,4 @@ class Settings {
|
|||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,7 +199,6 @@ class SettingsAdapter(
|
|||
SettingsItem.TYPE_SINGLE_CHOICE -> {
|
||||
(oldItem as SingleChoiceSetting).isEnabled == (newItem as SingleChoiceSetting).isEnabled
|
||||
}
|
||||
|
||||
SettingsItem.TYPE_MULTI_CHOICE -> {
|
||||
(oldItem as MultiChoiceSetting).isEnabled == (newItem as MultiChoiceSetting).isEnabled
|
||||
}
|
||||
|
|
@ -721,7 +720,6 @@ class SettingsAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun getSelectionForSingleChoiceValue(item: SingleChoiceSetting): Int {
|
||||
val value = item.selectedValue
|
||||
val valuesId = item.valuesId
|
||||
|
|
@ -754,5 +752,4 @@ class SettingsAdapter(
|
|||
}
|
||||
return BooleanArray(1){false};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -799,6 +799,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
|
|||
onLongClick = { settingsAdapter.onLongClickAutoMap() }
|
||||
)
|
||||
)
|
||||
|
||||
add(HeaderSetting(R.string.generic_buttons))
|
||||
Settings.buttonKeys.forEachIndexed { i: Int, key: String ->
|
||||
val button = getInputObject(key)
|
||||
|
|
@ -839,6 +840,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
|
|||
val button = getInputObject(key)
|
||||
add(InputBindingSetting(button, Settings.hotkeyTitles[i]))
|
||||
}
|
||||
|
||||
add(HeaderSetting(R.string.miscellaneous))
|
||||
add(
|
||||
SwitchSetting(
|
||||
|
|
@ -864,8 +866,6 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun getInputObject(key: String): AbstractStringSetting {
|
||||
return object : AbstractStringSetting {
|
||||
override var string: String
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ object SettingsFile {
|
|||
stringSetting.string = value
|
||||
return stringSetting
|
||||
}
|
||||
|
||||
|
||||
val intListSetting = IntListSetting.from(key)
|
||||
if (intListSetting != null) {
|
||||
intListSetting.list = value.split(", ").mapNotNull { it.toIntOrNull() }
|
||||
|
|
|
|||
|
|
@ -159,7 +159,6 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
|
|||
NativeLibrary.onTouchEvent(0f, 0f, false)
|
||||
break // Up and down actions shouldn't loop
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var anyOverlayStateChanged = false
|
||||
|
|
|
|||
|
|
@ -10,23 +10,13 @@ import org.citra.citra_emu.features.settings.model.IntListSetting
|
|||
object ComboHelper {
|
||||
fun comboActivate(buttonStatus: Int) {
|
||||
val comboArray = IntListSetting.COMBO_KEYS.list
|
||||
// Log.info("Combo Array: $comboArray")
|
||||
for (nativeButton in comboArray) {
|
||||
// Log.info("Native Button: $nativeButton")
|
||||
if (nativeButton == -1)
|
||||
{
|
||||
if (nativeButton == -1) {
|
||||
// We don't want to parse any bad inputs here so we continue loop
|
||||
continue
|
||||
}
|
||||
else
|
||||
{
|
||||
// Log.debug("Handling combo button press: $nativeButton")
|
||||
} else {
|
||||
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, nativeButton, buttonStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue