about summary refs log tree commit diff stats
path: root/apworld
diff options
context:
space:
mode:
Diffstat (limited to 'apworld')
-rw-r--r--apworld/client/assets/location.pngbin0 -> 311 bytes
-rw-r--r--apworld/client/assets/worldport.pngbin0 -> 219 bytes
-rw-r--r--apworld/client/gamedata.gd2
-rw-r--r--apworld/client/textclient.gd30
4 files changed, 29 insertions, 3 deletions
diff --git a/apworld/client/assets/location.png b/apworld/client/assets/location.png new file mode 100644 index 0000000..5304deb --- /dev/null +++ b/apworld/client/assets/location.png
Binary files differ
diff --git a/apworld/client/assets/worldport.png b/apworld/client/assets/worldport.png new file mode 100644 index 0000000..19dfdc3 --- /dev/null +++ b/apworld/client/assets/worldport.png
Binary files differ
diff --git a/apworld/client/gamedata.gd b/apworld/client/gamedata.gd index e44fa17..8e909dd 100644 --- a/apworld/client/gamedata.gd +++ b/apworld/client/gamedata.gd
@@ -175,7 +175,7 @@ func get_door_receivers(door_id):
175 175
176func get_worldport_display_name(port_id): 176func get_worldport_display_name(port_id):
177 var port = objects.get_ports()[port_id] 177 var port = objects.get_ports()[port_id]
178 return "%s - %s (Worldport)" % [_get_room_object_map_name(port), port.get_name()] 178 return "%s - %s" % [_get_room_object_map_name(port), port.get_name()]
179 179
180 180
181func _get_map_object_map_name(obj): 181func _get_map_object_map_name(obj):
diff --git a/apworld/client/textclient.gd b/apworld/client/textclient.gd index af155fb..1a0ce5c 100644 --- a/apworld/client/textclient.gd +++ b/apworld/client/textclient.gd
@@ -9,6 +9,9 @@ var is_open = false
9 9
10var locations_overlay 10var locations_overlay
11 11
12var location_texture
13var worldport_texture
14
12 15
13func _ready(): 16func _ready():
14 process_mode = ProcessMode.PROCESS_MODE_ALWAYS 17 process_mode = ProcessMode.PROCESS_MODE_ALWAYS
@@ -20,9 +23,10 @@ func _ready():
20 locations_overlay.offset_bottom = 720 23 locations_overlay.offset_bottom = 720
21 locations_overlay.offset_left = 20 24 locations_overlay.offset_left = 20
22 locations_overlay.anchor_right = 1.0 25 locations_overlay.anchor_right = 1.0
23 locations_overlay.offset_right = -20 26 locations_overlay.offset_right = -10
24 locations_overlay.scroll_active = false 27 locations_overlay.scroll_active = false
25 locations_overlay.mouse_filter = Control.MOUSE_FILTER_IGNORE 28 locations_overlay.mouse_filter = Control.MOUSE_FILTER_IGNORE
29 locations_overlay.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
26 add_child(locations_overlay) 30 add_child(locations_overlay)
27 update_locations_visibility() 31 update_locations_visibility()
28 32
@@ -83,6 +87,15 @@ func _ready():
83 tracker_label = RichTextLabel.new() 87 tracker_label = RichTextLabel.new()
84 tracker_margins.add_child(tracker_label) 88 tracker_margins.add_child(tracker_label)
85 89
90 var runtime = global.get_node("Runtime")
91 var location_image = Image.new()
92 location_image.load_png_from_buffer(runtime.read_path("assets/location.png"))
93 location_texture = ImageTexture.create_from_image(location_image)
94
95 var worldport_image = Image.new()
96 worldport_image.load_png_from_buffer(runtime.read_path("assets/worldport.png"))
97 worldport_texture = ImageTexture.create_from_image(worldport_image)
98
86 99
87func _input(event): 100func _input(event):
88 if global.loaded and event is InputEventKey and event.pressed: 101 if global.loaded and event is InputEventKey and event.pressed:
@@ -144,16 +157,22 @@ func update_locations():
144 locations_overlay.push_outline_color(Color(0, 0, 0, 1)) 157 locations_overlay.push_outline_color(Color(0, 0, 0, 1))
145 locations_overlay.push_outline_size(2) 158 locations_overlay.push_outline_size(2)
146 159
160 const kLocation = 0
161 const kWorldport = 1
162
147 var location_names = [] 163 var location_names = []
164 var type_by_name = {}
148 for location_id in ap.client._accessible_locations: 165 for location_id in ap.client._accessible_locations:
149 if not ap.client._checked_locations.has(location_id): 166 if not ap.client._checked_locations.has(location_id):
150 var location_name = gamedata.location_name_by_id.get(location_id, "(Unknown)") 167 var location_name = gamedata.location_name_by_id.get(location_id, "(Unknown)")
151 location_names.append(location_name) 168 location_names.append(location_name)
169 type_by_name[location_name] = kLocation
152 170
153 for port_id in ap.client._accessible_worldports: 171 for port_id in ap.client._accessible_worldports:
154 if not ap.client._checked_worldports.has(port_id): 172 if not ap.client._checked_worldports.has(port_id):
155 var port_name = gamedata.get_worldport_display_name(port_id) 173 var port_name = gamedata.get_worldport_display_name(port_id)
156 location_names.append(port_name) 174 location_names.append(port_name)
175 type_by_name[port_name] = kWorldport
157 176
158 location_names.sort() 177 location_names.sort()
159 178
@@ -161,7 +180,14 @@ func update_locations():
161 for location_name in location_names: 180 for location_name in location_names:
162 tracker_label.append_text("[p]%s[/p]" % location_name) 181 tracker_label.append_text("[p]%s[/p]" % location_name)
163 if count < 18: 182 if count < 18:
164 locations_overlay.append_text("[p align=right]%s[/p]" % location_name) 183 locations_overlay.push_paragraph(HORIZONTAL_ALIGNMENT_RIGHT)
184 locations_overlay.append_text(location_name)
185 locations_overlay.append_text(" ")
186 if type_by_name[location_name] == kLocation:
187 locations_overlay.add_image(location_texture)
188 elif type_by_name[location_name] == kWorldport:
189 locations_overlay.add_image(worldport_texture)
190 locations_overlay.pop()
165 count += 1 191 count += 1
166 192
167 if count > 18: 193 if count > 18: