From 08325891f3206e192bbcf25a04d43b643eab5b42 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sat, 20 Jun 2026 01:03:02 +0900 Subject: [PATCH] Show active prebattle prep command --- README.md | 2 +- scripts/scenes/battle_scene.gd | 20 ++++++++++++++++++++ tools/smoke_visual_assets.gd | 22 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 11f06ce..03e6935 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Godot 4 tactical RPG prototype inspired by classic turn-based Romance of the Thr - Pre-battle Roster can move optional officers between sortie and reserve within scenario limits, using portrait rows, compact status badges, and hover details. - Pre-battle Formation lets deployed officers swap starting positions inside scenario-defined cells, with portrait rows, coordinate badges, and hover placement instructions. - Pre-battle briefing shows the campaign chapter, chapter battle number, location, victory/defeat summary, and first-clear reward preview. -- Pre-battle prep commands use compact icon buttons with Korean hover labels for chapters, shop, talks, armory, roster, formation, and save records. +- Pre-battle prep commands use compact icon buttons with active selection state and Korean hover labels for chapters, shop, talks, armory, roster, formation, and save records. - Pre-battle Chapters overview shows story-arc progress with map thumbnail rows, compact status badges, hover details, and can open completed or current battles. - Pre-battle Save menu can write and load one manual campaign checkpoint separate from the automatic save, using compact seal-style slot rows and hover checkpoint details. - The title screen exposes Start, Load, and Settings, and Load now lets the player choose between the automatic record and the manual checkpoint. diff --git a/scripts/scenes/battle_scene.gd b/scripts/scenes/battle_scene.gd index 7765d1a..9012c8e 100644 --- a/scripts/scenes/battle_scene.gd +++ b/scripts/scenes/battle_scene.gd @@ -974,6 +974,7 @@ func _configure_prep_menu_button(button: Button, node_name: String, icon_kind: S button.tooltip_text = _format_local_command_tooltip(label, hint) button.custom_minimum_size = PREP_MENU_BUTTON_SIZE button.size_flags_horizontal = Control.SIZE_SHRINK_CENTER + button.toggle_mode = true button.icon = _make_toolbar_icon(icon_kind) button.expand_icon = true button.add_theme_font_size_override("font_size", 1) @@ -7449,6 +7450,7 @@ func _update_hud() -> void: _update_forecast() _update_forecast_panel_visibility() _update_result_panel() + _update_prep_menu_button_selection() if inventory_label != null: inventory_label.text = _format_inventory_status_summary_text() inventory_label.tooltip_text = _format_inventory_status_text() @@ -11452,6 +11454,24 @@ func _hide_save_menu() -> void: save_menu.visible = false +func _update_prep_menu_button_selection() -> void: + _set_prep_menu_button_pressed(chapter_button, chapter_menu) + _set_prep_menu_button_pressed(shop_button, shop_menu) + _set_prep_menu_button_pressed(talk_button, talk_menu) + _set_prep_menu_button_pressed(armory_button, armory_menu) + _set_prep_menu_button_pressed(roster_button, roster_menu) + _set_prep_menu_button_pressed(formation_button, formation_menu) + _set_prep_menu_button_pressed(save_button, save_menu) + + +func _set_prep_menu_button_pressed(button: Button, menu: Control) -> void: + if button == null: + return + var active := menu != null and menu.visible + button.set_pressed_no_signal(active) + button.set_meta("prep_menu_active", active) + + func _rebuild_save_menu() -> void: if save_status_label != null: save_status_label.text = "전기록 · 군막 봉인" diff --git a/tools/smoke_visual_assets.gd b/tools/smoke_visual_assets.gd index bab6fd6..0627990 100644 --- a/tools/smoke_visual_assets.gd +++ b/tools/smoke_visual_assets.gd @@ -3412,6 +3412,9 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void: _check_prep_menu_icon_button(failures, scene.roster_button, "출진 명부", "unit_list") _check_prep_menu_icon_button(failures, scene.formation_button, "진형 배치", "formation") _check_prep_menu_icon_button(failures, scene.save_button, "전기록", "save") + scene.briefing_panel.visible = true + scene.battle_started = false + _check_prep_menu_button_active_selection(failures, scene) if scene.shop_buy_button == null or scene.shop_buy_button.text != "사들이기": failures.append("briefing shop buy button should avoid modern purchase wording") if scene.shop_sell_button == null or scene.shop_sell_button.text != "내다팔기": @@ -3858,6 +3861,8 @@ func _check_prep_menu_icon_button(failures: Array[String], button: Button, expec if button == null: failures.append("pre-battle prep button missing: %s" % expected_label) return + if not button.toggle_mode: + failures.append("pre-battle prep button should support active selected state: %s" % expected_label) if not bool(button.get_meta("icon_only", false)) or button.text != "": failures.append("pre-battle prep button should be icon-first without visible text: %s text=%s" % [expected_label, button.text]) if button.icon == null or str(button.get_meta("command_icon", "")) != expected_icon: @@ -3868,6 +3873,23 @@ func _check_prep_menu_icon_button(failures: Array[String], button: Button, expec failures.append("pre-battle prep button should expose its function through hover tooltip: %s tooltip=%s" % [expected_label, str(button.tooltip_text)]) +func _check_prep_menu_button_active_selection(failures: Array[String], scene) -> void: + scene._on_shop_pressed() + if scene.shop_button == null or not scene.shop_button.button_pressed or not bool(scene.shop_button.get_meta("prep_menu_active", false)): + failures.append("opening the shop should mark only the shop prep icon active") + if scene.talk_button != null and scene.talk_button.button_pressed: + failures.append("opening the shop should leave the talk prep icon inactive") + scene._on_talk_pressed() + if scene.talk_button == null or not scene.talk_button.button_pressed or not bool(scene.talk_button.get_meta("prep_menu_active", false)): + failures.append("opening talk should mark the talk prep icon active") + if scene.shop_button != null and scene.shop_button.button_pressed: + failures.append("opening talk should clear the previous shop prep icon active state") + scene._hide_talk_menu() + scene._update_hud() + if scene.talk_button != null and scene.talk_button.button_pressed: + failures.append("hiding a prep menu should clear its active icon state") + + func _check_action_button_disabled_reasons(failures: Array[String]) -> void: var scene = BattleSceneScript.new() scene.wait_button = Button.new()