From 7e294194ae699103a647d6114553d711468d2dbc Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sat, 20 Jun 2026 08:39:35 +0900 Subject: [PATCH] Reduce battlefield cell info clutter --- scripts/scenes/battle_scene.gd | 50 ++++++++++++++++++++++++++-------- tools/smoke_visual_assets.gd | 8 ++++++ 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/scripts/scenes/battle_scene.gd b/scripts/scenes/battle_scene.gd index 1927cf0..0931fa7 100644 --- a/scripts/scenes/battle_scene.gd +++ b/scripts/scenes/battle_scene.gd @@ -9337,40 +9337,66 @@ func _update_cell_info() -> void: if not state.is_inside(hover_cell): cell_info_label.text = "" cell_info_label.tooltip_text = "전장 칸 위에 올리면 지형과 부대 정보를 볼 수 있습니다." + if cell_info_icon != null: + cell_info_icon.texture = _make_toolbar_icon("terrain") + cell_info_icon.set_meta("icon_kind", "terrain") if cell_info_panel != null: _set_control_tree_tooltip(cell_info_panel, cell_info_label.tooltip_text) return var detail_text := _format_cell_info_detail_text(hover_cell) cell_info_label.text = _format_cell_info_summary_text(hover_cell) cell_info_label.tooltip_text = detail_text + if cell_info_icon != null: + var icon_kind := _cell_info_chip_icon_kind(hover_cell) + cell_info_icon.texture = _make_toolbar_icon(icon_kind) + cell_info_icon.set_meta("icon_kind", icon_kind) + cell_info_icon.tooltip_text = detail_text if cell_info_panel != null: _set_control_tree_tooltip(cell_info_panel, detail_text) +func _cell_info_chip_icon_kind(cell: Vector2i) -> String: + if not state.is_inside(cell): + return "terrain" + if not state.get_objective_cell_label(cell).is_empty(): + return "objective" + var event_kind := state.get_event_marker_kind(cell) + if event_kind == "tactic": + return "tactic" + if event_kind == "supply": + return "item" + if event_kind == "gold": + return "shop" + if not state.get_event_marker_label(cell).is_empty(): + return "status" + var summary := state.get_cell_summary(cell) + if int(summary.get("heal", 0)) > 0: + return "item" + var unit := state.get_unit_at(cell) + if not unit.is_empty(): + return "unit_list" if str(unit.get("team", "")) == BattleState.TEAM_PLAYER else "threat" + return "terrain" + + func _format_cell_info_summary_text(cell: Vector2i) -> String: if not state.is_inside(cell): return "" var summary := state.get_cell_summary(cell) - var text := "%s 행%d 방+%d 회+%d%%" % [ - _terrain_display_name(str(summary["terrain"])), - int(summary["move_cost"]), - int(summary["defense"]), - int(summary.get("avoid", 0)) - ] + var parts: Array[String] = [_terrain_display_name(str(summary["terrain"]))] var heal := int(summary.get("heal", 0)) - if heal > 0: - text += " · 회복 +%d" % heal var objective_cell_label := state.get_objective_cell_label(cell) if not objective_cell_label.is_empty(): - text += "\n목표 %s" % objective_cell_label + parts.append("목표 %s" % objective_cell_label) var event_marker_label := state.get_event_marker_label(cell) if not event_marker_label.is_empty(): - text += "\n표식 %s" % event_marker_label + parts.append("표식 %s" % event_marker_label) + if heal > 0: + parts.append("회복 +%d" % heal) if show_threat_overlay: var threat_names := state.get_threatening_unit_names(cell, BattleState.TEAM_ENEMY) if not threat_names.is_empty(): - text += "\n감시 %s" % _compact_name_list(threat_names, 3) - return text + parts.append("감시 %s" % _compact_name_list(threat_names, 3)) + return _truncate_hud_text(_join_strings(parts, " · "), 46) func _format_cell_info_detail_text(cell: Vector2i) -> String: diff --git a/tools/smoke_visual_assets.gd b/tools/smoke_visual_assets.gd index 98543ac..fb0822c 100644 --- a/tools/smoke_visual_assets.gd +++ b/tools/smoke_visual_assets.gd @@ -4660,20 +4660,28 @@ func _check_terrain_and_unit_presentation(failures: Array[String]) -> void: scene._update_cell_info() if scene.cell_info_label == null or not scene.cell_info_label.text.contains("목표 성채 장악") or not scene.cell_info_label.text.contains("회복 +8"): failures.append("castle objective cell info should expose capture label and healing: %s" % scene.cell_info_label.text) + if scene.cell_info_label != null and (scene.cell_info_label.text.contains("행") or scene.cell_info_label.text.contains("방+")): + failures.append("visible cell info should leave terrain numbers to the tooltip: %s" % scene.cell_info_label.text) if scene.cell_info_label != null and not scene.cell_info_label.tooltip_text.contains("21,2"): failures.append("castle objective cell info should keep coordinates in the hover tooltip: %s" % scene.cell_info_label.tooltip_text) if scene.cell_info_panel == null or not scene.cell_info_panel.visible: failures.append("cell info panel should be visible for a hovered battlefield cell") + if scene.cell_info_icon == null or str(scene.cell_info_icon.get_meta("icon_kind", "")) != "objective": + failures.append("castle objective cell info should switch the side chip to the objective icon") if scene.cell_info_label.text.contains("20,2"): failures.append("visible cell info should stay compact and leave coordinates to tooltip/badge: %s" % scene.cell_info_label.text) scene.hover_cell = Vector2i(4, 2) scene._update_cell_info() if scene.cell_info_label == null or not scene.cell_info_label.text.contains("표식 북숲 보급고"): failures.append("side event marker cell info should expose the supply label: %s" % scene.cell_info_label.text) + if scene.cell_info_icon == null or str(scene.cell_info_icon.get_meta("icon_kind", "")) != "item": + failures.append("supply marker cell info should switch the side chip to an item icon") scene.hover_cell = Vector2i(4, 6) scene._update_cell_info() if scene.cell_info_label == null or not scene.cell_info_label.text.contains("표식 유인선"): failures.append("tactical lure marker cell info should expose the marker label: %s" % scene.cell_info_label.text) + if scene.cell_info_icon == null or str(scene.cell_info_icon.get_meta("icon_kind", "")) != "tactic": + failures.append("tactical lure cell info should switch the side chip to a tactic icon") if scene.state.get_event_marker_kind(Vector2i(4, 6)) != "tactic": failures.append("tactical lure marker should expose tactic kind") scene.hover_cell = Vector2i(-1, -1)