Make battle start markers focusable
This commit is contained in:
@@ -592,6 +592,32 @@ func _check_battle_start_notice_sequence(failures: Array[String]) -> void:
|
||||
failures.append("battle start notice icon hover should preserve marker hint `%s`: %s" % [expected_hint, notice_icon_tooltips])
|
||||
if _count_descendants_by_name(scene.objective_notice_icon_strip, "CommandNoticeTileMarkerImage") < 3:
|
||||
failures.append("battle start marker notice chips should layer generated map marker art behind objective/tactic/supply icons")
|
||||
if scene.objective_notice_panel != null and scene.objective_notice_panel.mouse_filter == Control.MOUSE_FILTER_IGNORE:
|
||||
failures.append("battle start notice panel should allow marker icon hover and click guidance")
|
||||
for expected_key in ["objective", "tactic", "supply", "recover"]:
|
||||
var chip := _find_command_notice_chip_by_key(scene.objective_notice_icon_strip, expected_key)
|
||||
if chip == null:
|
||||
failures.append("battle start notice should expose a clickable `%s` guide chip" % expected_key)
|
||||
continue
|
||||
var focus_cell: Vector2i = chip.get_meta("focus_cell", Vector2i(-1, -1))
|
||||
if not scene.state.is_inside(focus_cell):
|
||||
failures.append("battle start `%s` chip should carry a map focus cell: %s" % [expected_key, str(focus_cell)])
|
||||
if not chip.tooltip_text.contains("클릭하면"):
|
||||
failures.append("battle start `%s` chip tooltip should mention map focus: %s" % [expected_key, chip.tooltip_text])
|
||||
if chip.mouse_filter == Control.MOUSE_FILTER_IGNORE:
|
||||
failures.append("battle start `%s` chip should receive pointer input" % expected_key)
|
||||
var objective_chip := _find_command_notice_chip_by_key(scene.objective_notice_icon_strip, "objective")
|
||||
if objective_chip != null:
|
||||
var objective_focus_cell: Vector2i = objective_chip.get_meta("focus_cell", Vector2i(-1, -1))
|
||||
var previous_offset: Vector2 = scene.board_scroll_offset
|
||||
if not scene._focus_board_on_command_notice_chip(objective_chip):
|
||||
failures.append("clicking the objective notice chip should focus the battlefield objective")
|
||||
elif not scene._cell_is_in_visible_bounds(objective_focus_cell, 0):
|
||||
failures.append("objective notice chip focus should bring the castle cells into view")
|
||||
elif scene.board_scroll_offset.distance_squared_to(previous_offset) <= 0.01:
|
||||
failures.append("objective notice chip should scroll the large opening map toward the eastern castle")
|
||||
elif scene.hover_cell != objective_focus_cell:
|
||||
failures.append("objective notice chip should update the hover focus cell")
|
||||
scene.free()
|
||||
|
||||
|
||||
@@ -2050,6 +2076,18 @@ func _collect_tooltips(root: Node) -> String:
|
||||
return "\n".join(parts)
|
||||
|
||||
|
||||
func _find_command_notice_chip_by_key(root: Node, key: String) -> Control:
|
||||
if root == null:
|
||||
return null
|
||||
if root is Control and str(root.get_meta("notice_icon_key", "")) == key:
|
||||
return root as Control
|
||||
for child in root.get_children():
|
||||
var found := _find_command_notice_chip_by_key(child, key)
|
||||
if found != null:
|
||||
return found
|
||||
return null
|
||||
|
||||
|
||||
func _collect_tooltips_into(root: Node, parts: Array[String]) -> void:
|
||||
if root == null:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user