fix(client): address PR #22 review — 3 critical bugs, 2 warnings, 8 suggestions
Critical fixes: - fog_state: guard _compute_bounds() against all-invalid tiles (negative Rect2i crash) - fog_shader: read Camera2D zoom dynamically instead of hardcoded Vector2(2,2) - world_radial: set custom_minimum_size in _ready() from spoke geometry Warnings: - fog.gdshader: tighten PERIPHERAL_LOW 0.15→0.55 to match D-059 peripheral band - Extract color_for_entity_kind() to Constants.gd, decouple CursorRenderer from EntityRenderer Documentation: shallow copy assumption, gradual decay TODO, tween guard rationale, fade timing rationale, ToggleInsert TODO, monologue consume-once, hover offset safety, v6 fixture gap TODO. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ extends Control
|
||||
signal verb_selected(kind: String, entity_id: int)
|
||||
|
||||
const MAX_VERBS := 4
|
||||
# Intentionally faster than cursor 150ms — text must be readable quickly
|
||||
const FADE_IN := 0.12
|
||||
const FADE_OUT := 0.10
|
||||
const LABEL_HEIGHT := 22
|
||||
@@ -74,7 +75,7 @@ func update_from_state() -> void:
|
||||
|
||||
|
||||
func _rebuild_labels() -> void:
|
||||
# Clear existing labels
|
||||
# Guard: tween callback from previous _hide() may fire after labels already freed
|
||||
for lbl in _verb_labels:
|
||||
if is_instance_valid(lbl):
|
||||
lbl.queue_free()
|
||||
@@ -113,6 +114,7 @@ func _hide() -> void:
|
||||
_active_tween.kill()
|
||||
_active_tween = create_tween()
|
||||
_active_tween.tween_property(self, "modulate:a", 0.0, FADE_OUT)
|
||||
# Guard: tween callback from previous _hide() may fire after labels already freed
|
||||
_active_tween.tween_callback(func():
|
||||
visible = false
|
||||
for lbl in _verb_labels:
|
||||
|
||||
@@ -38,6 +38,9 @@ var _insert_active: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var menu_extent := SPOKE_RADIUS + ICON_SIZE + 20.0 # spoke + icon + label margin
|
||||
custom_minimum_size = Vector2(menu_extent * 2.0, menu_extent * 2.0)
|
||||
size = custom_minimum_size
|
||||
visible = false
|
||||
mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
|
||||
@@ -117,7 +120,7 @@ func _confirm_selection() -> void:
|
||||
|
||||
|
||||
func _activate_insert() -> void:
|
||||
# Send Pause to freeze game while viewing insert data
|
||||
# TODO(v7): replace PAUSE toggle with dedicated ToggleInsert action in protocol
|
||||
if not _insert_active:
|
||||
_insert_active = true
|
||||
_send_pause()
|
||||
|
||||
Reference in New Issue
Block a user