diff options
Diffstat (limited to 'apworld/client/textclient.gd')
-rw-r--r-- | apworld/client/textclient.gd | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apworld/client/textclient.gd b/apworld/client/textclient.gd index 0c4e675..530eddb 100644 --- a/apworld/client/textclient.gd +++ b/apworld/client/textclient.gd | |||
@@ -10,6 +10,7 @@ var is_open = false | |||
10 | var locations_overlay | 10 | var locations_overlay |
11 | var location_texture | 11 | var location_texture |
12 | var worldport_texture | 12 | var worldport_texture |
13 | var goal_texture | ||
13 | 14 | ||
14 | var worldports_tab | 15 | var worldports_tab |
15 | var worldports_tree | 16 | var worldports_tree |
@@ -116,6 +117,10 @@ func _ready(): | |||
116 | worldport_image.load_png_from_buffer(runtime.read_path("assets/worldport.png")) | 117 | worldport_image.load_png_from_buffer(runtime.read_path("assets/worldport.png")) |
117 | worldport_texture = ImageTexture.create_from_image(worldport_image) | 118 | worldport_texture = ImageTexture.create_from_image(worldport_image) |
118 | 119 | ||
120 | var goal_image = Image.new() | ||
121 | goal_image.load_png_from_buffer(runtime.read_path("assets/goal.png")) | ||
122 | goal_texture = ImageTexture.create_from_image(goal_image) | ||
123 | |||
119 | 124 | ||
120 | func _input(event): | 125 | func _input(event): |
121 | if global.loaded and event is InputEventKey and event.pressed: | 126 | if global.loaded and event is InputEventKey and event.pressed: |
@@ -179,6 +184,7 @@ func update_locations(): | |||
179 | 184 | ||
180 | const kLocation = 0 | 185 | const kLocation = 0 |
181 | const kWorldport = 1 | 186 | const kWorldport = 1 |
187 | const kGoal = 2 | ||
182 | 188 | ||
183 | var location_names = [] | 189 | var location_names = [] |
184 | var type_by_name = {} | 190 | var type_by_name = {} |
@@ -196,6 +202,13 @@ func update_locations(): | |||
196 | 202 | ||
197 | location_names.sort() | 203 | location_names.sort() |
198 | 204 | ||
205 | if ap.client._goal_accessible: | ||
206 | var location_name = gamedata.ending_display_name_by_name[ap.kEndingNameByVictoryValue[ | ||
207 | ap.victory_condition | ||
208 | ]] | ||
209 | location_names.push_front(location_name) | ||
210 | type_by_name[location_name] = kGoal | ||
211 | |||
199 | var count = 0 | 212 | var count = 0 |
200 | for location_name in location_names: | 213 | for location_name in location_names: |
201 | tracker_label.append_text("[p]%s[/p]" % location_name) | 214 | tracker_label.append_text("[p]%s[/p]" % location_name) |
@@ -207,6 +220,8 @@ func update_locations(): | |||
207 | locations_overlay.add_image(location_texture) | 220 | locations_overlay.add_image(location_texture) |
208 | elif type_by_name[location_name] == kWorldport: | 221 | elif type_by_name[location_name] == kWorldport: |
209 | locations_overlay.add_image(worldport_texture) | 222 | locations_overlay.add_image(worldport_texture) |
223 | elif type_by_name[location_name] == kGoal: | ||
224 | locations_overlay.add_image(goal_texture) | ||
210 | locations_overlay.pop() | 225 | locations_overlay.pop() |
211 | count += 1 | 226 | count += 1 |
212 | 227 | ||