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