fix(ui): address PR #115 review — 8 items
- Fix stale test path UILayer/HUD → InsertOverlay/HUD - Fix D-record citation D-051 → D-049 in main.tscn - Add null guards to hud.gd update methods (pre-_ready safety) - Minimap: dirty-flag queue_redraw instead of per-frame - Remove redundant _panel.size.x, debug print - Fix DebugOverlay/GauntletHUD positioning comments Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+17
-1
@@ -38,6 +38,11 @@ var _insert_active: bool = true
|
||||
# D-169: StyleBoxFlat matching ImplantPanel aesthetic — drawn as container frame behind the circle.
|
||||
var _container_style: StyleBoxFlat = null
|
||||
|
||||
# Dirty flag — only queue_redraw() when player position or POI list changes.
|
||||
var _dirty: bool = true
|
||||
var _last_player_pos: Vector2 = Vector2(INF, INF)
|
||||
var _last_poi_count: int = -1
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
@@ -57,7 +62,16 @@ func _init_container_style() -> void:
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if _insert_active:
|
||||
if not _insert_active:
|
||||
return
|
||||
var pos := GameState.player_position
|
||||
var poi_count := GameState.discovered_pois.size()
|
||||
if pos != _last_player_pos or poi_count != _last_poi_count:
|
||||
_last_player_pos = pos
|
||||
_last_poi_count = poi_count
|
||||
_dirty = true
|
||||
if _dirty:
|
||||
_dirty = false
|
||||
queue_redraw()
|
||||
|
||||
|
||||
@@ -66,6 +80,8 @@ func _process(_delta: float) -> void:
|
||||
func set_insert_active(active: bool) -> void:
|
||||
_insert_active = active
|
||||
visible = active
|
||||
if active:
|
||||
_dirty = true
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
|
||||
Reference in New Issue
Block a user