Android: Implement controller auto-fire

This commit is contained in:
Connor McLaughlin
2021-05-24 21:18:31 +10:00
parent 8f23a79d36
commit 350bae7e94
19 changed files with 504 additions and 16 deletions

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:pathData="M1.086,50.028a48.94,48.712 0,1 0,97.88 0a48.94,48.712 0,1 0,-97.88 0z"
android:strokeWidth="1.5"
android:fillColor="#000000"
android:fillAlpha="0"
android:strokeColor="#c8c8c8"/>
<path
android:pathData="M40.04,63.464H36.23V36.582H26.79V33.238H49.438v3.344h-9.398z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
<path
android:pathData="M64.932,63.464H61.291V42.339q0,-1.82 0.042,-2.921 0.042,-1.101 0.127,-2.286 -0.677,0.677 -1.228,1.143 -0.55,0.466 -1.397,1.185l-3.217,2.625 -1.947,-2.498 8.17,-6.35h3.09z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
</vector>

View File

@ -0,0 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:pathData="M1.086,50.028a48.94,48.712 0,1 0,97.88 0a48.94,48.712 0,1 0,-97.88 0z"
android:strokeWidth="1.5"
android:fillColor="#c9c9c9"
android:strokeColor="#c8c8c8"/>
<path
android:pathData="M40.04,63.464H36.23V36.582H26.79V33.238H49.438v3.344h-9.398z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
<path
android:pathData="M64.932,63.464H61.291V42.339q0,-1.82 0.042,-2.921 0.042,-1.101 0.127,-2.286 -0.677,0.677 -1.228,1.143 -0.55,0.466 -1.397,1.185l-3.217,2.625 -1.947,-2.498 8.17,-6.35h3.09z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
</vector>

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:pathData="M1.086,50.028a48.94,48.712 0,1 0,97.88 0a48.94,48.712 0,1 0,-97.88 0z"
android:strokeWidth="1.5"
android:fillColor="#000000"
android:fillAlpha="0"
android:strokeColor="#c8c8c8"/>
<path
android:pathData="M40.04,63.464H36.23V36.582H26.79V33.238H49.438v3.344h-9.398z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
<path
android:pathData="M71.917,63.464H51.936v-3.09l7.916,-8.001q2.286,-2.286 3.852,-4.064 1.566,-1.778 2.371,-3.471 0.804,-1.736 0.804,-3.768 0,-2.498 -1.482,-3.768 -1.482,-1.312 -3.852,-1.312 -2.201,0 -3.895,0.762 -1.651,0.762 -3.387,2.117l-1.99,-2.498q1.778,-1.482 4.064,-2.498 2.328,-1.058 5.207,-1.058 4.233,0 6.689,2.159 2.455,2.117 2.455,5.884 0,2.371 -0.974,4.445 -0.974,2.074 -2.709,4.106 -1.736,1.99 -4.064,4.276l-6.308,6.223v0.169h15.282z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
</vector>

View File

@ -0,0 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:pathData="M1.086,50.028a48.94,48.712 0,1 0,97.88 0a48.94,48.712 0,1 0,-97.88 0z"
android:strokeWidth="1.5"
android:fillColor="#c9c9c9"
android:strokeColor="#c8c8c8"/>
<path
android:pathData="M40.04,63.464H36.23V36.582H26.79V33.238H49.438v3.344h-9.398z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
<path
android:pathData="M71.917,63.464H51.936v-3.09l7.916,-8.001q2.286,-2.286 3.852,-4.064 1.566,-1.778 2.371,-3.471 0.804,-1.736 0.804,-3.768 0,-2.498 -1.482,-3.768 -1.482,-1.312 -3.852,-1.312 -2.201,0 -3.895,0.762 -1.651,0.762 -3.387,2.117l-1.99,-2.498q1.778,-1.482 4.064,-2.498 2.328,-1.058 5.207,-1.058 4.233,0 6.689,2.159 2.455,2.117 2.455,5.884 0,2.371 -0.974,4.445 -0.974,2.074 -2.709,4.106 -1.736,1.99 -4.064,4.276l-6.308,6.223v0.169h15.282z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
</vector>

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:pathData="M1.086,50.028a48.94,48.712 0,1 0,97.88 0a48.94,48.712 0,1 0,-97.88 0z"
android:strokeWidth="1.5"
android:fillColor="#000000"
android:fillAlpha="0"
android:strokeColor="#c8c8c8"/>
<path
android:pathData="M40.04,63.464H36.23V36.582H26.79V33.238H49.438v3.344h-9.398z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
<path
android:pathData="m70.774,40.307q0,3.048 -1.693,4.868 -1.693,1.778 -4.572,2.371v0.169q3.641,0.423 5.419,2.286 1.778,1.863 1.778,4.868 0,2.625 -1.228,4.699 -1.228,2.032 -3.81,3.175 -2.54,1.143 -6.562,1.143 -2.371,0 -4.403,-0.381 -2.032,-0.339 -3.895,-1.27v-3.471q1.905,0.931 4.106,1.482 2.201,0.508 4.233,0.508 4.064,0 5.842,-1.566 1.82,-1.609 1.82,-4.403 0,-2.836 -2.244,-4.064 -2.201,-1.27 -6.223,-1.27h-2.921v-3.175h2.963q3.725,0 5.63,-1.566 1.947,-1.566 1.947,-4.149 0,-2.201 -1.482,-3.387 -1.482,-1.228 -4.022,-1.228 -2.455,0 -4.191,0.72 -1.736,0.72 -3.429,1.82l-1.863,-2.54q1.609,-1.27 3.979,-2.201 2.413,-0.931 5.461,-0.931 4.741,0 7.027,2.117 2.328,2.117 2.328,5.376z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
</vector>

View File

@ -0,0 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:pathData="M1.086,50.028a48.94,48.712 0,1 0,97.88 0a48.94,48.712 0,1 0,-97.88 0z"
android:strokeWidth="1.5"
android:fillColor="#c9c9c9"
android:strokeColor="#c8c8c8"/>
<path
android:pathData="M40.04,63.464H36.23V36.582H26.79V33.238H49.438v3.344h-9.398z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
<path
android:pathData="m70.774,40.307q0,3.048 -1.693,4.868 -1.693,1.778 -4.572,2.371v0.169q3.641,0.423 5.419,2.286 1.778,1.863 1.778,4.868 0,2.625 -1.228,4.699 -1.228,2.032 -3.81,3.175 -2.54,1.143 -6.562,1.143 -2.371,0 -4.403,-0.381 -2.032,-0.339 -3.895,-1.27v-3.471q1.905,0.931 4.106,1.482 2.201,0.508 4.233,0.508 4.064,0 5.842,-1.566 1.82,-1.609 1.82,-4.403 0,-2.836 -2.244,-4.064 -2.201,-1.27 -6.223,-1.27h-2.921v-3.175h2.963q3.725,0 5.63,-1.566 1.947,-1.566 1.947,-4.149 0,-2.201 -1.482,-3.387 -1.482,-1.228 -4.022,-1.228 -2.455,0 -4.191,0.72 -1.736,0.72 -3.429,1.82l-1.863,-2.54q1.609,-1.27 3.979,-2.201 2.413,-0.931 5.461,-0.931 4.741,0 7.027,2.117 2.328,2.117 2.328,5.376z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
</vector>

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:pathData="M1.086,50.028a48.94,48.712 0,1 0,97.88 0a48.94,48.712 0,1 0,-97.88 0z"
android:strokeWidth="1.5"
android:fillColor="#000000"
android:fillAlpha="0"
android:strokeColor="#c8c8c8"/>
<path
android:pathData="M40.04,63.464H36.23V36.582H26.79V33.238H49.438v3.344h-9.398z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
<path
android:pathData="m73.272,56.606h-4.403v6.858h-3.598V56.606h-14.478v-3.175l14.224,-20.362h3.852V53.261h4.403zM65.271,43.736q0,-2.201 0.085,-3.725 0.085,-1.566 0.127,-2.963h-0.169q-0.339,0.804 -0.847,1.736 -0.508,0.931 -0.974,1.566L54.433,53.261h10.837z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
</vector>

View File

@ -0,0 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:pathData="M1.086,50.028a48.94,48.712 0,1 0,97.88 0a48.94,48.712 0,1 0,-97.88 0z"
android:strokeWidth="1.5"
android:fillColor="#c9c9c9"
android:strokeColor="#c8c8c8"/>
<path
android:pathData="M40.04,63.464H36.23V36.582H26.79V33.238H49.438v3.344h-9.398z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
<path
android:pathData="m73.272,56.606h-4.403v6.858h-3.598V56.606h-14.478v-3.175l14.224,-20.362h3.852V53.261h4.403zM65.271,43.736q0,-2.201 0.085,-3.725 0.085,-1.566 0.127,-2.963h-0.169q-0.339,0.804 -0.847,1.736 -0.508,0.931 -0.974,1.566L54.433,53.261h10.837z"
android:fillColor="#ffffff"
android:strokeColor="#00000000"/>
</vector>

View File

@ -169,4 +169,56 @@
app:layout_constraintEnd_toEndOf="parent"
app:pressedDrawable="@drawable/ic_controller_pause_button"
app:unpressedDrawable="@drawable/ic_controller_pause_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_1"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="220dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t1_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t1_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_2"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="60dp"
android:layout_marginBottom="220dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t2_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t2_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_3"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="280dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t3_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t3_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_4"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="60dp"
android:layout_marginBottom="280dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t4_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t4_button" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -191,4 +191,56 @@
app:layout_constraintEnd_toEndOf="parent"
app:pressedDrawable="@drawable/ic_controller_pause_button"
app:unpressedDrawable="@drawable/ic_controller_pause_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_1"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="220dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t1_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t1_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_2"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="60dp"
android:layout_marginBottom="220dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t2_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t2_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_3"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="280dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t3_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t3_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_4"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="60dp"
android:layout_marginBottom="280dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t4_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t4_button" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -153,4 +153,56 @@
app:layout_constraintEnd_toEndOf="parent"
app:pressedDrawable="@drawable/ic_controller_pause_button"
app:unpressedDrawable="@drawable/ic_controller_pause_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_1"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="220dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t1_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t1_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_2"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="60dp"
android:layout_marginBottom="220dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t2_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t2_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_3"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="280dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t3_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t3_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_4"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="60dp"
android:layout_marginBottom="280dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t4_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t4_button" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -52,4 +52,56 @@
app:layout_constraintEnd_toEndOf="parent"
app:pressedDrawable="@drawable/ic_controller_pause_button"
app:unpressedDrawable="@drawable/ic_controller_pause_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_1"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="220dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t1_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t1_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_2"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="60dp"
android:layout_marginBottom="220dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t2_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t2_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_3"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="280dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t3_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t3_button" />
<com.github.stenzek.duckstation.TouchscreenControllerButtonView
android:id="@+id/controller_button_autofire_4"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="60dp"
android:layout_marginBottom="280dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pressedDrawable="@drawable/ic_controller_t4_button_pressed"
app:unpressedDrawable="@drawable/ic_controller_t4_button" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -354,4 +354,9 @@
<string name="settings_summary_cdrom_seek_speedup">Speeds up CD-ROM seeks by the specified factor. May improve loading speeds in some games, at the cost of breaking others.</string>
<string name="settings_custom_aspect_ratio">Custom Aspect Ratio</string>
<string name="settings_summary_custom_aspect_ratio">Used when aspect ratio is set to Custom.</string>
<string name="controller_settings_category_auto_fire_buttons">Auto Fire Buttons</string>
<string name="controller_settings_category_auto_fire_bindings">Auto Fire Triggers</string>
<string name="controller_settings_auto_fire_n_button">Auto Fire %d Button</string>
<string name="controller_settings_auto_fire_n_frequency">Auto Fire %d Frequency/Interval</string>
<string name="controller_binding_auto_fire_n">Auto Fire %d</string>
</resources>