From 63b42db37970fc9fc4ba9f4515c102c44428a4f6 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sat, 20 Jun 2026 22:13:19 +0900 Subject: [PATCH] Polish post-move choice readability --- scripts/scenes/battle_scene.gd | 27 +++++++------- tools/capture_readability_frames.gd | 56 ++++++++++++++++++++++++++++ tools/smoke_post_move_action_flow.gd | 18 +++++++++ 3 files changed, 87 insertions(+), 14 deletions(-) diff --git a/scripts/scenes/battle_scene.gd b/scripts/scenes/battle_scene.gd index f3a9c0d..4347e1d 100644 --- a/scripts/scenes/battle_scene.gd +++ b/scripts/scenes/battle_scene.gd @@ -2093,7 +2093,7 @@ func _make_local_command_header(icon_kind: String, title: String, tooltip: Strin post_move_title_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT post_move_title_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER post_move_title_label.tooltip_text = tooltip - _apply_label_style(post_move_title_label, UI_OLD_BRONZE, LOCAL_COMMAND_TITLE_FONT_SIZE) + _apply_label_style(post_move_title_label, UI_PARCHMENT_TEXT, LOCAL_COMMAND_TITLE_FONT_SIZE) row.add_child(post_move_title_label) _set_control_tree_tooltip(panel, tooltip) return panel @@ -4088,7 +4088,7 @@ func _create_hud() -> void: post_move_picker_title_label.text = "행동 선택" post_move_picker_title_label.custom_minimum_size = POST_MOVE_PICKER_TITLE_SIZE post_move_picker_title_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER - _apply_label_style(post_move_picker_title_label, UI_OLD_BRONZE, LOCAL_COMMAND_TITLE_FONT_SIZE) + _apply_label_style(post_move_picker_title_label, UI_PARCHMENT_TEXT, LOCAL_COMMAND_TITLE_FONT_SIZE) picker_column.add_child(post_move_picker_title_label) post_move_picker_detail_label = Label.new() @@ -8901,6 +8901,8 @@ func _target_preview_detail_badge_rect(cell: Vector2i, tooltip: String, anchor_r func _hover_info_badge() -> Dictionary: if _is_input_locked() or not state.is_inside(hover_cell): return {} + if (post_move_menu != null and post_move_menu.visible) or (post_move_picker_panel != null and post_move_picker_panel.visible): + return {} if not _target_preview_badge().is_empty(): return {} var lines := _hover_info_badge_lines(hover_cell) @@ -18059,14 +18061,12 @@ func _make_post_move_tactic_option_button(skill_id: String, skill: Dictionary, d var kind_text := _skill_kind_text(str(skill.get("kind", "skill"))) var range_text := _format_tactic_range_text(skill) var effect_text := _format_tactic_effect_text(skill) - var detail_text := "%s · 거리 %s" % [kind_text, range_text] - if not effect_text.is_empty(): - detail_text = "%s · %s" % [detail_text, effect_text] + var detail_chips: Array[String] = ["기력 %d" % mp_cost, "거리 %s" % range_text] if not disabled_reason.is_empty(): - detail_text = "%s · %s" % [detail_text, _post_move_disabled_summary(disabled_reason)] + detail_chips.append(_post_move_disabled_summary(disabled_reason)) var button := Button.new() - button.text = "%s 기력 %d\n%s" % [skill_name, mp_cost, detail_text] + button.text = "%s\n%s" % [skill_name, _join_strings(detail_chips, " · ")] button.tooltip_text = _format_post_move_tactic_option_tooltip(skill_name, mp_cost, kind_text, range_text, effect_text, disabled_reason) button.disabled = not disabled_reason.is_empty() button.custom_minimum_size = POST_MOVE_PICKER_OPTION_SIZE @@ -18160,22 +18160,21 @@ func _format_post_move_tactic_button_text(skill_id: String, skill: Dictionary, s var marker := "> " if selected_skill_id == skill_id else "" var skill_name := str(skill.get("name", skill_id)) var mp_cost := int(skill.get("mp_cost", 0)) - var kind := _skill_kind_text(str(skill.get("kind", "skill"))) var range_text := _format_tactic_range_text(skill) - var disabled_text := "" + var chips: Array[String] = ["기력 %d" % mp_cost, "거리 %s" % range_text] if state.is_unit_skill_sealed(selected["id"]): - disabled_text = " - 봉인" + chips.append("봉인") elif int(selected.get("mp", 0)) < mp_cost: - disabled_text = " - 기력" + chips.append("기력 부족") elif not _skill_has_valid_target(str(selected.get("id", "")), skill_id): - disabled_text = " - 표식 없음" - return "%s%s 기력 %d %s 사거리 %s%s" % [marker, skill_name, mp_cost, kind, range_text, disabled_text] + chips.append("표식 없음") + return "%s%s\n%s" % [marker, skill_name, _join_strings(chips, " · ")] func _format_post_move_item_button_text(item_id: String, item: Dictionary, count: int) -> String: var marker := "> " if selected_item_id == item_id else "" var item_name := _item_display_name(item_id) - return "%s%s 잔량 %d %s" % [marker, item_name, count, _format_post_move_item_effect_text(item)] + return "%s%s\n잔량 %d · %s" % [marker, item_name, count, _format_post_move_item_effect_text(item)] func _format_post_move_item_effect_text(item: Dictionary) -> String: diff --git a/tools/capture_readability_frames.gd b/tools/capture_readability_frames.gd index 1faae85..02bcfb7 100644 --- a/tools/capture_readability_frames.gd +++ b/tools/capture_readability_frames.gd @@ -111,6 +111,18 @@ func _capture_viewport_set(spec: Dictionary, output_dir: String, captures: Array await _settle() await _capture_frame(scene, output_dir, label, "09_battle_threat_hint", captures, failures) + _prepare_post_move_action_frame(scene, "") + await _settle() + await _capture_frame(scene, output_dir, label, "10_post_move_actions", captures, failures) + + _prepare_post_move_action_frame(scene, "tactic") + await _settle() + await _capture_frame(scene, output_dir, label, "11_post_move_tactic_picker", captures, failures) + + _prepare_post_move_action_frame(scene, "item") + await _settle() + await _capture_frame(scene, output_dir, label, "12_post_move_item_picker", captures, failures) + scene.queue_free() await _settle() @@ -143,6 +155,50 @@ func _prepare_auto_attack_hint_frame(scene) -> void: scene.queue_redraw() +func _prepare_post_move_action_frame(scene, picker_mode: String) -> void: + scene._hide_command_hint() + scene._hide_post_move_menu() + scene._hide_post_move_picker() + scene._hide_tactic_menu() + scene._hide_item_menu() + scene._hide_equip_menu() + scene._clear_pending_move_state() + scene.selected_skill_id = "" + scene.selected_item_id = "" + scene.basic_attack_targeting = false + scene.state.set_inventory_snapshot({"bean": 2}) + var cao_cao: Dictionary = scene.state.get_unit("cao_cao") + var enemy: Dictionary = scene.state.get_unit("yellow_turban_1") + var xiahou_dun: Dictionary = scene.state.get_unit("xiahou_dun") + if cao_cao.is_empty() or enemy.is_empty() or xiahou_dun.is_empty(): + return + cao_cao["pos"] = Vector2i(1, 3) + cao_cao["moved"] = false + cao_cao["acted"] = false + cao_cao["mp"] = maxi(10, int(cao_cao.get("mp", 0))) + enemy["pos"] = Vector2i(3, 3) + enemy["alive"] = true + enemy["hp"] = maxi(18, int(enemy.get("hp", 0))) + xiahou_dun["pos"] = Vector2i(2, 4) + xiahou_dun["alive"] = true + xiahou_dun["hp"] = 12 + scene.state.select_unit("cao_cao") + scene._refresh_ranges() + scene._focus_board_on_cell(Vector2i(2, 3)) + scene._handle_board_click(_screen_for_cell(scene, Vector2i(2, 3))) + if picker_mode == "tactic": + scene._on_post_move_tactic_pressed() + elif picker_mode == "item": + scene._on_post_move_item_pressed() + scene._update_hud() + scene.queue_redraw() + + +func _screen_for_cell(scene, cell: Vector2i) -> Vector2: + var rect: Rect2 = scene._rect_for_cell(cell) + return rect.position + rect.size * 0.5 + + func _capture_frame(_scene, output_dir: String, viewport_label: String, frame_label: String, captures: Array[Dictionary], failures: Array[String]) -> void: var texture := get_root().get_texture() if texture == null: diff --git a/tools/smoke_post_move_action_flow.gd b/tools/smoke_post_move_action_flow.gd index c0d51f6..0a5fe5f 100644 --- a/tools/smoke_post_move_action_flow.gd +++ b/tools/smoke_post_move_action_flow.gd @@ -936,6 +936,9 @@ func _check_scene_post_move_tactic_picker_flow(failures: Array[String]) -> void: scene._handle_board_click(_screen_for_cell(Vector2i(2, 3))) if scene.post_move_tactic_button == null or scene.post_move_tactic_button.disabled: failures.append("post-move Tactic should be enabled when Spark has a valid target") + scene.hover_cell = Vector2i(2, 3) + if not scene._hover_info_badge().is_empty(): + failures.append("post-move action menu should suppress terrain hover badges over local commands") scene._on_tactic_pressed() if scene.post_move_picker_panel == null or not scene.post_move_picker_panel.visible or scene.post_move_picker_mode != "tactic": @@ -944,6 +947,9 @@ func _check_scene_post_move_tactic_picker_flow(failures: Array[String]) -> void: failures.append("post-move action menu should hide while the tactic picker is open") if scene.tactic_menu != null and scene.tactic_menu.visible: failures.append("post-move tactic shortcut should not use the side tactic menu") + scene.hover_cell = Vector2i(2, 3) + if not scene._hover_info_badge().is_empty(): + failures.append("post-move tactic picker should suppress terrain hover badges over local choices") _check_post_move_picker_option_tooltips_present(failures, scene, "post-move tactic picker") _check_post_move_picker_option_visuals(failures, scene, "post-move tactic picker") @@ -1050,6 +1056,9 @@ func _check_scene_post_move_item_picker_flow(failures: Array[String]) -> void: scene._handle_board_click(_screen_for_cell(Vector2i(2, 3))) if scene.post_move_item_button == null or scene.post_move_item_button.disabled: failures.append("post-move Item should be enabled when Bean can heal an adjacent ally") + scene.hover_cell = Vector2i(2, 3) + if not scene._hover_info_badge().is_empty(): + failures.append("post-move action menu should suppress terrain hover badges before item choices") scene._on_item_pressed() if scene.post_move_picker_panel == null or not scene.post_move_picker_panel.visible or scene.post_move_picker_mode != "item": @@ -1058,6 +1067,9 @@ func _check_scene_post_move_item_picker_flow(failures: Array[String]) -> void: failures.append("post-move action menu should hide while the item picker is open") if scene.item_menu != null and scene.item_menu.visible: failures.append("post-move item shortcut should not use the side item menu") + scene.hover_cell = Vector2i(2, 3) + if not scene._hover_info_badge().is_empty(): + failures.append("post-move item picker should suppress terrain hover badges over local choices") _check_post_move_picker_option_tooltips_present(failures, scene, "post-move item picker") _check_post_move_picker_option_visuals(failures, scene, "post-move item picker") @@ -1214,6 +1226,12 @@ func _check_post_move_picker_option_visuals(failures: Array[String], scene, labe failures.append("%s option should reserve stable visual row space: %s" % [label, str(button.custom_minimum_size)]) if not button.text.contains("\n"): failures.append("%s option should use compact two-line visual text: %s" % [label, button.text]) + if button.text.contains("위력") or button.text.contains("사거리"): + failures.append("%s option should keep dense combat detail in hover text: %s" % [label, button.text]) + if label.contains("tactic") and (not button.tooltip_text.contains("사거리") or button.tooltip_text.split("\n").size() < 2): + failures.append("%s option tooltip should keep full tactic detail: %s" % [label, button.tooltip_text]) + if label.contains("item") and not button.tooltip_text.contains("잔량"): + failures.append("%s option tooltip should keep item count detail: %s" % [label, button.tooltip_text]) if button.get_theme_constant("icon_max_width") < BattleSceneScript.POST_MOVE_PICKER_OPTION_ICON_MAX_WIDTH: failures.append("%s option should reserve readable icon width" % label) if not saw_button: