Style readable hover tooltips

This commit is contained in:
2026-06-20 17:04:27 +09:00
parent 11242cded7
commit cce0207ce7
3 changed files with 40 additions and 2 deletions

View File

@@ -38,12 +38,12 @@ Godot 4 tactical RPG prototype inspired by classic turn-based Romance of the Thr
- 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 prep commands use compact icon buttons with active selection state and Korean hover labels for chapters, shop, talks, armory, roster, formation, and save records.
- Post-move command boards, tactic pickers, and item pickers use generated command/item icons, compact option rows, and richer hover guidance for move-attack, stratagem, supply, wait, and cancel decisions instead of dense inline text. - Post-move command boards, tactic pickers, and item pickers use generated command/item icons, compact option rows, and richer hover guidance for move-attack, stratagem, supply, wait, and cancel decisions instead of dense inline text.
- Target preview badges, minimap hover badges, and battlefield target markers include generated jade panel surfaces plus action icons for move, attack, threat, support, objective, terrain, and item outcomes. - Target preview badges, minimap hover badges, and battlefield target markers include generated jade panel surfaces plus action icons for move, attack, threat, support, objective, terrain, and item outcomes.
- Story, briefing, dialogue, mission-detail, and result scroll/ribbon/binding/bamboo/ink/tassel ornaments use generated seal/panel textures instead of flat color boxes. - Story, briefing, dialogue, mission-detail, and result scroll/ribbon/binding/bamboo/ink/tassel ornaments keep generated seal and panel art around the frame, while text-bearing surfaces use high-contrast flat paper/ink panels so Korean copy remains readable.
- Battlefield hover info badges use generated jade panel texture plus terrain, supply, tactic, objective, and threat icons, keeping raw grid coordinates out of visible play text. - Battlefield hover info badges use generated jade panel texture plus terrain, supply, tactic, objective, and threat icons, keeping raw grid coordinates out of visible play text.
- Battle, top-toolbar, and pre-battle command buttons now prefer generated high-resolution bronze/parchment icon art under `art/ui/icons`, wide generated lacquer/jade/cinnabar menu button surfaces, and compact generated bronze/jade icon-button surfaces under `art/ui/buttons`, with procedural icon drawing and flat button styles kept only as fallbacks. - Battle, top-toolbar, and pre-battle command buttons now prefer generated high-resolution bronze/parchment icon art under `art/ui/icons`, wide generated lacquer/jade/cinnabar menu button surfaces, and compact generated bronze/jade icon-button surfaces under `art/ui/buttons`, with procedural icon drawing and flat button styles kept only as fallbacks.
- Battle maps blend generated terrain texture tiles for plains, forests, hills, wasteland, roads, water, villages, and castles over the high-resolution battlefield backdrop, with generated transparent feature overlays for road connections, water, villages, castles, and wasteland accents. - Battle maps blend generated terrain texture tiles for plains, forests, hills, wasteland, roads, water, villages, and castles over the high-resolution battlefield backdrop, with generated transparent feature overlays for road connections, water, villages, castles, and wasteland accents.
- Board unit nameplates and HP bars use generated jade panel surfaces so the high-resolution sprites are not paired with flat black UI strips. - Board unit nameplates and HP bars use generated jade panel surfaces so the high-resolution sprites are not paired with flat black UI strips.
- Core UI panels now prefer generated high-resolution lacquer, scroll, jade, and command-seal frame textures under `art/ui/panels`, with the calmer ink/wood/jade flat styles kept as fallbacks instead of the earlier yellow, hard-edged frame treatment. - Core UI panels now use generated high-resolution lacquer, scroll, jade, and command-seal frame textures under `art/ui/panels` for ornamentation, but readable tooltip/body surfaces use calmer opaque ink/wood/jade flat styles instead of the earlier yellow, hard-edged frame treatment.
- 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 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. - 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. - The title screen exposes Start, Load, and Settings, and Load now lets the player choose between the automatic record and the manual checkpoint.

View File

@@ -278,6 +278,8 @@ const UI_TITLE_BUTTON_TEXT := Color(1.0, 0.97, 0.86, 1.0)
const UI_OPENING_CAPTION_TITLE := Color(1.0, 0.96, 0.82, 1.0) const UI_OPENING_CAPTION_TITLE := Color(1.0, 0.96, 0.82, 1.0)
const UI_OPENING_CAPTION_BODY := Color(1.0, 0.985, 0.92, 1.0) const UI_OPENING_CAPTION_BODY := Color(1.0, 0.985, 0.92, 1.0)
const UI_OPENING_CAPTION_MUTED := Color(0.92, 0.84, 0.64, 1.0) const UI_OPENING_CAPTION_MUTED := Color(0.92, 0.84, 0.64, 1.0)
const UI_TOOLTIP_FONT_SIZE := 16
const UI_TOOLTIP_OUTLINE_SIZE := 3
const MAP_SCROLL_FRAME_PADDING := 12.0 const MAP_SCROLL_FRAME_PADDING := 12.0
const SPEAKER_DISPLAY_NAMES := { const SPEAKER_DISPLAY_NAMES := {
"Cao Cao": "조조", "Cao Cao": "조조",
@@ -1253,10 +1255,20 @@ func _make_ui_theme() -> Theme:
theme.set_font("normal_font", "RichTextLabel", regular) theme.set_font("normal_font", "RichTextLabel", regular)
theme.set_font("italics_font", "RichTextLabel", regular) theme.set_font("italics_font", "RichTextLabel", regular)
theme.set_font("mono_font", "RichTextLabel", regular) theme.set_font("mono_font", "RichTextLabel", regular)
theme.set_font("font", "TooltipLabel", regular)
var bold := _ui_font(true) var bold := _ui_font(true)
if bold != null: if bold != null:
theme.set_font("bold_font", "RichTextLabel", bold) theme.set_font("bold_font", "RichTextLabel", bold)
theme.set_font("bold_italics_font", "RichTextLabel", bold) theme.set_font("bold_italics_font", "RichTextLabel", bold)
theme.set_stylebox("panel", "TooltipPanel", _make_panel_style(UI_TEXT_DARK_SURFACE, Color(0.38, 0.31, 0.20, 1.0), 3, 7, 12, 14))
theme.set_color("font_color", "TooltipLabel", UI_PARCHMENT_TEXT)
theme.set_color("font_outline_color", "TooltipLabel", Color(0.0, 0.0, 0.0, 0.96))
theme.set_color("font_shadow_color", "TooltipLabel", Color(0.0, 0.0, 0.0, 0.72))
theme.set_font_size("font_size", "TooltipLabel", UI_TOOLTIP_FONT_SIZE)
theme.set_constant("outline_size", "TooltipLabel", UI_TOOLTIP_OUTLINE_SIZE)
theme.set_constant("shadow_offset_x", "TooltipLabel", 1)
theme.set_constant("shadow_offset_y", "TooltipLabel", 1)
theme.set_constant("line_spacing", "TooltipLabel", 4)
return theme return theme

View File

@@ -3859,6 +3859,8 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void:
failures.append("ancient UI bold font should load from project assets") failures.append("ancient UI bold font should load from project assets")
if scene.ui_root_control == null or scene.ui_root_control.theme == null or scene.ui_root_control.theme.default_font == null: if scene.ui_root_control == null or scene.ui_root_control.theme == null or scene.ui_root_control.theme.default_font == null:
failures.append("ancient UI root should install the project serif font as its default theme font") failures.append("ancient UI root should install the project serif font as its default theme font")
else:
_check_readable_tooltip_theme(failures, scene.ui_root_control.theme)
if scene._draw_ui_font(false) != scene._ui_font(false): if scene._draw_ui_font(false) != scene._ui_font(false):
failures.append("map labels should draw with the project serif font") failures.append("map labels should draw with the project serif font")
if scene._draw_ui_font(true) != scene._ui_font(true): if scene._draw_ui_font(true) != scene._ui_font(true):
@@ -4415,6 +4417,30 @@ func _check_top_hud_chip(failures: Array[String], scene, chip_name: String, expe
failures.append("top HUD chip tooltip should preserve detail `%s`: %s" % [expected_tooltip_text, tooltip_text]) failures.append("top HUD chip tooltip should preserve detail `%s`: %s" % [expected_tooltip_text, tooltip_text])
func _check_readable_tooltip_theme(failures: Array[String], theme: Theme) -> void:
var tooltip_panel := theme.get_stylebox("panel", "TooltipPanel")
if not (tooltip_panel is StyleBoxFlat):
failures.append("tooltip panel should use the ancient flat readable surface")
else:
var style := tooltip_panel as StyleBoxFlat
if style.bg_color.a < 0.98 or style.bg_color.get_luminance() > 0.12:
failures.append("tooltip panel should use an opaque dark backing: %s" % str(style.bg_color))
if style.content_margin_left < 10 or style.content_margin_top < 10:
failures.append("tooltip panel should reserve readable text padding")
if style.shadow_size < 10:
failures.append("tooltip panel should cast enough shadow to detach from the map")
if theme.get_font("font", "TooltipLabel") == null:
failures.append("tooltip label should use the project Korean serif font")
if theme.get_font_size("font_size", "TooltipLabel") < 15:
failures.append("tooltip label should keep readable Korean type size")
if theme.get_constant("outline_size", "TooltipLabel") < 2:
failures.append("tooltip label should carry an ink outline")
if theme.get_constant("line_spacing", "TooltipLabel") < 3:
failures.append("tooltip label should reserve readable Korean line spacing")
if theme.get_color("font_color", "TooltipLabel").get_luminance() < 0.70:
failures.append("tooltip label should use bright text over dark backing")
func _collect_child_tooltips(root: Node) -> String: func _collect_child_tooltips(root: Node) -> String:
if root == null: if root == null:
return "" return ""