fix(ui): PR #131 review round 1 — retire starchart, harden registry
Addresses blocker comments from PR review: - Delete star_map.gd and star_map.tscn — dead implant/map/starchart HudGroups registration that should have landed with the atlas unification (D-191 criterion 1) - Remove test_star_map_is_accessible_from_insert_ui and test_star_map_scene_exists from test_sprint30.gd — D-191 supersedes the insert-UI accessibility pattern - ImplantRegistry._scan() now detects default_key collisions (first-wins with push_warning) and validates default_mode against HudGroups.Mode enum (skip + warn on invalid) star_map_data.json remains — still used by atlas_app and economics_app for system index lookups. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,8 @@ func get_manifests() -> Array:
|
||||
func _scan() -> void:
|
||||
_scanned = true
|
||||
_manifests.clear()
|
||||
var key_owners: Dictionary = {} # default_key -> app_path (collision detection)
|
||||
var valid_modes: Array = HudGroups.Mode.values()
|
||||
var dir := DirAccess.open("res://ui/implant/apps")
|
||||
if dir == null:
|
||||
push_warning("ImplantRegistry: could not open res://ui/implant/apps")
|
||||
@@ -28,10 +30,28 @@ func _scan() -> void:
|
||||
var tres_path: String = "res://ui/implant/apps/%s/app.tres" % entry
|
||||
if ResourceLoader.exists(tres_path):
|
||||
var m = load(tres_path)
|
||||
if _is_valid_manifest(m):
|
||||
_manifests.append(m)
|
||||
else:
|
||||
if not _is_valid_manifest(m):
|
||||
push_warning("ImplantRegistry: invalid or missing app_path in %s" % tres_path)
|
||||
else:
|
||||
var app_path: String = m.get("app_path")
|
||||
var default_mode: int = m.get("default_mode", 2)
|
||||
var default_key: int = m.get("default_key", -1)
|
||||
if not valid_modes.has(default_mode):
|
||||
push_warning(
|
||||
"ImplantRegistry: invalid default_mode %d in %s — skipping" % [
|
||||
default_mode, tres_path
|
||||
]
|
||||
)
|
||||
elif default_key >= 0 and key_owners.has(default_key):
|
||||
push_warning(
|
||||
"ImplantRegistry: key binding collision — key %d already bound to %s, skipping %s" % [
|
||||
default_key, key_owners[default_key], app_path
|
||||
]
|
||||
)
|
||||
else:
|
||||
if default_key >= 0:
|
||||
key_owners[default_key] = app_path
|
||||
_manifests.append(m)
|
||||
entry = dir.get_next()
|
||||
dir.list_dir_end()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user