about summary refs log tree commit diff stats
path: root/client/archipelago.tscn
diff options
context:
space:
mode:
Diffstat (limited to 'client/archipelago.tscn')
-rw-r--r--client/archipelago.tscn284
1 files changed, 135 insertions, 149 deletions
diff --git a/client/archipelago.tscn b/client/archipelago.tscn index da83b23..1c156a3 100644 --- a/client/archipelago.tscn +++ b/client/archipelago.tscn
@@ -1,167 +1,153 @@
1[gd_scene load_steps=11 format=2] 1[gd_scene load_steps=3 format=3 uid="uid://b5mj3cq2bcesd"]
2 2
3[ext_resource path="user://maps/Archipelago/settings_buttons.gd" type="Script" id=4] 3[ext_resource type="Theme" uid="uid://7w454egydi41" path="res://assets/themes/baseUI.tres" id="1_mw3f1"]
4[ext_resource path="user://maps/Archipelago/settings_screen.gd" type="Script" id=5] 4
5[ext_resource path="res://images/unchecked.png" type="Texture" id=7] 5[sub_resource id=2 type="GDScript"]
6[ext_resource path="res://images/checked.png" type="Texture" id=8] 6script/source = "extends Node2D
7[ext_resource type="Theme" uid="uid://7w454egydi41" path="res://assets/themes/baseUI.tres" id="2_g4bvn"] 7
8 8const CACHE_PATH = \"user://apworld_path.txt\"
9[sub_resource type="StyleBoxFlat" id=1] 9
10bg_color = Color( 0, 0, 0, 0 ) 10
11 11func _ready():
12[sub_resource type="StyleBoxFlat" id=2] 12 if FileAccess.file_exists(CACHE_PATH):
13bg_color = Color( 1, 1, 1, 1 ) 13 var file = FileAccess.open(CACHE_PATH, FileAccess.READ)
14border_width_left = 1 14 $Panel/HBoxContainer/LineEdit.text = file.get_as_text()
15border_width_top = 1 15 file.close()
16border_width_right = 1 16
17border_width_bottom = 1 17
18border_color = Color( 1, 1, 0, 1 ) 18func _browse_pressed():
19border_blend = true 19 $FileDialog.popup_centered()
20corner_radius_top_left = 3 20
21corner_radius_top_right = 3 21
22corner_radius_bottom_right = 3 22func _file_selected(path):
23corner_radius_bottom_left = 3 23 $Panel/HBoxContainer/LineEdit.text = path
24expand_offset_left = 5.0 24
25expand_offset_right = 5.0 25
26expand_offset_top = 5.0 26func _start_pressed():
27expand_offset_bottom = 5.0 27 var apworld_path = $Panel/HBoxContainer/LineEdit.text
28 28
29[node name="settings_screen" type="Node2D"] 29 if not FileAccess.file_exists(apworld_path):
30script = ExtResource( 5 ) 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 )
31 67
32[node name="Panel" type="Panel" parent="."] 68[node name="Panel" type="Panel" parent="."]
69anchors_preset = -1
33offset_right = 1920.0 70offset_right = 1920.0
34offset_bottom = 1080.0 71offset_bottom = 1080.0
35 72
36[node name="title" parent="Panel" type="Label"] 73[node name="Label" type="Label" parent="Panel"]
37offset_left = 0.0 74layout_mode = 1
75anchors_preset = -1
38offset_top = 75.0 76offset_top = 75.0
39offset_right = 1920.0 77offset_right = 1920.0
40offset_bottom = 225.0 78offset_bottom = 225.0
41text = "ARCHIPELAGO" 79theme = ExtResource("1_mw3f1")
42valign = 1 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\"."
43horizontal_alignment = 1 95horizontal_alignment = 1
44theme = ExtResource("2_g4bvn") 96autowrap_mode = 3
45 97
46[node name="credit" parent="Panel" type="Label"] 98[node name="HBoxContainer" type="HBoxContainer" parent="Panel"]
47visible = false 99layout_mode = 1
48offset_left = 1278.0 100anchors_preset = -1
49offset_top = 974.0 101anchor_right = 1.0
50offset_right = 1868.0 102offset_left = 80.0
51offset_bottom = 1034.0 103offset_top = 595.0
52text = "Brenton Wildes" 104offset_right = -80.0
53theme = ExtResource("2_g4bvn") 105offset_bottom = 755.0
54 106theme_override_constants/separation = 32
55[node name="connect_button" parent="Panel" type="Button"] 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
56offset_left = 255.0 120offset_left = 255.0
57offset_top = 875.0 121offset_top = 875.0
58offset_right = 891.0 122offset_right = 891.0
59offset_bottom = 1025.0 123offset_bottom = 1025.0
60custom_colors/font_color_hover = Color( 1, 0.501961, 0, 1 ) 124theme = ExtResource("1_mw3f1")
61text = "CONNECT" 125text = "start"
62theme = ExtResource("2_g4bvn")
63script = ExtResource( 4 )
64 126
65[node name="quit_button" parent="Panel" type="Button"] 127[node name="QuitButton" type="Button" parent="Panel"]
128layout_mode = 1
129anchors_preset = -1
66offset_left = 1102.0 130offset_left = 1102.0
67offset_top = 875.0 131offset_top = 875.0
68offset_right = 1738.0 132offset_right = 1738.0
69offset_bottom = 1025.0 133offset_bottom = 1025.0
70custom_colors/font_color_hover = Color( 1, 0, 0, 1 ) 134theme = ExtResource("1_mw3f1")
71text = "BACK" 135text = "back"
72theme = ExtResource("2_g4bvn") 136
73script = ExtResource( 4 ) 137[node name="FileDialog" type="FileDialog" parent="."]
74 138title = "Open a File"
75[node name="credit2" parent="Panel" type="Label"] 139size = Vector2i(512, 512)
76offset_left = -105.0 140ok_button_text = "Open"
77offset_top = 346.0 141file_mode = 0
78offset_right = 485.0 142access = 2
79offset_bottom = 410.0 143filters = PackedStringArray("*.apworld;Archipelago Worlds")
80custom_styles/normal = SubResource( 1 ) 144show_hidden_files = true
81text = "SERVER" 145use_native_dialog = true
82align = 2 146
83theme = ExtResource("2_g4bvn") 147[node name="AcceptDialog" type="AcceptDialog" parent="."]
84 148dialog_text = "Could not open Lingo 2 apworld. Please check that the path is correct."
85[node name="credit5" parent="Panel" type="Label"] 149
86offset_left = 1239.0 150[connection signal="pressed" from="Panel/HBoxContainer/Button" to="." method="_browse_pressed"]
87offset_top = 422.0 151[connection signal="pressed" from="Panel/StartButton" to="." method="_start_pressed"]
88offset_right = 1829.0 152[connection signal="pressed" from="Panel/QuitButton" to="." method="_quit_pressed"]
89offset_bottom = 486.0 153[connection signal="file_selected" from="FileDialog" to="." method="_file_selected"]
90custom_styles/normal = SubResource( 1 )
91text = "OPTIONS"
92theme = ExtResource("2_g4bvn")
93
94[node name="credit3" parent="Panel" type="Label"]
95offset_left = -105.0
96offset_top = 519.0
97offset_right = 485.0
98offset_bottom = 583.0
99custom_styles/normal = SubResource( 1 )
100text = "PLAYER"
101align = 2
102theme = ExtResource("2_g4bvn")
103
104[node name="credit4" parent="Panel" type="Label"]
105offset_left = -105.0
106offset_top = 704.0
107offset_right = 485.0
108offset_bottom = 768.0
109custom_styles/normal = SubResource( 1 )
110text = "PASSWORD"
111align = 2
112theme = ExtResource("2_g4bvn")
113
114[node name="server_box" type="LineEdit" parent="Panel"]
115offset_left = 502.0
116offset_top = 295.0
117offset_right = 1144.0
118offset_bottom = 445.0
119custom_colors/selection_color = Color( 0.482353, 0, 0, 1 )
120custom_colors/cursor_color = Color( 0, 0, 0, 1 )
121custom_colors/font_color = Color( 0, 0, 0, 1 )
122custom_styles/focus = SubResource( 2 )
123align = 1
124caret_blink = true
125
126[node name="player_box" type="LineEdit" parent="Panel"]
127offset_left = 502.0
128offset_top = 477.0
129offset_right = 1144.0
130offset_bottom = 627.0
131custom_colors/selection_color = Color( 0.482353, 0, 0, 1 )
132custom_colors/cursor_color = Color( 0, 0, 0, 1 )
133custom_colors/font_color = Color( 0, 0, 0, 1 )
134custom_styles/focus = SubResource( 2 )
135align = 1
136caret_blink = true
137
138[node name="password_box" type="LineEdit" parent="Panel"]
139offset_left = 502.0
140offset_top = 659.0
141offset_right = 1144.0
142offset_bottom = 809.0
143custom_colors/selection_color = Color( 0.482353, 0, 0, 1 )
144custom_colors/cursor_color = Color( 0, 0, 0, 1 )
145custom_colors/font_color = Color( 0, 0, 0, 1 )
146custom_styles/focus = SubResource( 2 )
147align = 1
148caret_blink = true
149
150[node name="AcceptDialog" type="AcceptDialog" parent="Panel"]
151offset_right = 83.0
152offset_bottom = 58.0
153
154[node name="VersionMismatch" type="ConfirmationDialog" parent="Panel"]
155offset_right = 83.0
156offset_bottom = 58.0
157
158[node name="connection_history" type="MenuButton" parent="Panel"]
159offset_left = 1239.0
160offset_top = 276.0
161offset_right = 1829.0
162offset_bottom = 372.0
163text = "connection history"
164flat = false
165
166[connection signal="pressed" from="Panel/connect_button" to="Panel/connect_button" method="_connect_pressed"]
167[connection signal="pressed" from="Panel/quit_button" to="Panel/quit_button" method="_back_pressed"]