Skip to content

Commit 1ac7de7

Browse files
committed
Allow launching emulators directly from settings
1 parent 76550a3 commit 1ac7de7

File tree

6 files changed

+52
-8
lines changed

6 files changed

+52
-8
lines changed

assets/icons/run.svg

Lines changed: 1 addition & 0 deletions
Loading

assets/icons/run.svg.import

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://d1jo22nh3m8ge"
6+
path="res://.godot/imported/run.svg-fb1139d6119d4ce68514661058911265.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://assets/icons/run.svg"
14+
dest_files=["res://.godot/imported/run.svg-fb1139d6119d4ce68514661058911265.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1
35+
svg/scale=1.0
36+
editor/scale_with_editor_scale=false
37+
editor/convert_colors_with_editor_theme=false

scenes/config/settings/EmulatorSettings.tscn

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ focus_neighbor_bottom = NodePath("../../../../../../HBoxContainer/EmulatorSelect
118118
[node name="VarButton" parent="VBoxContainer/EmulatorEditorsTab/ScrollContainer/EmulatorEditor/HFlowContainer/HBoxContainer2" index="0"]
119119
focus_neighbor_bottom = NodePath("../../../../../../HBoxContainer/EmulatorSelection")
120120

121-
[node name="AccessibilityFocus" parent="VBoxContainer/EmulatorEditorsTab/ScrollContainer/EmulatorEditor/HFlowContainer/HBoxContainer2/VarButton" index="0"]
122-
next = NodePath("../../../../../../../HBoxContainer/EmulatorSelection")
123-
124121
[node name="ScrollHandler" type="Control" parent="VBoxContainer/EmulatorEditorsTab/ScrollContainer"]
125122
layout_mode = 2
126123
script = ExtResource("5")
@@ -146,9 +143,6 @@ focus_neighbor_bottom = NodePath("../../../../../HBoxContainer/EmulatorSelection
146143
[node name="LoadCoreFileName" parent="VBoxContainer/EmulatorEditorsTab/ScrollContainer2/RetroArchEmulatorEditor/HBoxContainer8" index="2"]
147144
focus_neighbor_bottom = NodePath("../../../../../HBoxContainer/EmulatorSelection")
148145

149-
[node name="AccessibilityFocus" parent="VBoxContainer/EmulatorEditorsTab/ScrollContainer2/RetroArchEmulatorEditor/HBoxContainer8/LoadCoreFileName" index="0"]
150-
next = NodePath("../../../../../../HBoxContainer/EmulatorSelection")
151-
152146
[node name="ScrollHandler" type="Control" parent="VBoxContainer/EmulatorEditorsTab/ScrollContainer2"]
153147
layout_mode = 2
154148
script = ExtResource("5")

scenes/config/settings/emulator/EmulatorEditor.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,8 @@ func _on_LoadPath_pressed():
6565
if not path.is_empty():
6666
n_path.text = path
6767
emit_signal("change_ocurred")
68+
69+
70+
func _on_run_emulator_pressed():
71+
var path : String = n_path.text
72+
OS.create_process(path, [])

scenes/config/settings/emulator/EmulatorEditor.tscn

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
[gd_scene load_steps=4 format=3 uid="uid://6yp7suicf3ib"]
1+
[gd_scene load_steps=5 format=3 uid="uid://6yp7suicf3ib"]
22

33
[ext_resource type="Script" path="res://scenes/config/settings/emulator/EmulatorEditor.gd" id="1"]
44
[ext_resource type="Texture2D" uid="uid://dydir8kskmsc6" path="res://assets/icons/load.svg" id="2"]
55
[ext_resource type="Script" path="res://scenes/ui_nodes/AccessibilityFocus.gd" id="3"]
6+
[ext_resource type="Texture2D" uid="uid://d1jo22nh3m8ge" path="res://assets/icons/run.svg" id="4_wtvak"]
67

78
[node name="EmulatorEditor" type="VBoxContainer"]
89
anchors_preset = 15
@@ -91,6 +92,11 @@ layout_mode = 2
9192
text = "Load"
9293
icon = ExtResource("2")
9394

95+
[node name="RunEmulator" type="Button" parent="HBoxContainer4"]
96+
layout_mode = 2
97+
text = "Launch"
98+
icon = ExtResource("4_wtvak")
99+
94100
[node name="HBoxContainer5" type="HBoxContainer" parent="."]
95101
layout_mode = 2
96102

@@ -170,6 +176,7 @@ text = "- Game/system folder"
170176
[connection signal="text_changed" from="HBoxContainer3/Name" to="." method="_on_item_change"]
171177
[connection signal="text_changed" from="HBoxContainer4/Path" to="." method="_on_item_change"]
172178
[connection signal="pressed" from="HBoxContainer4/LoadPath" to="." method="_on_LoadPath_pressed"]
179+
[connection signal="pressed" from="HBoxContainer4/RunEmulator" to="." method="_on_run_emulator_pressed"]
173180
[connection signal="text_changed" from="HBoxContainer5/Command" to="." method="_on_item_change"]
174181
[connection signal="pressed" from="HFlowContainer/HBoxContainer/VarButton" to="." method="_on_VarButton_pressed" binds= ["{binpath}"]]
175182
[connection signal="pressed" from="HFlowContainer/HBoxContainer2/VarButton" to="." method="_on_VarButton_pressed" binds= ["{rompath}"]]

scenes/root/Root.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ content_scale_aspect = 4
6060

6161
[node name="Keyboard" type="Window" parent="."]
6262
unique_name_in_owner = true
63-
position = Vector2i(0, 348)
63+
position = Vector2i(0, 648)
6464
size = Vector2i(1152, 300)
6565
always_on_top = true
6666
theme = ExtResource("5")

0 commit comments

Comments
 (0)