fix(ui): regional atlas — wiki path loading, overlay bar input, header width
Heightmap and markers load from wiki filesystem path via FileAccess instead of res:// (wiki is outside the Godot project root). Overlay bar buttons now receive mouse events — viewer skips input processing when cursor is over UI elements. Header gets explicit minimum width to prevent vertical text stacking. Shadow economy overlay removed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -98,12 +98,6 @@ const OVERLAY_DEFS: Array = [
|
||||
"group": "toggle",
|
||||
"tooltip": "Production zones (D-181 observable — requires presence)."
|
||||
},
|
||||
{
|
||||
"id": "shadow_economy",
|
||||
"label": "SHD",
|
||||
"group": "toggle",
|
||||
"tooltip": "Shadow economy zones (D-181 observable)."
|
||||
},
|
||||
{
|
||||
"id": "corp_presence",
|
||||
"label": "CRP",
|
||||
@@ -269,14 +263,15 @@ func _load_heightmap() -> void:
|
||||
if ref == null or str(ref).is_empty():
|
||||
return
|
||||
var path: String = str(ref)
|
||||
if not path.begins_with("res://"):
|
||||
path = "res://" + path.lstrip("/")
|
||||
if not ResourceLoader.exists(path):
|
||||
if not path.begins_with("/"):
|
||||
var project_root: String = ProjectSettings.globalize_path("res://").get_base_dir().get_base_dir()
|
||||
path = project_root + "/" + path
|
||||
if not FileAccess.file_exists(path):
|
||||
push_warning("AtlasViewer: terrain_reference not found at %s" % path)
|
||||
return
|
||||
var tex: Variant = load(path)
|
||||
if tex is Texture2D:
|
||||
_heightmap_texture = tex
|
||||
var img := Image.load_from_file(path)
|
||||
if img != null:
|
||||
_heightmap_texture = ImageTexture.create_from_image(img)
|
||||
_tex_w = float(_heightmap_texture.get_width())
|
||||
_tex_h = float(_heightmap_texture.get_height())
|
||||
|
||||
@@ -292,8 +287,9 @@ func _load_markers() -> void:
|
||||
if ref == null or str(ref).is_empty():
|
||||
return
|
||||
var hm_path: String = str(ref)
|
||||
if not hm_path.begins_with("res://"):
|
||||
hm_path = "res://" + hm_path.lstrip("/")
|
||||
if not hm_path.begins_with("/"):
|
||||
var project_root: String = ProjectSettings.globalize_path("res://").get_base_dir().get_base_dir()
|
||||
hm_path = project_root + "/" + hm_path
|
||||
var dir: String = hm_path.get_base_dir()
|
||||
var markers_path: String = dir + "/markers.json"
|
||||
|
||||
@@ -386,6 +382,7 @@ func _build_screen_header() -> void:
|
||||
# theme-swap invariant violation.
|
||||
_screen_header = ImplantHeader.new()
|
||||
_screen_header.position = Vector2(PANEL_MARGIN, 16.0)
|
||||
_screen_header.custom_minimum_size.x = 320.0
|
||||
_screen_header.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
add_child(_screen_header)
|
||||
if _implant_theme:
|
||||
@@ -418,6 +415,14 @@ static func _dict_str(d: Dictionary, key: String, fallback: String) -> String:
|
||||
# =============================================================================
|
||||
|
||||
|
||||
func _is_over_ui(pos: Vector2) -> bool:
|
||||
if _overlay_bar and _overlay_bar.get_global_rect().has_point(pos):
|
||||
return true
|
||||
if _city_panel and _city_panel.visible and _city_panel.get_global_rect().has_point(pos):
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _gui_input(event: InputEvent) -> void:
|
||||
if event is InputEventKey and event.pressed and not event.is_echo():
|
||||
_handle_key(event as InputEventKey)
|
||||
@@ -426,6 +431,9 @@ func _gui_input(event: InputEvent) -> void:
|
||||
if _heightmap_texture == null:
|
||||
return
|
||||
|
||||
if event is InputEventMouseButton and _is_over_ui((event as InputEventMouseButton).global_position):
|
||||
return
|
||||
|
||||
if event is InputEventMouseButton:
|
||||
var mb := event as InputEventMouseButton
|
||||
if mb.button_index == MOUSE_BUTTON_WHEEL_UP and mb.pressed:
|
||||
@@ -441,6 +449,8 @@ func _gui_input(event: InputEvent) -> void:
|
||||
else:
|
||||
_dragging = false
|
||||
elif event is InputEventMouseMotion:
|
||||
if _is_over_ui((event as InputEventMouseMotion).global_position):
|
||||
return
|
||||
var mm := event as InputEventMouseMotion
|
||||
if _dragging:
|
||||
_view_offset = _drag_start_offset + (mm.position - _drag_start_mouse)
|
||||
|
||||
Reference in New Issue
Block a user