Make briefing markers focus the map
This commit is contained in:
@@ -32,6 +32,7 @@ func _init() -> void:
|
||||
_check_opening_battle_tactical_spacing(failures)
|
||||
_check_opening_battle_log_location_labels(failures)
|
||||
_check_opening_battle_marker_hints(failures)
|
||||
_check_opening_battle_briefing_marker_focus(failures)
|
||||
_check_opening_battle_lure_line_ai_reaction(failures)
|
||||
_check_opening_battle_post_battle_bridge(failures)
|
||||
_check_sishui_gate_camp_context(failures)
|
||||
@@ -923,6 +924,42 @@ func _check_opening_battle_marker_hints(failures: Array[String]) -> void:
|
||||
scene.free()
|
||||
|
||||
|
||||
func _check_opening_battle_briefing_marker_focus(failures: Array[String]) -> void:
|
||||
var scene = BattleSceneScript.new()
|
||||
scene._ready()
|
||||
scene._load_scenario("001_yellow_turbans")
|
||||
scene._show_briefing()
|
||||
if scene.briefing_tactical_marker_list == null or scene.briefing_tactical_marker_list.get_child_count() < 3:
|
||||
failures.append("opening briefing should expose tactical marker chips before battle")
|
||||
scene.free()
|
||||
return
|
||||
for expected_label in ["유인선", "북숲 보급고", "마을 보급"]:
|
||||
var chip := _find_briefing_marker_chip_by_label(scene.briefing_tactical_marker_list, expected_label)
|
||||
if chip == null:
|
||||
failures.append("opening briefing marker chip missing: %s" % expected_label)
|
||||
continue
|
||||
var focus_cell: Vector2i = chip.get_meta("focus_cell", Vector2i(-1, -1))
|
||||
if not scene.state.is_inside(focus_cell):
|
||||
failures.append("opening briefing marker chip should carry focus cell for %s: %s" % [expected_label, str(focus_cell)])
|
||||
if not chip.tooltip_text.contains("클릭하면 전장도"):
|
||||
failures.append("opening briefing marker chip should explain clickable map focus for %s: %s" % [expected_label, chip.tooltip_text])
|
||||
if chip.mouse_filter == Control.MOUSE_FILTER_IGNORE:
|
||||
failures.append("opening briefing marker chip should receive pointer input for %s" % expected_label)
|
||||
var village_chip := _find_briefing_marker_chip_by_label(scene.briefing_tactical_marker_list, "마을 보급")
|
||||
if village_chip != null:
|
||||
var village_focus: Vector2i = village_chip.get_meta("focus_cell", Vector2i(-1, -1))
|
||||
var previous_offset: Vector2 = scene.board_scroll_offset
|
||||
if not scene._focus_board_on_briefing_marker_chip(village_chip):
|
||||
failures.append("clicking briefing marker chip should focus the battlefield marker")
|
||||
elif not scene._cell_is_in_visible_bounds(village_focus, 0):
|
||||
failures.append("briefing marker focus should bring the marker into the map view")
|
||||
elif scene.board_scroll_offset.distance_squared_to(previous_offset) <= 0.01:
|
||||
failures.append("briefing marker chip should move the large map toward the selected marker")
|
||||
elif scene.hover_cell != village_focus:
|
||||
failures.append("briefing marker chip should update hover focus cell")
|
||||
scene.free()
|
||||
|
||||
|
||||
func _check_opening_battle_lure_line_ai_reaction(failures: Array[String]) -> void:
|
||||
var state = BattleStateScript.new()
|
||||
if not state.load_battle("res://data/scenarios/001_yellow_turbans.json"):
|
||||
@@ -2088,6 +2125,18 @@ func _find_command_notice_chip_by_key(root: Node, key: String) -> Control:
|
||||
return null
|
||||
|
||||
|
||||
func _find_briefing_marker_chip_by_label(root: Node, label: String) -> Control:
|
||||
if root == null:
|
||||
return null
|
||||
if root is Control and str(root.get_meta("briefing_marker_label", "")) == label:
|
||||
return root as Control
|
||||
for child in root.get_children():
|
||||
var found := _find_briefing_marker_chip_by_label(child, label)
|
||||
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