From 53dd9aa9b0e7df04a327f075cd2f5d138a26ba6e Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sat, 20 Jun 2026 01:09:11 +0900 Subject: [PATCH] Add turn phase command notices --- README.md | 1 + scripts/scenes/battle_scene.gd | 25 +++++++++++++++++++++---- tools/smoke_visual_assets.gd | 8 ++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 03e6935..93fc758 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Godot 4 tactical RPG prototype inspired by classic turn-based Romance of the Thr - Unit selection. - Move, attack, wait, end turn. - Automatic end-turn prompt appears after all controllable allies finish acting, using a styled command-complete confirmation. +- Ally and enemy phase changes raise compact command notices in the active battle HUD. - Enemy AI with movement, damage-aware physical attacks, multiple MP tactic choices, and scenario target priorities that events can retune mid-battle. - Hover tile and unit info with class, movement type, AGI, movement, range, and equipped gear. - Active battle unit list opens from the top toolbar with ally/enemy tabs, portrait or sprite rows, compact HP/status/position badges, and hover combat details. diff --git a/scripts/scenes/battle_scene.gd b/scripts/scenes/battle_scene.gd index 9012c8e..a6021f8 100644 --- a/scripts/scenes/battle_scene.gd +++ b/scripts/scenes/battle_scene.gd @@ -8704,6 +8704,7 @@ func _on_state_changed() -> void: func _on_log_added(message: String) -> void: _play_log_sfx(message) + _show_turn_notice_for_log(message) if log_box == null: return log_box.append_text(_format_log_entry_text(message) + "\n") @@ -8722,12 +8723,27 @@ func _format_hanja_number(value: int) -> String: return str(value) +func _show_turn_notice_for_log(message: String) -> void: + if message == "적군 차례가 열렸습니다.": + _show_command_notice("적군 군령", "제%d군령 · 적군 차례" % state.turn_number) + elif message == "아군 차례가 열렸습니다.": + _show_command_notice("아군 군령", "제%d군령 · 아군 차례" % state.turn_number) + + func _on_objective_updated(victory: String, defeat: String) -> void: - var notice_lines := ["군령 갱신"] + var body_lines: Array[String] = [] if not victory.is_empty(): - notice_lines.append("목표: %s" % victory) + body_lines.append("목표: %s" % victory) if not defeat.is_empty(): - notice_lines.append("주의: %s" % defeat) + body_lines.append("주의: %s" % defeat) + _show_command_notice("군령 갱신", _join_strings(body_lines, "\n")) + + +func _show_command_notice(title: String, body: String) -> void: + var notice_lines := [title] + var normalized_body := body.strip_edges() + if not normalized_body.is_empty(): + notice_lines.append(normalized_body) if objective_notice_label != null: objective_notice_label.text = "\n".join(notice_lines) _fit_label_font_size_to_text( @@ -8739,7 +8755,8 @@ func _on_objective_updated(victory: String, defeat: String) -> void: if objective_notice_panel != null: objective_notice_panel.visible = true objective_notice_timer = OBJECTIVE_NOTICE_DURATION - _update_hud() + if status_label != null: + _update_hud() queue_redraw() diff --git a/tools/smoke_visual_assets.gd b/tools/smoke_visual_assets.gd index 0627990..cad7c39 100644 --- a/tools/smoke_visual_assets.gd +++ b/tools/smoke_visual_assets.gd @@ -3315,6 +3315,14 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void: failures.append("auto end turn confirm button should use command wording") if scene.auto_end_turn_no_button == null or scene.auto_end_turn_no_button.text != "머무름": failures.append("auto end turn decline button should use command wording") + scene._on_log_added("적군 차례가 열렸습니다.") + if scene.objective_notice_panel == null or not scene.objective_notice_panel.visible: + failures.append("enemy turn log should show the command notice panel") + elif scene.objective_notice_label == null or not scene.objective_notice_label.text.contains("적군 군령") or not scene.objective_notice_label.text.contains("적군 차례"): + failures.append("enemy turn notice should use compact command wording: %s" % ("" if scene.objective_notice_label == null else scene.objective_notice_label.text)) + scene._on_log_added("아군 차례가 열렸습니다.") + if scene.objective_notice_label == null or not scene.objective_notice_label.text.contains("아군 군령") or not scene.objective_notice_label.text.contains("아군 차례"): + failures.append("player turn notice should use compact command wording: %s" % ("" if scene.objective_notice_label == null else scene.objective_notice_label.text)) var localized_lines := scene._normalized_dialogue_lines([{"speaker": "Cao Cao", "display_speaker": "조조", "text": "군령을 전하라."}]) if localized_lines.is_empty() or str((localized_lines[0] as Dictionary).get("speaker", "")) != "조조": failures.append("dialogue normalization should preserve display_speaker for localized names")