Improve readable text backings

This commit is contained in:
2026-06-20 17:16:43 +09:00
parent cce0207ce7
commit 81672d5a27
3 changed files with 90 additions and 14 deletions

View File

@@ -852,9 +852,11 @@ func _panel_texture_spec(variant: String) -> Dictionary:
func _panel_variant_prefers_flat_text_surface(variant: String) -> bool:
return variant in [
"compact",
"dialogue",
"speech_scroll",
"notice_edict",
"target_hint",
"cinematic_caption",
"story_caption"
]
@@ -983,14 +985,14 @@ func _apply_panel_style(panel: PanelContainer, variant: String) -> void:
margin = 18
shadow_size = 6
"hud_info":
fill = Color(0.045, 0.050, 0.048, 0.90)
border = Color(0.20, 0.24, 0.21, 0.96)
fill = Color(0.045, 0.050, 0.048, 0.988)
border = Color(0.20, 0.24, 0.21, 1.0)
border_width = 2
radius = 9
margin = 7
shadow_size = 3
"target_hint":
fill = Color(0.050, 0.070, 0.062, 0.94)
fill = Color(0.050, 0.070, 0.062, 0.992)
border = UI_JADE_EDGE
border_width = 3
radius = 10
@@ -1016,8 +1018,8 @@ func _apply_panel_style(panel: PanelContainer, variant: String) -> void:
margin = 10
shadow_size = 10
"compact":
fill = Color(0.045, 0.048, 0.044, 0.93)
border = UI_TARNISHED_BRONZE
fill = Color(0.045, 0.048, 0.044, 0.988)
border = Color(UI_TARNISHED_BRONZE.r, UI_TARNISHED_BRONZE.g, UI_TARNISHED_BRONZE.b, 1.0)
border_width = 3
radius = 10
margin = 8
@@ -2329,6 +2331,32 @@ func _apply_label_style(label: Label, font_color: Color, font_size: int = 0) ->
_apply_text_legibility(label, font_color, font_size)
func _apply_rich_text_style(label: RichTextLabel, font_color: Color, font_size: int = 13) -> void:
if label == null:
return
label.add_theme_color_override("default_color", font_color)
label.add_theme_color_override("font_outline_color", _text_outline_color_for(font_color))
label.add_theme_color_override("font_shadow_color", UI_TEXT_SHADOW)
label.add_theme_constant_override("outline_size", 2 if font_size < 16 else 3)
label.add_theme_constant_override("shadow_offset_x", 1)
label.add_theme_constant_override("shadow_offset_y", 1)
label.add_theme_constant_override("line_separation", 4)
var regular := _ui_font(false)
if regular != null:
label.add_theme_font_override("normal_font", regular)
label.add_theme_font_override("italics_font", regular)
label.add_theme_font_override("mono_font", regular)
var bold := _ui_font(true)
if bold != null:
label.add_theme_font_override("bold_font", bold)
label.add_theme_font_override("bold_italics_font", bold)
label.add_theme_font_size_override("normal_font_size", font_size)
label.add_theme_font_size_override("bold_font_size", font_size)
label.add_theme_font_size_override("italics_font_size", font_size)
label.add_theme_font_size_override("bold_italics_font_size", font_size)
label.add_theme_font_size_override("mono_font_size", font_size)
func _apply_opening_caption_text_style(label: Label, font_color: Color, font_size: int = 0) -> void:
if label == null:
return
@@ -3920,8 +3948,8 @@ func _create_hud() -> void:
log_box = RichTextLabel.new()
log_box.custom_minimum_size = Vector2(420, 70)
log_box.fit_content = false
log_box.add_theme_color_override("default_color", UI_PARCHMENT_TEXT)
log_box.add_theme_stylebox_override("normal", _make_panel_style(Color(0.11, 0.07, 0.045, 0.78), UI_RICE_PAPER_DARK, 1, 6, 6, 0))
_apply_rich_text_style(log_box, UI_PARCHMENT_TEXT, 13)
log_box.add_theme_stylebox_override("normal", _make_panel_style(Color(0.030, 0.028, 0.024, 0.996), Color(0.22, 0.18, 0.12, 1.0), 1, 6, 8, 0))
side_column.add_child(log_box)
_create_command_hint_panel(root)
@@ -4802,7 +4830,7 @@ func _create_hud() -> void:
title_load_panel = PanelContainer.new()
title_load_panel.visible = false
title_load_panel.custom_minimum_size = Vector2(390, 188)
_apply_panel_style(title_load_panel, "hud_info")
_apply_panel_style(title_load_panel, "hud_readable")
title_menu_column.add_child(title_load_panel)
var title_load_column := VBoxContainer.new()
@@ -4856,7 +4884,7 @@ func _create_hud() -> void:
title_settings_panel = PanelContainer.new()
title_settings_panel.visible = false
title_settings_panel.custom_minimum_size = Vector2(390, 362)
_apply_panel_style(title_settings_panel, "hud_info")
_apply_panel_style(title_settings_panel, "hud_readable")
title_menu_column.add_child(title_settings_panel)
var title_settings_column := VBoxContainer.new()