Skip to content

Commit

Permalink
Add Option on EmulationActivity for Editing Virtual Controller Mappin…
Browse files Browse the repository at this point in the history
…g, Small Naming Changes
  • Loading branch information
KreitinnSoftware committed Jan 6, 2025
1 parent bbedc64 commit 1dbaf99
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ class EmulationActivity : AppCompatActivity(), View.OnApplyWindowInsetsListener
drawerLayout?.closeDrawers()
}

R.id.editControllerPreferences -> {
R.id.editVirtualControllerMapping -> {
startActivity(Intent(this, VirtualControllerOverlayMapper::class.java))
}

R.id.editControllerMapping -> {
startActivity(Intent(this, ControllerMapper::class.java))
}
}
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/com/micewine/emu/views/OverlayView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class OverlayView @JvmOverloads constructor(
}

private val buttonPaint: Paint = Paint().apply {
strokeWidth = 10F
strokeWidth = 8F
color = Color.WHITE
style = Paint.Style.STROKE
}
Expand Down Expand Up @@ -78,6 +78,8 @@ class OverlayView @JvmOverloads constructor(

buttonList.forEach {
buttonPaint.color = if (it.isPressed) Color.GRAY else Color.WHITE
buttonPaint.alpha = 220

textPaint.color = if (it.isPressed) Color.GRAY else Color.WHITE

canvas.drawCircle(it.x, it.y, it.radius / 2, buttonPaint)
Expand All @@ -89,6 +91,9 @@ class OverlayView @JvmOverloads constructor(
paint.color = if (it.isPressed) Color.GRAY else Color.WHITE
buttonPaint.color = if (it.isPressed) Color.GRAY else Color.WHITE

paint.alpha = 220
buttonPaint.alpha = 220

canvas.drawCircle(it.x, it.y, it.radius / 2, buttonPaint)
canvas.drawCircle(it.x + it.fingerX, it.y + it.fingerY, it.radius / 4 - 10, paint)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class OverlayViewCreator @JvmOverloads constructor (context: Context, attrs: Att
}

private val buttonPaint: Paint = Paint().apply {
strokeWidth = 10F
strokeWidth = 8F
color = Color.WHITE
style = Paint.Style.STROKE
}
Expand Down Expand Up @@ -109,6 +109,8 @@ class OverlayViewCreator @JvmOverloads constructor (context: Context, attrs: Att
buttonPaint.color = if (lastSelectedButton == it.id && lastSelectedType == BUTTON) Color.GRAY else Color.WHITE
textPaint.color = buttonPaint.color

buttonPaint.alpha = 220

canvas.drawCircle(it.x, it.y, it.radius / 2, buttonPaint)

paint.textSize = it.radius / 4
Expand All @@ -120,6 +122,9 @@ class OverlayViewCreator @JvmOverloads constructor (context: Context, attrs: Att
buttonPaint.color = if (lastSelectedButton == it.id && lastSelectedType == ANALOG) Color.GRAY else Color.WHITE
whitePaint.color = buttonPaint.color

whitePaint.alpha = 220
buttonPaint.alpha = 220

canvas.apply {
drawCircle(it.x, it.y, it.radius / 2, buttonPaint)
drawCircle(it.x, it.y, it.radius / 4 - 10, whitePaint)
Expand Down
11 changes: 9 additions & 2 deletions app/src/main/res/menu/emulation_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,17 @@
android:title="@string/open_overlay">
</item>
<item
android:id="@+id/editControllerPreferences"
android:id="@+id/editVirtualControllerMapping"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_joystick"
android:title="@string/edit_controller_preferences">
android:title="@string/edit_virtual_controller_mapping">
</item>
<item
android:id="@+id/editControllerMapping"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_joystick"
android:title="@string/edit_controller_mapping">
</item>
</menu>
3 changes: 2 additions & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<string name="extracting_from_assets">Extraindo dos Assets…</string>
<string name="checking_rat_type">Checando Tipo do Arquivo Rat…</string>
<string name="invalid_rootfs_rat_file">Arquivo RootFS Rat Inválido.</string>
<string name="edit_controller_preferences">Editar Preferencias do Controle</string>
<string name="edit_controller_mapping">Editar Mapeamento do Controle</string>
<string name="edit_virtual_controller_mapping">Editar Mapeamento do Controle Virtual</string>
<string name="remove_game_item">Deletar</string>
<string name="executable_already_added">Executável já adicionado</string>
<string name="select_executable_file">Selecione um arquivo .exe/.bat</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<string name="extracting_from_assets">从资源提取…</string>
<string name="checking_rat_type">检查 Rat 文件类型…</string>
<string name="invalid_rootfs_rat_file">无效的 RootFS Rat 文件。</string>
<string name="edit_controller_preferences">编辑控制器偏好设置</string>
<string name="edit_controller_mapping">编辑控制器偏好设置</string>
<string name="edit_virtual_controller_mapping">编辑虚拟控制器映射</string>
<string name="remove_game_item">删除</string>
<string name="executable_already_added">可执行文件已添加</string>
<string name="select_executable_file">选择一个 .exe/.bat 文件</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
<string name="extracting_from_assets">Extracting From Assets…</string>
<string name="checking_rat_type">Checking Rat File Type…</string>
<string name="invalid_rootfs_rat_file">Invalid RootFS Rat File.</string>
<string name="edit_controller_preferences">Edit Controller Preferences</string>
<string name="edit_controller_mapping">Edit Controller Mapping</string>
<string name="edit_virtual_controller_mapping">Edit Virtual Controller Mapping</string>
<string name="remove_game_item">Delete</string>
<string name="executable_already_added">Executable Already Added</string>
<string name="select_executable_file">Select a .exe/.bat file</string>
Expand Down

0 comments on commit 1dbaf99

Please sign in to comment.