diff --git a/scripts/scenes/battle_scene.gd b/scripts/scenes/battle_scene.gd index bb03d0b..9bb916b 100644 --- a/scripts/scenes/battle_scene.gd +++ b/scripts/scenes/battle_scene.gd @@ -243,16 +243,20 @@ const LOCAL_COMMAND_CANCEL_BUTTON_SIZE := Vector2(196, 30) const LOCAL_COMMAND_HEADER_ICON_SIZE := Vector2(24, 24) const POST_MOVE_MENU_SIZE := Vector2(240, 176) const POST_MOVE_TITLE_SIZE := Vector2(126, 24) -const POST_MOVE_PICKER_PANEL_SIZE := Vector2(336, 236) -const POST_MOVE_PICKER_TITLE_SIZE := Vector2(296, 22) -const POST_MOVE_PICKER_DETAIL_SIZE := Vector2(296, 32) -const POST_MOVE_PICKER_OPTION_SIZE := Vector2(296, 46) -const POST_MOVE_PICKER_OPTION_ICON_MAX_WIDTH := 34 +const POST_MOVE_PICKER_PANEL_SIZE := Vector2(376, 254) +const POST_MOVE_PICKER_TITLE_SIZE := Vector2(336, 24) +const POST_MOVE_PICKER_DETAIL_SIZE := Vector2(336, 30) +const POST_MOVE_PICKER_SCROLL_SIZE := Vector2(336, 104) +const POST_MOVE_PICKER_OPTION_SIZE := Vector2(336, 50) +const POST_MOVE_PICKER_OPTION_ICON_MAX_WIDTH := 38 +const POST_MOVE_PICKER_UTILITY_BUTTON_SIZE := Vector2(164, 32) +const PICKER_UTILITY_ICON_MAX_WIDTH := 22 const SIDE_MENU_OPTION_SIZE := Vector2(420, 46) const SIDE_MENU_OPTION_ICON_MAX_WIDTH := 34 const TARGETING_HINT_PANEL_SIZE := Vector2(254, 118) const TARGETING_HINT_TITLE_SIZE := Vector2(220, 22) const TARGETING_HINT_DETAIL_SIZE := Vector2(220, 28) +const TARGETING_HINT_UTILITY_BUTTON_SIZE := Vector2(108, 30) const LOCAL_COMMAND_PANEL_GAP := 8.0 const LOCAL_COMMAND_PANEL_BOARD_PADDING := 4.0 const UI_RICE_PAPER := Color(0.48, 0.46, 0.39, 0.98) @@ -1238,7 +1242,7 @@ func _text_button_texture_margin_for(button: Button, title_button: bool, opening var cap_y := 14 if opening_story_button else (18 if title_button else 24) return Vector2i( mini(max_x, maxi(16, mini(cap_x, desired_x))), - mini(max_y, maxi(10 if opening_story_button else 8, mini(cap_y, desired_y))) + mini(max_y, maxi(10, mini(cap_y, desired_y))) ) @@ -1443,6 +1447,25 @@ func _suppress_local_command_tooltip(button: Button) -> void: button.tooltip_text = button.text.strip_edges() +func _configure_picker_utility_button(button: Button, icon_kind: String, label: String, detail: String, minimum_size: Vector2) -> void: + if button == null: + return + button.text = label + button.tooltip_text = _format_local_command_tooltip(label, detail) + button.custom_minimum_size = minimum_size + button.size_flags_horizontal = Control.SIZE_EXPAND_FILL + button.size_flags_vertical = Control.SIZE_SHRINK_CENTER + button.icon = _make_toolbar_icon(icon_kind) + button.expand_icon = false + button.icon_alignment = HORIZONTAL_ALIGNMENT_LEFT + button.add_theme_constant_override("icon_max_width", PICKER_UTILITY_ICON_MAX_WIDTH) + button.add_theme_font_size_override("font_size", 12) + button.set_meta("command_icon", icon_kind) + button.set_meta("command_label", label) + button.set_meta("command_hint", detail) + _apply_button_style(button) + + func _configure_hud_command_button(button: Button, icon_kind: String = "") -> void: if button == null: return @@ -4103,17 +4126,20 @@ 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 + post_move_picker_title_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER _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() post_move_picker_detail_label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART post_move_picker_detail_label.custom_minimum_size = POST_MOVE_PICKER_DETAIL_SIZE + post_move_picker_detail_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + post_move_picker_detail_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER _apply_label_style(post_move_picker_detail_label, UI_PARCHMENT_TEXT, LOCAL_COMMAND_DETAIL_FONT_SIZE) picker_column.add_child(post_move_picker_detail_label) var picker_scroll := ScrollContainer.new() - picker_scroll.custom_minimum_size = Vector2(296, 98) + picker_scroll.custom_minimum_size = POST_MOVE_PICKER_SCROLL_SIZE picker_scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED picker_column.add_child(picker_scroll) @@ -4127,14 +4153,24 @@ func _create_hud() -> void: picker_column.add_child(picker_button_row) post_move_picker_back_button = Button.new() - post_move_picker_back_button.text = "목록 닫기" - _suppress_local_command_tooltip(post_move_picker_back_button) + _configure_picker_utility_button( + post_move_picker_back_button, + "cancel", + "목록 닫기", + "책략이나 도구 목록을 닫고 행동 선택으로 돌아갑니다.", + POST_MOVE_PICKER_UTILITY_BUTTON_SIZE + ) post_move_picker_back_button.pressed.connect(_on_post_move_picker_back_pressed) picker_button_row.add_child(post_move_picker_back_button) post_move_picker_cancel_move_button = Button.new() - post_move_picker_cancel_move_button.text = "이동 취소" - _suppress_local_command_tooltip(post_move_picker_cancel_move_button) + _configure_picker_utility_button( + post_move_picker_cancel_move_button, + "move", + "이동 취소", + "방금 이동을 취소하고 원래 자리로 돌아갑니다.", + POST_MOVE_PICKER_UTILITY_BUTTON_SIZE + ) post_move_picker_cancel_move_button.pressed.connect(_on_post_move_picker_cancel_move_pressed) picker_button_row.add_child(post_move_picker_cancel_move_button) @@ -4169,14 +4205,24 @@ func _create_hud() -> void: targeting_column.add_child(targeting_button_row) targeting_hint_back_button = Button.new() - targeting_hint_back_button.text = "선택 취소" - _suppress_local_command_tooltip(targeting_hint_back_button) + _configure_picker_utility_button( + targeting_hint_back_button, + "cancel", + "선택 취소", + "대상 지목을 취소합니다.", + TARGETING_HINT_UTILITY_BUTTON_SIZE + ) targeting_hint_back_button.pressed.connect(_on_targeting_back_pressed) targeting_button_row.add_child(targeting_hint_back_button) targeting_hint_cancel_move_button = Button.new() - targeting_hint_cancel_move_button.text = "이동 취소" - _suppress_local_command_tooltip(targeting_hint_cancel_move_button) + _configure_picker_utility_button( + targeting_hint_cancel_move_button, + "move", + "이동 취소", + "방금 이동을 취소하고 원래 자리로 돌아갑니다.", + TARGETING_HINT_UTILITY_BUTTON_SIZE + ) targeting_hint_cancel_move_button.pressed.connect(_on_targeting_cancel_move_pressed) targeting_button_row.add_child(targeting_hint_cancel_move_button) @@ -18097,10 +18143,10 @@ func _post_move_picker_title_text(selected: Dictionary) -> String: func _post_move_picker_detail_text() -> String: if post_move_picker_mode == "tactic": - return "책략을 고른 뒤 빛나는 표식 칸을 지목합니다." + return "책략을 고른 뒤 표식 칸을 지목." if post_move_picker_mode == "item": - return "도구를 고른 뒤 표식이 뜬 아군을 지목합니다." - return "이동 후 이어갈 행동을 고릅니다." + return "도구를 고른 뒤 아군 표식을 지목." + return "이동 후 행동을 고릅니다." func _rebuild_post_move_tactic_picker(selected: Dictionary) -> void: diff --git a/tools/smoke_visual_assets.gd b/tools/smoke_visual_assets.gd index 9fddf15..28134c9 100644 --- a/tools/smoke_visual_assets.gd +++ b/tools/smoke_visual_assets.gd @@ -4142,12 +4142,16 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void: failures.append("post-move picker back button should use immediately readable wording") if scene.post_move_picker_cancel_move_button == null or scene.post_move_picker_cancel_move_button.text != "이동 취소": failures.append("post-move picker cancel-move button should use immediately readable wording") + _check_picker_utility_button(failures, scene.post_move_picker_back_button, "목록 닫기", "cancel", BattleSceneScript.POST_MOVE_PICKER_UTILITY_BUTTON_SIZE) + _check_picker_utility_button(failures, scene.post_move_picker_cancel_move_button, "이동 취소", "move", BattleSceneScript.POST_MOVE_PICKER_UTILITY_BUTTON_SIZE) if scene.targeting_hint_title_label == null or scene.targeting_hint_title_label.text != "적장 지목": failures.append("targeting hint title should use mark foe wording") if scene.targeting_hint_back_button == null or scene.targeting_hint_back_button.text != "선택 취소": failures.append("targeting hint back button should use immediately readable wording") if scene.targeting_hint_cancel_move_button == null or scene.targeting_hint_cancel_move_button.text != "이동 취소": failures.append("targeting hint cancel-move button should use immediately readable wording") + _check_picker_utility_button(failures, scene.targeting_hint_back_button, "선택 취소", "cancel", BattleSceneScript.TARGETING_HINT_UTILITY_BUTTON_SIZE) + _check_picker_utility_button(failures, scene.targeting_hint_cancel_move_button, "이동 취소", "move", BattleSceneScript.TARGETING_HINT_UTILITY_BUTTON_SIZE) scene._on_objective_updated("동문에 깃발을 세워라.", "조조가 퇴각하면 패전이다.") if scene.objective_notice_label == null or not scene.objective_notice_label.text.contains("목표:") or not scene.objective_notice_label.text.contains("주의:"): failures.append("objective update notice should use Korean annotation wording") @@ -4885,6 +4889,22 @@ func _check_local_command_icon_button(failures: Array[String], button: Button, e failures.append("local command should reserve stable icon space: %s" % expected_label) +func _check_picker_utility_button(failures: Array[String], button: Button, expected_label: String, expected_icon: String, minimum_size: Vector2) -> void: + if button == null: + failures.append("picker utility button missing: %s" % expected_label) + return + if button.text != expected_label: + failures.append("picker utility should keep readable Korean text: %s text=%s" % [expected_label, button.text]) + if button.icon == null or str(button.get_meta("command_icon", "")) != expected_icon: + failures.append("picker utility should carry a generated icon: %s icon=%s meta=%s" % [expected_label, str(button.icon), str(button.get_meta("command_icon", ""))]) + _check_button_uses_generated_toolbar_icon(failures, button, expected_label) + _check_button_uses_generated_surface(failures, button, expected_label) + if button.custom_minimum_size.x < minimum_size.x or button.custom_minimum_size.y < minimum_size.y: + failures.append("picker utility should reserve readable button space: %s size=%s" % [expected_label, str(button.custom_minimum_size)]) + if str(button.tooltip_text).strip_edges().is_empty() or not str(button.tooltip_text).contains(expected_label): + failures.append("picker utility should explain itself on hover: %s tooltip=%s" % [expected_label, str(button.tooltip_text)]) + + func _check_hud_command_grid_layout(failures: Array[String]) -> void: var scene = BattleSceneScript.new() scene._create_hud()