From 469114cb0e158b139b13c6dfd08f8e7f191c6b60 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sun, 5 Apr 2026 08:33:07 +0200 Subject: [PATCH] fix(ui): wire M keybind for star map toggle, clean up info panel - Add _unhandled_key_input to main.gd: M toggles star_map.toggle_visible() - Remove topology line from info panel (internal data, not player-facing) - Cast aperture_count to int (was showing decimal point) Co-Authored-By: Claude Opus 4.6 (1M context) --- client/scripts/main.gd | 7 +++++++ client/ui/star_map.gd | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/scripts/main.gd b/client/scripts/main.gd index 7d45d99a5..bcaf36ced 100644 --- a/client/scripts/main.gd +++ b/client/scripts/main.gd @@ -141,6 +141,13 @@ func _ready() -> void: debug_console.unpause_requested.connect(_on_dialogue_unpause_requested) +func _unhandled_key_input(event: InputEvent) -> void: + if event.is_pressed() and not event.is_echo(): + if event is InputEventKey and event.keycode == KEY_M: + if star_map: + star_map.toggle_visible() + + func _process(delta: float) -> void: # Main game loop: poll snapshot, apply state, flush input var snapshot: Variant = SimBridge.poll_snapshot() diff --git a/client/ui/star_map.gd b/client/ui/star_map.gd index 45721d58c..240802672 100644 --- a/client/ui/star_map.gd +++ b/client/ui/star_map.gd @@ -432,13 +432,8 @@ func _draw_info_panel(sz: Vector2) -> void: draw_string(font, Vector2(x, y), "Hop distance: " + str(node.get("hop_distance", "?")), HORIZONTAL_ALIGNMENT_LEFT, -1, 11, COLOR_TEXT_DIM) y += line_h - # Topology - var topo: String = node.get("gate_topology", "").replace("_", " ").capitalize() - draw_string(font, Vector2(x, y), "Topology: " + topo, HORIZONTAL_ALIGNMENT_LEFT, -1, 11, COLOR_TEXT_DIM) - y += line_h - # Gate connections - draw_string(font, Vector2(x, y), "Gates: " + str(node.get("aperture_count", 0)) + " apertures", HORIZONTAL_ALIGNMENT_LEFT, -1, 11, COLOR_TEXT_DIM) + draw_string(font, Vector2(x, y), "Gates: " + str(int(node.get("aperture_count", 0))) + " apertures", HORIZONTAL_ALIGNMENT_LEFT, -1, 11, COLOR_TEXT_DIM) func _draw_title() -> void: