mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-05 18:23:39 -04:00
Changed Combo Key to Combo Button in kotlin code (will need to test)
This commit is contained in:
parent
f1d9851786
commit
36f458552c
8 changed files with 16 additions and 20 deletions
|
|
@ -13,5 +13,5 @@ enum class Hotkey(val button: Int) {
|
|||
QUICKLOAD(10006),
|
||||
TURBO_LIMIT(10007),
|
||||
ENABLE(10008),
|
||||
COMBO_KEY(10009);
|
||||
COMBO_BUTTON(10009);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import org.citra.citra_emu.utils.ComboHelper
|
|||
import org.citra.citra_emu.display.ScreenAdjustmentUtil
|
||||
import org.citra.citra_emu.features.settings.model.view.InputBindingSetting
|
||||
import org.citra.citra_emu.features.settings.model.Settings
|
||||
import org.citra.citra_emu.utils.Log
|
||||
|
||||
class HotkeyUtility(
|
||||
private val screenAdjustmentUtil: ScreenAdjustmentUtil,
|
||||
|
|
@ -111,7 +110,7 @@ class HotkeyUtility(
|
|||
|
||||
fun handleHotkeyRelease(bindedButton: Int): Boolean {
|
||||
// Log.debug("Handling hotkey button release: " + bindedButton)
|
||||
if (bindedButton == Hotkey.COMBO_KEY.button) {
|
||||
if (bindedButton == Hotkey.COMBO_BUTTON.button) {
|
||||
ComboHelper.comboActivate(NativeLibrary.ButtonState.RELEASED)
|
||||
}
|
||||
return true
|
||||
|
|
@ -145,7 +144,7 @@ class HotkeyUtility(
|
|||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
Hotkey.COMBO_KEY.button -> {
|
||||
Hotkey.COMBO_BUTTON.button -> {
|
||||
ComboHelper.comboActivate(NativeLibrary.ButtonState.PRESSED)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ enum class IntListSetting(
|
|||
) : AbstractListSetting<Int> {
|
||||
|
||||
LAYOUTS_TO_CYCLE(SettingKeys.layouts_to_cycle(), Settings.SECTION_LAYOUT, listOf(0, 1, 2, 3, 4, 5), canBeEmpty = false),
|
||||
COMBO_KEYS("combo_keys", Settings.SECTION_CONTROLS,
|
||||
COMBO_BUTTONS("combo_buttons", Settings.SECTION_CONTROLS,
|
||||
CitraApplication.appContext.resources.getIntArray(R.array.comboOptionValues).toCollection(ArrayList()),
|
||||
canBeEmpty = true);
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class InputBindingSetting(
|
|||
Settings.HOTKEY_QUICKSAVE -> Hotkey.QUICKSAVE.button
|
||||
Settings.HOTKEY_QUICKlOAD -> Hotkey.QUICKLOAD.button
|
||||
Settings.HOTKEY_TURBO_LIMIT -> Hotkey.TURBO_LIMIT.button
|
||||
Settings.HOTKEY_BUTTON_COMBO -> Hotkey.COMBO_KEY.button
|
||||
Settings.HOTKEY_BUTTON_COMBO -> Hotkey.COMBO_BUTTON.button
|
||||
else -> -1
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import android.os.Build
|
|||
import android.text.TextUtils
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import kotlinx.serialization.builtins.IntArraySerializer
|
||||
import org.citra.citra_emu.CitraApplication
|
||||
import org.citra.citra_emu.R
|
||||
import org.citra.citra_emu.display.ScreenLayout
|
||||
|
|
@ -854,13 +853,13 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
|
|||
|
||||
add(
|
||||
MultiChoiceSetting(
|
||||
IntListSetting.COMBO_KEYS,
|
||||
IntListSetting.COMBO_BUTTONS,
|
||||
R.string.combo_key_options,
|
||||
R.string.combo_key_description,
|
||||
R.array.comboOptions,
|
||||
R.array.comboOptionValues,
|
||||
IntListSetting.COMBO_KEYS.key,
|
||||
IntListSetting.COMBO_KEYS.defaultValue
|
||||
IntListSetting.COMBO_BUTTONS.key,
|
||||
IntListSetting.COMBO_BUTTONS.defaultValue
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ import org.citra.citra_emu.display.ScreenLayout
|
|||
import org.citra.citra_emu.features.hotkeys.Hotkey
|
||||
import org.citra.citra_emu.features.settings.model.BooleanSetting
|
||||
import org.citra.citra_emu.features.settings.model.IntSetting
|
||||
import org.citra.citra_emu.features.settings.model.Settings
|
||||
import org.citra.citra_emu.features.settings.model.SettingsViewModel
|
||||
import org.citra.citra_emu.features.settings.ui.SettingsActivity
|
||||
import org.citra.citra_emu.features.settings.utils.SettingsFile
|
||||
|
|
@ -79,7 +78,6 @@ import org.citra.citra_emu.utils.BuildUtil
|
|||
import org.citra.citra_emu.utils.DirectoryInitialization
|
||||
import org.citra.citra_emu.utils.DirectoryInitialization.DirectoryInitializationState
|
||||
import org.citra.citra_emu.utils.EmulationMenuSettings
|
||||
import org.citra.citra_emu.utils.FileUtil
|
||||
import org.citra.citra_emu.utils.GameHelper
|
||||
import org.citra.citra_emu.utils.GameIconUtils
|
||||
import org.citra.citra_emu.utils.EmulationLifecycleUtil
|
||||
|
|
@ -836,7 +834,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
|
|||
}
|
||||
|
||||
R.id.menu_emulation_adjust_scale_button_combo -> {
|
||||
showAdjustScaleDialog("controlScale-" + Hotkey.COMBO_KEY.button)
|
||||
showAdjustScaleDialog("controlScale-" + Hotkey.COMBO_BUTTON.button)
|
||||
true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
|
|||
else if (button.id == NativeLibrary.ButtonType.BUTTON_TURBO && button.status == NativeLibrary.ButtonState.PRESSED) {
|
||||
TurboHelper.toggleTurbo(true)
|
||||
}
|
||||
else if (button.id == Hotkey.COMBO_KEY.button && button.status == NativeLibrary.ButtonState.PRESSED) {
|
||||
else if (button.id == Hotkey.COMBO_BUTTON.button && button.status == NativeLibrary.ButtonState.PRESSED) {
|
||||
ComboHelper.comboActivate(NativeLibrary.ButtonState.PRESSED)
|
||||
}
|
||||
|
||||
|
|
@ -580,7 +580,7 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
|
|||
context,
|
||||
R.drawable.button_combo,
|
||||
R.drawable.button_combo_pressed,
|
||||
Hotkey.COMBO_KEY.button,
|
||||
Hotkey.COMBO_BUTTON.button,
|
||||
orientation
|
||||
)
|
||||
)
|
||||
|
|
@ -799,11 +799,11 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
|
|||
resources.getInteger(R.integer.N3DS_BUTTON_TURBO_Y).toFloat() / 1000 * maxY
|
||||
)
|
||||
.putFloat(
|
||||
Hotkey.COMBO_KEY.button.toString() + "-X",
|
||||
Hotkey.COMBO_BUTTON.button.toString() + "-X",
|
||||
resources.getInteger(R.integer.N3DS_BUTTON_COMBO_X).toFloat() / 1000 * maxX
|
||||
)
|
||||
.putFloat(
|
||||
Hotkey.COMBO_KEY.button.toString() + "-Y",
|
||||
Hotkey.COMBO_BUTTON.button.toString() + "-Y",
|
||||
resources.getInteger(R.integer.N3DS_BUTTON_COMBO_Y).toFloat() / 1000 * maxY
|
||||
)
|
||||
.apply()
|
||||
|
|
@ -958,11 +958,11 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
|
|||
resources.getInteger(R.integer.N3DS_BUTTON_TURBO_PORTRAIT_Y).toFloat() / 1000 * maxY
|
||||
)
|
||||
.putFloat(
|
||||
Hotkey.COMBO_KEY.button.toString() + portrait + "-X",
|
||||
Hotkey.COMBO_BUTTON.button.toString() + portrait + "-X",
|
||||
resources.getInteger(R.integer.N3DS_BUTTON_COMBO_PORTRAIT_X).toFloat() / 1000 * maxX
|
||||
)
|
||||
.putFloat(
|
||||
Hotkey.COMBO_KEY.button.toString() + portrait + "-Y",
|
||||
Hotkey.COMBO_BUTTON.button.toString() + portrait + "-Y",
|
||||
resources.getInteger(R.integer.N3DS_BUTTON_COMBO_PORTRAIT_Y).toFloat() / 1000 * maxY
|
||||
)
|
||||
.apply()
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import org.citra.citra_emu.features.settings.model.IntListSetting
|
|||
|
||||
object ComboHelper {
|
||||
fun comboActivate(buttonStatus: Int) {
|
||||
val comboArray = IntListSetting.COMBO_KEYS.list
|
||||
val comboArray = IntListSetting.COMBO_BUTTONS.list
|
||||
for (nativeButton in comboArray) {
|
||||
if (nativeButton == -1) {
|
||||
// We don't want to parse any bad inputs here so we continue loop
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue