This commit is contained in:
Nathan Hoffman 2025-04-27 14:55:15 +02:00 committed by GitHub
commit 650a9bd04a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 98 additions and 0 deletions

View file

@ -778,6 +778,7 @@ object NativeLibrary {
const val BUTTON_GPIO14 = 782
const val BUTTON_SWAP = 800
const val BUTTON_TURBO = 801
const val BUTTON_COMBO = 802
}
/**

View file

@ -110,6 +110,11 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
TurboHelper.setTurboEnabled((!TurboHelper.isTurboSpeedEnabled()))
}
if (button.id == NativeLibrary.ButtonType.BUTTON_COMBO) {
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, NativeLibrary.ButtonType.BUTTON_A, button.status)
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, NativeLibrary.ButtonType.BUTTON_X, button.status)
}
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, button.id, button.status)
shouldUpdateView = true
}
@ -486,6 +491,17 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
)
)
}
if (preferences.getBoolean("buttonToggle16", true)) {
overlayButtons.add(
initializeOverlayButton(
context,
R.drawable.button_combo, // your default icon
R.drawable.button_combo_pressed, // your pressed icon
NativeLibrary.ButtonType.BUTTON_COMBO, // your new button type in NativeLibrary
orientation
)
)
}
}
fun refreshControls() {
@ -699,6 +715,15 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
NativeLibrary.ButtonType.BUTTON_TURBO.toString() + "-Y",
resources.getInteger(R.integer.N3DS_BUTTON_TURBO_Y).toFloat() / 1000 * maxY
)
.putFloat(
NativeLibrary.ButtonType.BUTTON_COMBO.toString() + "-X",
resources.getInteger(R.integer.N3DS_BUTTON_COMBO_X).toFloat() / 1000 * maxX
)
.putFloat(
NativeLibrary.ButtonType.BUTTON_COMBO.toString() + "-Y",
resources.getInteger(R.integer.N3DS_BUTTON_COMBO_Y).toFloat() / 1000 * maxY
)
.apply()
}
@ -850,6 +875,14 @@ class InputOverlay(context: Context?, attrs: AttributeSet?) : SurfaceView(contex
NativeLibrary.ButtonType.BUTTON_TURBO.toString() + portrait + "-Y",
resources.getInteger(R.integer.N3DS_BUTTON_TURBO_PORTRAIT_Y).toFloat() / 1000 * maxY
)
.putFloat(
NativeLibrary.ButtonType.BUTTON_COMBO.toString() + "-X",
resources.getInteger(R.integer.N3DS_BUTTON_COMBO_PORTRAIT_X).toFloat() / 1000 * maxX
)
.putFloat(
NativeLibrary.ButtonType.BUTTON_COMBO.toString() + "-Y",
resources.getInteger(R.integer.N3DS_BUTTON_COMBO_PORTRAIT_Y).toFloat() / 1000 * maxY
)
.apply()
}

View file

@ -0,0 +1,32 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="99.27"
android:viewportHeight="99.27">
<!-- Outer circle -->
<path
android:fillAlpha="0.5"
android:fillColor="#eaeaea"
android:pathData="M49.64,49.64m-49.64,0a49.64,49.64 0,1 1,99.28 0a49.64,49.64 0,1 1,-99.28 0"
android:strokeAlpha="0.5" />
<!-- Centered blocky "C" icon -->
<path
android:fillAlpha="0.75"
android:fillColor="#FF000000"
android:pathData="M42,30
H62
V40
H47
V60
H62
V70
H42
V60
H37
V40
H42
Z"
android:strokeAlpha="0.75" />
</vector>

View file

@ -0,0 +1,28 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="99.27"
android:viewportHeight="99.27">
<path
android:fillAlpha="0.5"
android:fillColor="#151515"
android:pathData="M49.64,49.64m-49.64,0a49.64,49.64 0,1 1,99.28 0a49.64,49.64 0,1 1,-99.28 0"
android:strokeAlpha="0.5" />
<path
android:fillAlpha="0.75"
android:fillColor="#fff"
android:pathData="M42,30
H62
V40
H47
V60
H62
V70
H42
V60
H37
V40
H42
Z"
android:strokeAlpha="0.75" />
</vector>

View file

@ -35,6 +35,8 @@
<integer name="N3DS_BUTTON_SWAP_Y">850</integer>
<integer name="N3DS_BUTTON_TURBO_X">630</integer>
<integer name="N3DS_BUTTON_TURBO_Y">850</integer>
<integer name="N3DS_BUTTON_COMBO_X">900</integer>
<integer name="N3DS_BUTTON_COMBO_Y">900</integer>
<!-- Default N3DS portrait layout -->
<integer name="N3DS_BUTTON_A_PORTRAIT_X">810</integer>
@ -69,5 +71,7 @@
<integer name="N3DS_BUTTON_SWAP_PORTRAIT_Y">675</integer>
<integer name="N3DS_BUTTON_TURBO_PORTRAIT_X">453</integer>
<integer name="N3DS_BUTTON_TURBO_PORTRAIT_Y">720</integer>
<integer name="N3DS_BUTTON_COMBO_PORTRAIT_X">900</integer>
<integer name="N3DS_BUTTON_COMBO_PORTRAIT_Y">1600</integer>
</resources>