Files
aetherbound-guild/runtime/ui/m52/profession_module.gd
T
wushenghua db7b3d65e4 fix(m58-b): market read-surface type scale, contrast and slot ownership
Measured inventory first: the market modules authored their labels at raw token
sizes while the view uses the canvas text scale, leaving module labels near 6.5
physical pixels at 760, and the card, trait and cost surfaces were drawn in
fixed pixels against proportional label slots. Every module now takes the view's
canvas type scale; the card band and price strip are fractions of the card size
that cover their slots; the trait chip and cost strip are proportional chrome
with the coin anchored in the authored socket; ledger labels move to ink on
parchment and the ledger keeps the full availability string while the card row
carries only the amount.
2026-09-13 16:53:51 +08:00

26 lines
850 B
GDScript

class_name ABGM52ProfessionModule
extends Control
const UIFactory = preload("res://ui/shared/ui_factory.gd")
const MarketChrome = preload("res://ui/shared/market_chrome.gd")
var value := ""
var text_scale := 1.0
func configure(next_value: String, next_text_scale := 1.0) -> ABGM52ProfessionModule:
value = next_value
text_scale = next_text_scale
return self
func _ready() -> void:
clip_contents = true
var label := UIFactory.label(value, "micro", text_scale, MarketChrome.INK)
label.name = "ProfessionLabel"
label.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
label.clip_text = true
label.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
label.mouse_filter = Control.MOUSE_FILTER_IGNORE
add_child(label)