Skip to content

Commit 1dbaf99

Browse files
Add Option on EmulationActivity for Editing Virtual Controller Mapping, Small Naming Changes
1 parent bbedc64 commit 1dbaf99

File tree

7 files changed

+32
-8
lines changed

7 files changed

+32
-8
lines changed

app/src/main/java/com/micewine/emu/activities/EmulationActivity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ class EmulationActivity : AppCompatActivity(), View.OnApplyWindowInsetsListener
241241
drawerLayout?.closeDrawers()
242242
}
243243

244-
R.id.editControllerPreferences -> {
244+
R.id.editVirtualControllerMapping -> {
245+
startActivity(Intent(this, VirtualControllerOverlayMapper::class.java))
246+
}
247+
248+
R.id.editControllerMapping -> {
245249
startActivity(Intent(this, ControllerMapper::class.java))
246250
}
247251
}

app/src/main/java/com/micewine/emu/views/OverlayView.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class OverlayView @JvmOverloads constructor(
2828
}
2929

3030
private val buttonPaint: Paint = Paint().apply {
31-
strokeWidth = 10F
31+
strokeWidth = 8F
3232
color = Color.WHITE
3333
style = Paint.Style.STROKE
3434
}
@@ -78,6 +78,8 @@ class OverlayView @JvmOverloads constructor(
7878

7979
buttonList.forEach {
8080
buttonPaint.color = if (it.isPressed) Color.GRAY else Color.WHITE
81+
buttonPaint.alpha = 220
82+
8183
textPaint.color = if (it.isPressed) Color.GRAY else Color.WHITE
8284

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

94+
paint.alpha = 220
95+
buttonPaint.alpha = 220
96+
9297
canvas.drawCircle(it.x, it.y, it.radius / 2, buttonPaint)
9398
canvas.drawCircle(it.x + it.fingerX, it.y + it.fingerY, it.radius / 4 - 10, paint)
9499
}

app/src/main/java/com/micewine/emu/views/OverlayViewCreator.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class OverlayViewCreator @JvmOverloads constructor (context: Context, attrs: Att
4242
}
4343

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

112+
buttonPaint.alpha = 220
113+
112114
canvas.drawCircle(it.x, it.y, it.radius / 2, buttonPaint)
113115

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

125+
whitePaint.alpha = 220
126+
buttonPaint.alpha = 220
127+
123128
canvas.apply {
124129
drawCircle(it.x, it.y, it.radius / 2, buttonPaint)
125130
drawCircle(it.x, it.y, it.radius / 4 - 10, whitePaint)

app/src/main/res/menu/emulation_drawer.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,17 @@
3737
android:title="@string/open_overlay">
3838
</item>
3939
<item
40-
android:id="@+id/editControllerPreferences"
40+
android:id="@+id/editVirtualControllerMapping"
4141
android:layout_width="wrap_content"
4242
android:layout_height="wrap_content"
4343
android:icon="@drawable/ic_joystick"
44-
android:title="@string/edit_controller_preferences">
44+
android:title="@string/edit_virtual_controller_mapping">
45+
</item>
46+
<item
47+
android:id="@+id/editControllerMapping"
48+
android:layout_width="wrap_content"
49+
android:layout_height="wrap_content"
50+
android:icon="@drawable/ic_joystick"
51+
android:title="@string/edit_controller_mapping">
4552
</item>
4653
</menu>

app/src/main/res/values-pt-rBR/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
<string name="extracting_from_assets">Extraindo dos Assets…</string>
7575
<string name="checking_rat_type">Checando Tipo do Arquivo Rat…</string>
7676
<string name="invalid_rootfs_rat_file">Arquivo RootFS Rat Inválido.</string>
77-
<string name="edit_controller_preferences">Editar Preferencias do Controle</string>
77+
<string name="edit_controller_mapping">Editar Mapeamento do Controle</string>
78+
<string name="edit_virtual_controller_mapping">Editar Mapeamento do Controle Virtual</string>
7879
<string name="remove_game_item">Deletar</string>
7980
<string name="executable_already_added">Executável já adicionado</string>
8081
<string name="select_executable_file">Selecione um arquivo .exe/.bat</string>

app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
<string name="extracting_from_assets">从资源提取…</string>
7575
<string name="checking_rat_type">检查 Rat 文件类型…</string>
7676
<string name="invalid_rootfs_rat_file">无效的 RootFS Rat 文件。</string>
77-
<string name="edit_controller_preferences">编辑控制器偏好设置</string>
77+
<string name="edit_controller_mapping">编辑控制器偏好设置</string>
78+
<string name="edit_virtual_controller_mapping">编辑虚拟控制器映射</string>
7879
<string name="remove_game_item">删除</string>
7980
<string name="executable_already_added">可执行文件已添加</string>
8081
<string name="select_executable_file">选择一个 .exe/.bat 文件</string>

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
<string name="extracting_from_assets">Extracting From Assets…</string>
9393
<string name="checking_rat_type">Checking Rat File Type…</string>
9494
<string name="invalid_rootfs_rat_file">Invalid RootFS Rat File.</string>
95-
<string name="edit_controller_preferences">Edit Controller Preferences</string>
95+
<string name="edit_controller_mapping">Edit Controller Mapping</string>
96+
<string name="edit_virtual_controller_mapping">Edit Virtual Controller Mapping</string>
9697
<string name="remove_game_item">Delete</string>
9798
<string name="executable_already_added">Executable Already Added</string>
9899
<string name="select_executable_file">Select a .exe/.bat file</string>

0 commit comments

Comments
 (0)