diff --git a/scripts/ui/map_screen.gd b/scripts/ui/map_screen.gd index 8e46a52..aecdef4 100644 --- a/scripts/ui/map_screen.gd +++ b/scripts/ui/map_screen.gd @@ -34,6 +34,7 @@ var _marks: Control var _title: Label var _facing: Label var _others_key: Label +var _key: Dictionary = {} ## mark kind -> its line in the key func setup(w: Node3D, p: Node3D) -> void: world = w @@ -85,6 +86,7 @@ func setup(w: Node3D, p: Node3D) -> void: var l := UITheme.label("■ %s" % MARKS[k][1], 14) l.add_theme_color_override("font_color", MARKS[k][0]) legend.add_child(l) + _key[k] = l _facing = UITheme.label("", 15, UITheme.TEXT_DIM) _facing.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER box.add_child(_facing) @@ -99,6 +101,13 @@ func open() -> void: _tex.texture = ImageTexture.create_from_image(render(world)) _title.text = "The %s" % preload("res://scripts/world/terrain.gd").worldlet_name(world.worldlet_id()) _others_key.visible = world.is_online() and not bool(Net.server_info.get("pvp", true)) + # The key lists this land's places only (the Cove has no barrow...). + var here := {"den": world.den != null and world.den.found, "barrow": world.barrow != null, + "stones": world.stones != null, "seam": world.tunnel != null, "pier": world.pier != null, + "cave": world.sea_cave != null, "wreck": world.wreck != null, + "treasure": world.wreck != null and player.inventory.count("treasure_map") > 0} + for k in _key: + _key[k].visible = bool(here.get(k, true)) visible = true player.ui_open = true Input.mouse_mode = Input.MOUSE_MODE_VISIBLE diff --git a/scripts/world/wreck.gd b/scripts/world/wreck.gd index fc2fb86..e60e8af 100644 --- a/scripts/world/wreck.gd +++ b/scripts/world/wreck.gd @@ -85,6 +85,7 @@ func _build() -> void: mi.mesh = st.commit() var mat := StandardMaterial3D.new() mat.vertex_color_use_as_albedo = true + mat.vertex_color_is_srgb = true # (the colours above are picked by eye: dark, weathered oak) mat.roughness = 0.95 mi.material_override = mat add_child(mi)