53 lines
2.1 KiB
GDScript
53 lines
2.1 KiB
GDScript
class_name ABGM54ContractHeader
|
|
extends Control
|
|
|
|
const UIFactory = preload("res://ui/shared/ui_factory.gd")
|
|
|
|
var title_text := "委托板"
|
|
var subtitle_text := "风镜原野 · 首次远征"
|
|
var status_text := ""
|
|
|
|
func configure(next_title: String, next_subtitle: String, next_status: String) -> ABGM54ContractHeader:
|
|
title_text = next_title
|
|
subtitle_text = next_subtitle
|
|
status_text = next_status
|
|
return self
|
|
|
|
func _ready() -> void:
|
|
clip_contents = true
|
|
var title := UIFactory.label(title_text, "title", 1.0, Color("#fff4d6"))
|
|
title.name = "ContractHeaderTitle"
|
|
title.anchor_right = 0.68
|
|
# Keep the title and subtitle on separate authored rows at phone-landscape
|
|
# sizes; the previous 0.64/0.58 split let glyphs touch after scaling.
|
|
title.anchor_bottom = 0.54
|
|
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
|
|
title.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
|
title.clip_text = true
|
|
title.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
|
|
title.add_theme_color_override("font_outline_color", Color(0.03, 0.07, 0.09, 0.95))
|
|
title.add_theme_constant_override("outline_size", 3)
|
|
add_child(title)
|
|
var subtitle := UIFactory.label(subtitle_text, "micro", 1.0, Color("#ffe5a8"))
|
|
subtitle.name = "ContractHeaderSubtitle"
|
|
subtitle.anchor_top = 0.62
|
|
subtitle.anchor_right = 0.68
|
|
subtitle.anchor_bottom = 1.0
|
|
subtitle.clip_text = true
|
|
subtitle.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
|
|
subtitle.add_theme_color_override("font_outline_color", Color(0.03, 0.07, 0.09, 0.9))
|
|
subtitle.add_theme_constant_override("outline_size", 2)
|
|
add_child(subtitle)
|
|
var status := UIFactory.label(status_text, "micro", 1.0, Color("#a8d8ec"))
|
|
status.name = "ContractHeaderStatus"
|
|
status.anchor_left = 0.70
|
|
status.anchor_right = 1.0
|
|
status.anchor_bottom = 1.0
|
|
status.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
|
status.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
|
status.clip_text = true
|
|
status.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
|
|
status.add_theme_color_override("font_outline_color", Color(0.03, 0.07, 0.09, 0.9))
|
|
status.add_theme_constant_override("outline_size", 2)
|
|
add_child(status)
|