Improve tactical attack flow

This commit is contained in:
2026-06-19 17:44:58 +09:00
parent 7db09930e7
commit 71e6abb986
5 changed files with 606 additions and 66 deletions

View File

@@ -96,6 +96,7 @@ func _init() -> void:
_check_ancient_ui_theme(failures)
_check_hover_intent_badges(failures)
_check_counter_attack_badge_variants(failures)
_check_hud_command_grid_layout(failures)
_check_action_button_disabled_reasons(failures)
_check_terrain_and_unit_presentation(failures)
_check_objective_and_status_marker_helpers(failures)
@@ -3419,6 +3420,35 @@ func _find_descendant_by_name(root: Node, node_name: String) -> Node:
return null
func _check_hud_command_grid_layout(failures: Array[String]) -> void:
var scene = BattleSceneScript.new()
scene._create_hud()
var command_grid := scene.end_turn_button.get_parent() as GridContainer
if command_grid == null:
failures.append("HUD command buttons should live in a fixed grid")
else:
if command_grid.columns != BattleSceneScript.HUD_COMMAND_GRID_COLUMNS:
failures.append("HUD command grid should use %d columns, got %d" % [BattleSceneScript.HUD_COMMAND_GRID_COLUMNS, command_grid.columns])
if command_grid.custom_minimum_size.x < BattleSceneScript.HUD_COMMAND_GRID_SIZE.x or command_grid.custom_minimum_size.y < BattleSceneScript.HUD_COMMAND_GRID_SIZE.y:
failures.append("HUD command grid should reserve stable space: %s" % str(command_grid.custom_minimum_size))
for button in [
scene.wait_button,
scene.tactic_button,
scene.item_button,
scene.equip_button,
scene.threat_button,
scene.end_turn_button
]:
if button == null:
failures.append("HUD command button missing")
continue
if button.custom_minimum_size.x < BattleSceneScript.HUD_COMMAND_BUTTON_SIZE.x or button.custom_minimum_size.y < BattleSceneScript.HUD_COMMAND_BUTTON_SIZE.y:
failures.append("HUD command button should reserve fixed Korean label space: %s" % str(button.custom_minimum_size))
if scene.end_turn_button.text != "차례 종료":
failures.append("end turn command should use a short visible Korean label: %s" % scene.end_turn_button.text)
scene.free()
func _check_action_button_disabled_reasons(failures: Array[String]) -> void:
var scene = BattleSceneScript.new()
scene.wait_button = Button.new()
@@ -3441,7 +3471,7 @@ func _check_action_button_disabled_reasons(failures: Array[String]) -> void:
"remaining_phases": 2
}]
scene._update_tactic_button(cao_cao)
if scene.tactic_button.text != "책략첩|봉인됨" or not scene.tactic_button.tooltip_text.contains("책략"):
if scene.tactic_button.text != "책략" or not scene.tactic_button.tooltip_text.contains("봉인됨") or not scene.tactic_button.tooltip_text.contains("책략"):
failures.append("sealed unit should explain disabled tactic button: %s | %s" % [scene.tactic_button.text, scene.tactic_button.tooltip_text])
cao_cao["status_effects"] = []
@@ -3450,36 +3480,36 @@ func _check_action_button_disabled_reasons(failures: Array[String]) -> void:
scene._update_tactic_button(cao_cao)
scene._update_item_button(cao_cao)
scene._update_equip_button(cao_cao)
if not scene.wait_button.text.contains("봉인됨"):
failures.append("acted unit hold button should show Sealed: %s" % scene.wait_button.text)
if not scene.tactic_button.text.contains("봉인됨"):
failures.append("acted unit stratagem button should show Sealed: %s" % scene.tactic_button.text)
if not scene.item_button.text.contains("봉인됨"):
failures.append("acted unit supply button should show Sealed: %s" % scene.item_button.text)
if not scene.equip_button.text.contains("봉인됨"):
failures.append("acted unit arms button should show Sealed: %s" % scene.equip_button.text)
if scene.wait_button.text != "대기" or not scene.wait_button.tooltip_text.contains("이미 행동"):
failures.append("acted unit hold button should keep short text and explain in tooltip: %s | %s" % [scene.wait_button.text, scene.wait_button.tooltip_text])
if scene.tactic_button.text != "책략" or not scene.tactic_button.tooltip_text.contains("이미 행동"):
failures.append("acted unit stratagem button should keep short text and explain in tooltip: %s | %s" % [scene.tactic_button.text, scene.tactic_button.tooltip_text])
if scene.item_button.text != "도구" or not scene.item_button.tooltip_text.contains("이미 행동"):
failures.append("acted unit supply button should keep short text and explain in tooltip: %s | %s" % [scene.item_button.text, scene.item_button.tooltip_text])
if scene.equip_button.text != "병장" or not scene.equip_button.tooltip_text.contains("이미 행동"):
failures.append("acted unit arms button should keep short text and explain in tooltip: %s | %s" % [scene.equip_button.text, scene.equip_button.tooltip_text])
cao_cao["acted"] = false
cao_cao["moved"] = true
scene._update_equip_button(cao_cao)
if scene.equip_button.text != "병장행군 후" or not scene.equip_button.tooltip_text.contains("행군 전"):
if scene.equip_button.text != "병장" or not scene.equip_button.tooltip_text.contains("행군 후") or not scene.equip_button.tooltip_text.contains("행군 전"):
failures.append("moved unit should explain disabled equip button: %s | %s" % [scene.equip_button.text, scene.equip_button.tooltip_text])
cao_cao["moved"] = false
scene.state.set_inventory_snapshot({})
scene._update_item_button(cao_cao)
if scene.item_button.text != "보급첩|비어 있음" or not scene.item_button.tooltip_text.contains("도구"):
if scene.item_button.text != "도구" or not scene.item_button.tooltip_text.contains("비어 있음") or not scene.item_button.tooltip_text.contains("도구"):
failures.append("empty inventory should explain disabled item button: %s | %s" % [scene.item_button.text, scene.item_button.tooltip_text])
scene.state.current_team = BattleState.TEAM_ENEMY
scene._update_end_turn_button()
if scene.end_turn_button.text != "군령 봉함|적군 차례" or not scene.end_turn_button.tooltip_text.contains("아군 군령"):
if scene.end_turn_button.text != "차례 종료" or not scene.end_turn_button.tooltip_text.contains("적군 차례") or not scene.end_turn_button.tooltip_text.contains("아군 군령"):
failures.append("enemy phase should explain disabled end turn button: %s | %s" % [scene.end_turn_button.text, scene.end_turn_button.tooltip_text])
scene.state.current_team = BattleState.TEAM_PLAYER
scene.battle_started = false
scene._update_threat_button()
if scene.threat_button.text != "진도|전장도 미개봉" or not scene.threat_button.tooltip_text.contains("전장도"):
if scene.threat_button.text != "" or not scene.threat_button.tooltip_text.contains("전장도 미개봉") or not scene.threat_button.tooltip_text.contains("전장도"):
failures.append("inactive battle should explain disabled threat button: %s | %s" % [scene.threat_button.text, scene.threat_button.tooltip_text])
_free_action_button_test_scene(scene)