diff options
Diffstat (limited to 'apworld')
-rw-r--r-- | apworld/client/manager.gd | 5 | ||||
-rw-r--r-- | apworld/client/pauseMenu.gd | 20 | ||||
-rw-r--r-- | apworld/client/textclient.gd | 37 |
3 files changed, 62 insertions, 0 deletions
diff --git a/apworld/client/manager.gd b/apworld/client/manager.gd index 7f4a8a6..2c25269 100644 --- a/apworld/client/manager.gd +++ b/apworld/client/manager.gd | |||
@@ -14,6 +14,7 @@ var ap_user = "" | |||
14 | var ap_pass = "" | 14 | var ap_pass = "" |
15 | var connection_history = [] | 15 | var connection_history = [] |
16 | var show_compass = false | 16 | var show_compass = false |
17 | var show_locations = false | ||
17 | 18 | ||
18 | var client | 19 | var client |
19 | var keyboard | 20 | var keyboard |
@@ -89,6 +90,9 @@ func _init(): | |||
89 | if data.size() > 4: | 90 | if data.size() > 4: |
90 | show_compass = data[4] | 91 | show_compass = data[4] |
91 | 92 | ||
93 | if data.size() > 5: | ||
94 | show_locations = data[5] | ||
95 | |||
92 | 96 | ||
93 | func _ready(): | 97 | func _ready(): |
94 | client = SCRIPT_client.new() | 98 | client = SCRIPT_client.new() |
@@ -123,6 +127,7 @@ func saveSettings(): | |||
123 | ap_pass, | 127 | ap_pass, |
124 | connection_history, | 128 | connection_history, |
125 | show_compass, | 129 | show_compass, |
130 | show_locations, | ||
126 | ] | 131 | ] |
127 | file.store_var(data, true) | 132 | file.store_var(data, true) |
128 | file.close() | 133 | file.close() |
diff --git a/apworld/client/pauseMenu.gd b/apworld/client/pauseMenu.gd index 8bc12c6..d1b4bb3 100644 --- a/apworld/client/pauseMenu.gd +++ b/apworld/client/pauseMenu.gd | |||
@@ -1,6 +1,7 @@ | |||
1 | extends "res://scripts/ui/pauseMenu.gd" | 1 | extends "res://scripts/ui/pauseMenu.gd" |
2 | 2 | ||
3 | var compass_button | 3 | var compass_button |
4 | var locations_button | ||
4 | 5 | ||
5 | 6 | ||
6 | func _ready(): | 7 | func _ready(): |
@@ -19,6 +20,15 @@ func _ready(): | |||
19 | compass_button.pressed.connect(_toggle_compass) | 20 | compass_button.pressed.connect(_toggle_compass) |
20 | ap_panel.add_child(compass_button) | 21 | ap_panel.add_child(compass_button) |
21 | 22 | ||
23 | locations_button = CheckBox.new() | ||
24 | locations_button.text = "show locations overlay" | ||
25 | locations_button.button_pressed = ap.show_locations | ||
26 | locations_button.position = Vector2(65, 200) | ||
27 | locations_button.theme = preload("res://assets/themes/baseUI.tres") | ||
28 | locations_button.add_theme_font_size_override("font_size", 60) | ||
29 | locations_button.pressed.connect(_toggle_locations) | ||
30 | ap_panel.add_child(locations_button) | ||
31 | |||
22 | super._ready() | 32 | super._ready() |
23 | 33 | ||
24 | 34 | ||
@@ -32,6 +42,7 @@ func _main_menu(): | |||
32 | global.get_node("Archipelago").disconnect_from_ap() | 42 | global.get_node("Archipelago").disconnect_from_ap() |
33 | global.get_node("Messages").clear() | 43 | global.get_node("Messages").clear() |
34 | global.get_node("Compass").visible = false | 44 | global.get_node("Compass").visible = false |
45 | global.get_node("Textclient").reset() | ||
35 | 46 | ||
36 | autosplitter.reset() | 47 | autosplitter.reset() |
37 | _unpause_game() | 48 | _unpause_game() |
@@ -49,3 +60,12 @@ func _toggle_compass(): | |||
49 | 60 | ||
50 | var compass = global.get_node("Compass") | 61 | var compass = global.get_node("Compass") |
51 | compass.visible = compass_button.button_pressed | 62 | compass.visible = compass_button.button_pressed |
63 | |||
64 | |||
65 | func _toggle_locations(): | ||
66 | var ap = global.get_node("Archipelago") | ||
67 | ap.show_locations = locations_button.button_pressed | ||
68 | ap.saveSettings() | ||
69 | |||
70 | var textclient = global.get_node("Textclient") | ||
71 | textclient.update_locations_visibility() | ||
diff --git a/apworld/client/textclient.gd b/apworld/client/textclient.gd index e345489..1b36c29 100644 --- a/apworld/client/textclient.gd +++ b/apworld/client/textclient.gd | |||
@@ -7,11 +7,25 @@ var entry | |||
7 | var tracker_label | 7 | var tracker_label |
8 | var is_open = false | 8 | var is_open = false |
9 | 9 | ||
10 | var locations_overlay | ||
11 | |||
10 | 12 | ||
11 | func _ready(): | 13 | func _ready(): |
12 | process_mode = ProcessMode.PROCESS_MODE_ALWAYS | 14 | process_mode = ProcessMode.PROCESS_MODE_ALWAYS |
13 | layer = 2 | 15 | layer = 2 |
14 | 16 | ||
17 | locations_overlay = RichTextLabel.new() | ||
18 | locations_overlay.name = "LocationsOverlay" | ||
19 | locations_overlay.offset_top = 220 | ||
20 | locations_overlay.offset_bottom = 720 | ||
21 | locations_overlay.offset_left = 20 | ||
22 | locations_overlay.anchor_right = 1.0 | ||
23 | locations_overlay.offset_right = -20 | ||
24 | locations_overlay.scroll_active = false | ||
25 | locations_overlay.mouse_filter = Control.MOUSE_FILTER_IGNORE | ||
26 | add_child(locations_overlay) | ||
27 | update_locations_visibility() | ||
28 | |||
15 | tabs = TabContainer.new() | 29 | tabs = TabContainer.new() |
16 | tabs.name = "Tabs" | 30 | tabs.name = "Tabs" |
17 | tabs.offset_left = 100 | 31 | tabs.offset_left = 100 |
@@ -123,6 +137,13 @@ func update_locations(): | |||
123 | tracker_label.push_font(preload("res://assets/fonts/Lingo2.ttf")) | 137 | tracker_label.push_font(preload("res://assets/fonts/Lingo2.ttf")) |
124 | tracker_label.push_font_size(24) | 138 | tracker_label.push_font_size(24) |
125 | 139 | ||
140 | locations_overlay.clear() | ||
141 | locations_overlay.push_font(preload("res://assets/fonts/Lingo2.ttf")) | ||
142 | locations_overlay.push_font_size(24) | ||
143 | locations_overlay.push_color(Color(0.9, 0.9, 0.9, 1)) | ||
144 | locations_overlay.push_outline_color(Color(0, 0, 0, 1)) | ||
145 | locations_overlay.push_outline_size(2) | ||
146 | |||
126 | var location_names = [] | 147 | var location_names = [] |
127 | for location_id in ap.client._accessible_locations: | 148 | for location_id in ap.client._accessible_locations: |
128 | if not ap.client._checked_locations.has(location_id): | 149 | if not ap.client._checked_locations.has(location_id): |
@@ -131,5 +152,21 @@ func update_locations(): | |||
131 | 152 | ||
132 | location_names.sort() | 153 | location_names.sort() |
133 | 154 | ||
155 | var count = 0 | ||
134 | for location_name in location_names: | 156 | for location_name in location_names: |
135 | tracker_label.append_text("[p]%s[/p]" % location_name) | 157 | tracker_label.append_text("[p]%s[/p]" % location_name) |
158 | if count < 18: | ||
159 | locations_overlay.append_text("[p align=right]%s[/p]" % location_name) | ||
160 | count += 1 | ||
161 | |||
162 | if count > 18: | ||
163 | locations_overlay.append_text("[p align=right][lb]...[rb][/p]") | ||
164 | |||
165 | |||
166 | func update_locations_visibility(): | ||
167 | var ap = global.get_node("Archipelago") | ||
168 | locations_overlay.visible = ap.show_locations | ||
169 | |||
170 | |||
171 | func reset(): | ||
172 | locations_overlay.clear() | ||