mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2026-06-02 04:55:28 -06:00
Made ComboHelper code more readable and added the key setting to be toggleable in game
This commit is contained in:
parent
34c470ac24
commit
5339a46ba2
@ -785,6 +785,11 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
|
||||
true
|
||||
}
|
||||
|
||||
R.id.menu_emulation_adjust_scale_button_combo -> {
|
||||
showAdjustScaleDialog("controlScale-" + NativeLibrary.ButtonType.BUTTON_COMBO)
|
||||
true
|
||||
}
|
||||
|
||||
R.id.menu_emulation_adjust_opacity -> {
|
||||
showAdjustOpacityDialog()
|
||||
true
|
||||
@ -1002,12 +1007,12 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
|
||||
|
||||
private fun showToggleControlsDialog() {
|
||||
val editor = preferences.edit()
|
||||
val enabledButtons = BooleanArray(16)
|
||||
val enabledButtons = BooleanArray(17)
|
||||
enabledButtons.forEachIndexed { i: Int, _: Boolean ->
|
||||
// Buttons that are disabled by default
|
||||
var defaultValue = true
|
||||
when (i) {
|
||||
6, 7, 12, 13, 14, 15 -> defaultValue = false
|
||||
6, 7, 12, 13, 14, 15, 16 -> defaultValue = false
|
||||
}
|
||||
enabledButtons[i] = preferences.getBoolean("buttonToggle$i", defaultValue)
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
|
||||
)
|
||||
}
|
||||
|
||||
if (preferences.getBoolean("buttonToggle16", true)) {
|
||||
if (preferences.getBoolean("buttonToggle16", false)) {
|
||||
overlayButtons.add(
|
||||
initializeOverlayButton(
|
||||
context,
|
||||
|
||||
@ -4,10 +4,7 @@
|
||||
|
||||
package org.citra.citra_emu.utils
|
||||
|
||||
import org.citra.citra_emu.CitraApplication
|
||||
import org.citra.citra_emu.NativeLibrary
|
||||
import org.citra.citra_emu.R
|
||||
import org.citra.citra_emu.features.settings.model.BooleanSetting
|
||||
import org.citra.citra_emu.features.settings.model.Settings
|
||||
import org.citra.citra_emu.overlay.InputOverlayDrawableButton
|
||||
|
||||
@ -33,10 +30,13 @@ object ComboHelper {
|
||||
var comboArray = Settings.comboSelection
|
||||
for (selectedbutton in comboArray) {
|
||||
var nativebutton = getButton(selectedbutton)
|
||||
if (nativebutton == -1) {
|
||||
if (nativebutton == -1)
|
||||
{
|
||||
println("Bad Button")
|
||||
} else {
|
||||
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, nativebutton, button.status)
|
||||
}
|
||||
else
|
||||
{
|
||||
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, nativebutton, button.status)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,6 +79,9 @@
|
||||
<item
|
||||
android:id="@+id/menu_emulation_adjust_scale_button_swap"
|
||||
android:title="@string/button_swap" />
|
||||
<item
|
||||
android:id="@+id/menu_emulation_adjust_scale_button_combo"
|
||||
android:title="@string/button_combo" />
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
|
||||
@ -167,6 +167,7 @@
|
||||
<item>@string/button_home</item>
|
||||
<item>@string/button_swap</item>
|
||||
<item>@string/button_turbo</item>
|
||||
<item>@string/button_combo</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cameraImageSourceNames">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user