about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-10-03 11:40:44 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-10-03 11:40:44 -0400
commite779d067a55259876a91a1abf870c4596a59f6f9 (patch)
tree3a11ce521d439c52a228852fbcd4b47acf16cc32
parent810263d61a21d2e81c78765b93adf65cb2b4e987 (diff)
downloadlingo2-archipelago-e779d067a55259876a91a1abf870c4596a59f6f9.tar.gz
lingo2-archipelago-e779d067a55259876a91a1abf870c4596a59f6f9.tar.bz2
lingo2-archipelago-e779d067a55259876a91a1abf870c4596a59f6f9.zip
Create stub loader
-rw-r--r--client/archipelago.tscn153
1 files changed, 153 insertions, 0 deletions
diff --git a/client/archipelago.tscn b/client/archipelago.tscn new file mode 100644 index 0000000..1c156a3 --- /dev/null +++ b/client/archipelago.tscn
@@ -0,0 +1,153 @@
1[gd_scene load_steps=3 format=3 uid="uid://b5mj3cq2bcesd"]
2
3[ext_resource type="Theme" uid="uid://7w454egydi41" path="res://assets/themes/baseUI.tres" id="1_mw3f1"]
4
5[sub_resource id=2 type="GDScript"]
6script/source = "extends Node2D
7
8const CACHE_PATH = \"user://apworld_path.txt\"
9
10
11func _ready():
12 if FileAccess.file_exists(CACHE_PATH):
13 var file = FileAccess.open(CACHE_PATH, FileAccess.READ)
14 $Panel/HBoxContainer/LineEdit.text = file.get_as_text()
15 file.close()
16
17
18func _browse_pressed():
19 $FileDialog.popup_centered()
20
21
22func _file_selected(path):
23 $Panel/HBoxContainer/LineEdit.text = path
24
25
26func _start_pressed():
27 var apworld_path = $Panel/HBoxContainer/LineEdit.text
28
29 if not FileAccess.file_exists(apworld_path):
30 $AcceptDialog.popup_centered()
31 return
32
33 var zip_reader = ZIPReader.new()
34 zip_reader.open(apworld_path)
35
36 var inner_path = \"lingo2/client/apworld_runtime.gd\"
37 if not zip_reader.file_exists(inner_path):
38 zip_reader.close()
39 $AcceptDialog.popup_centered()
40 return
41
42 var cache_file = FileAccess.open(CACHE_PATH, FileAccess.WRITE)
43 cache_file.store_string(apworld_path)
44 cache_file.close()
45
46 var runtime_script = GDScript.new()
47 runtime_script.source_code = zip_reader.read_file(inner_path).get_string_from_utf8()
48 runtime_script.reload()
49
50 zip_reader.close()
51
52 var runtime = runtime_script.new(apworld_path)
53 runtime.name = \"Runtime\"
54
55 global.add_child(runtime)
56
57 runtime.load_script_as_scene.call_deferred(\"settings_screen.gd\", \"settings_screen\")
58
59
60func _quit_pressed():
61 get_tree().change_scene_to_file(\"res://objects/scenes/menus/main_menu.tscn\")
62
63"
64
65[node name="Node2D" type="Node2D"]
66script = SubResource( 2 )
67
68[node name="Panel" type="Panel" parent="."]
69anchors_preset = -1
70offset_right = 1920.0
71offset_bottom = 1080.0
72
73[node name="Label" type="Label" parent="Panel"]
74layout_mode = 1
75anchors_preset = -1
76offset_top = 75.0
77offset_right = 1920.0
78offset_bottom = 225.0
79theme = ExtResource("1_mw3f1")
80text = "archipelago"
81horizontal_alignment = 1
82vertical_alignment = 1
83
84[node name="Label2" type="Label" parent="Panel"]
85layout_mode = 1
86anchors_preset = -1
87anchor_right = 1.0
88offset_left = 80.0
89offset_top = 300.0
90offset_right = -80.0
91offset_bottom = 388.0
92theme = ExtResource("1_mw3f1")
93theme_override_font_sizes/font_size = 56
94text = "Put the path to your lingo2.apworld in the below field and click start. Then, open the archipelago launcher and click \"Lingo 2 Client\"."
95horizontal_alignment = 1
96autowrap_mode = 3
97
98[node name="HBoxContainer" type="HBoxContainer" parent="Panel"]
99layout_mode = 1
100anchors_preset = -1
101anchor_right = 1.0
102offset_left = 80.0
103offset_top = 595.0
104offset_right = -80.0
105offset_bottom = 755.0
106theme_override_constants/separation = 32
107
108[node name="LineEdit" type="LineEdit" parent="Panel/HBoxContainer"]
109layout_mode = 2
110size_flags_horizontal = 3
111
112[node name="Button" type="Button" parent="Panel/HBoxContainer"]
113layout_mode = 2
114theme = ExtResource("1_mw3f1")
115text = "browse"
116
117[node name="StartButton" type="Button" parent="Panel"]
118layout_mode = 1
119anchors_preset = -1
120offset_left = 255.0
121offset_top = 875.0
122offset_right = 891.0
123offset_bottom = 1025.0
124theme = ExtResource("1_mw3f1")
125text = "start"
126
127[node name="QuitButton" type="Button" parent="Panel"]
128layout_mode = 1
129anchors_preset = -1
130offset_left = 1102.0
131offset_top = 875.0
132offset_right = 1738.0
133offset_bottom = 1025.0
134theme = ExtResource("1_mw3f1")
135text = "back"
136
137[node name="FileDialog" type="FileDialog" parent="."]
138title = "Open a File"
139size = Vector2i(512, 512)
140ok_button_text = "Open"
141file_mode = 0
142access = 2
143filters = PackedStringArray("*.apworld;Archipelago Worlds")
144show_hidden_files = true
145use_native_dialog = true
146
147[node name="AcceptDialog" type="AcceptDialog" parent="."]
148dialog_text = "Could not open Lingo 2 apworld. Please check that the path is correct."
149
150[connection signal="pressed" from="Panel/HBoxContainer/Button" to="." method="_browse_pressed"]
151[connection signal="pressed" from="Panel/StartButton" to="." method="_start_pressed"]
152[connection signal="pressed" from="Panel/QuitButton" to="." method="_quit_pressed"]
153[connection signal="file_selected" from="FileDialog" to="." method="_file_selected"]