From 7b0af7f15874e023ddc2653db225f6e358d81214 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 28 Sep 2025 13:25:52 -0400 Subject: Indicate location or worldport with icons in overlay --- apworld/client/assets/location.png | Bin 0 -> 311 bytes apworld/client/assets/worldport.png | Bin 0 -> 219 bytes apworld/client/gamedata.gd | 2 +- apworld/client/textclient.gd | 30 ++++++++++++++++++++++++++++-- 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 apworld/client/assets/location.png create mode 100644 apworld/client/assets/worldport.png diff --git a/apworld/client/assets/location.png b/apworld/client/assets/location.png new file mode 100644 index 0000000..5304deb Binary files /dev/null and b/apworld/client/assets/location.png differ diff --git a/apworld/client/assets/worldport.png b/apworld/client/assets/worldport.png new file mode 100644 index 0000000..19dfdc3 Binary files /dev/null and b/apworld/client/assets/worldport.png 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): func get_worldport_display_name(port_id): var port = objects.get_ports()[port_id] - return "%s - %s (Worldport)" % [_get_room_object_map_name(port), port.get_name()] + return "%s - %s" % [_get_room_object_map_name(port), port.get_name()] func _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 var locations_overlay +var location_texture +var worldport_texture + func _ready(): process_mode = ProcessMode.PROCESS_MODE_ALWAYS @@ -20,9 +23,10 @@ func _ready(): locations_overlay.offset_bottom = 720 locations_overlay.offset_left = 20 locations_overlay.anchor_right = 1.0 - locations_overlay.offset_right = -20 + locations_overlay.offset_right = -10 locations_overlay.scroll_active = false locations_overlay.mouse_filter = Control.MOUSE_FILTER_IGNORE + locations_overlay.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST add_child(locations_overlay) update_locations_visibility() @@ -83,6 +87,15 @@ func _ready(): tracker_label = RichTextLabel.new() tracker_margins.add_child(tracker_label) + var runtime = global.get_node("Runtime") + var location_image = Image.new() + location_image.load_png_from_buffer(runtime.read_path("assets/location.png")) + location_texture = ImageTexture.create_from_image(location_image) + + var worldport_image = Image.new() + worldport_image.load_png_from_buffer(runtime.read_path("assets/worldport.png")) + worldport_texture = ImageTexture.create_from_image(worldport_image) + func _input(event): if global.loaded and event is InputEventKey and event.pressed: @@ -144,16 +157,22 @@ func update_locations(): locations_overlay.push_outline_color(Color(0, 0, 0, 1)) locations_overlay.push_outline_size(2) + const kLocation = 0 + const kWorldport = 1 + var location_names = [] + var type_by_name = {} for location_id in ap.client._accessible_locations: if not ap.client._checked_locations.has(location_id): var location_name = gamedata.location_name_by_id.get(location_id, "(Unknown)") location_names.append(location_name) + type_by_name[location_name] = kLocation for port_id in ap.client._accessible_worldports: if not ap.client._checked_worldports.has(port_id): var port_name = gamedata.get_worldport_display_name(port_id) location_names.append(port_name) + type_by_name[port_name] = kWorldport location_names.sort() @@ -161,7 +180,14 @@ func update_locations(): for location_name in location_names: tracker_label.append_text("[p]%s[/p]" % location_name) if count < 18: - locations_overlay.append_text("[p align=right]%s[/p]" % location_name) + locations_overlay.push_paragraph(HORIZONTAL_ALIGNMENT_RIGHT) + locations_overlay.append_text(location_name) + locations_overlay.append_text(" ") + if type_by_name[location_name] == kLocation: + locations_overlay.add_image(location_texture) + elif type_by_name[location_name] == kWorldport: + locations_overlay.add_image(worldport_texture) + locations_overlay.pop() count += 1 if count > 18: -- cgit 1.4.1