fix(ui): PR #131 review round 3 — nits sweep
Seven nit-level fixes from PR review: - Remove dead signal insert_deactivated from ImplantApp; the hook method on_insert_deactivated() is the actual contract. - Rewrite _on_atlas_economics_link comment in main.gd to reflect the actual flow (AtlasApp closes as a consequence of HudGroups single- active-app, not before emitting anything). - Document the "pop never empties below default" invariant on ImplantNavStack.pop() with a pointer to reset_to_default. - Add _mutating re-entrancy guard on ImplantNavStack mutation methods. push_error + early return if called during a screen_changed emission. - main.gd registry loop now uses typed ImplantAppManifest property access (manifest.app_path, manifest.default_key) instead of dictionary-style .get() calls. Empty app_path triggers push_warning. - Document the economics [/] hotkey exception in main.gd and reference the planned handle_global_key lifecycle hook. Arch doc Follow-up section gains a bullet for the new hook. - Comment the independent-version-read rationale above client_ver and proto_ver in loading_screen.gd. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+13
-7
@@ -178,14 +178,19 @@ func _unhandled_key_input(event: InputEvent) -> void:
|
||||
return
|
||||
var key_event := event as InputEventKey
|
||||
# Registry-driven toggle: each manifest declares its own default_key.
|
||||
for manifest: Variant in ImplantRegistry.get_manifests():
|
||||
if manifest.get("default_key") == key_event.keycode:
|
||||
for manifest: ImplantAppManifest in ImplantRegistry.get_manifests():
|
||||
if manifest.app_path.is_empty():
|
||||
push_warning("main.gd: manifest with empty app_path — skipping")
|
||||
continue
|
||||
if manifest.default_key == key_event.keycode:
|
||||
HudGroups.toggle_app(
|
||||
manifest.get("app_path"),
|
||||
ImplantRegistry.get_resolved_mode(manifest.get("app_path", ""))
|
||||
manifest.app_path,
|
||||
ImplantRegistry.get_resolved_mode(manifest.app_path)
|
||||
)
|
||||
return
|
||||
# [ / ] — cycle economics system selector (app-specific, not generic enough for manifest).
|
||||
# [ / ] — in-app navigation for the economics monitor. Not manifest-declared because
|
||||
# these control intra-app navigation (prev/next system), not app launch. A planned
|
||||
# handle_global_key lifecycle hook will absorb this (see arch doc Follow-up).
|
||||
if key_event.keycode == KEY_BRACKETLEFT:
|
||||
if economics_app and HudGroups.is_app_active("implant/economics"):
|
||||
economics_app.navigate(-1)
|
||||
@@ -195,8 +200,9 @@ func _unhandled_key_input(event: InputEvent) -> void:
|
||||
|
||||
|
||||
func _on_atlas_economics_link(system_id: String) -> void:
|
||||
# #835 D-191: Pre-filter the economics monitor to the city's system and pop
|
||||
# the panel open. AtlasApp closes itself before emitting this signal.
|
||||
# #835 D-191: Pre-filter the economics monitor to the city's system and open
|
||||
# it as an insert panel. AtlasApp closes automatically when Economics opens
|
||||
# (HudGroups single-active-app rule → app_changed signal).
|
||||
if economics_app == null:
|
||||
return
|
||||
economics_app.select_system(system_id)
|
||||
|
||||
Reference in New Issue
Block a user