fix: prioritize market purchase price

This commit is contained in:
2026-09-09 18:06:16 +08:00
parent 311a7fd86b
commit 5c0b170eb9
2 changed files with 7 additions and 3 deletions
+4 -2
View File
@@ -960,7 +960,9 @@ func _render_m52_market_restore(data: Dictionary) -> void:
# widths. Keep the decision facts to role + trait here; the price has its
# own slot below, so cost text cannot collide with the action dock.
selected_detail = "%s\n%s" % [String(p.get("profession_name", "")), String(p.get("trait_name", ""))]
selected_price = String(p.get("state_text", ""))
# The card may show a full availability sentence, but the narrow ledger
# needs one decisive purchase fact that remains readable in both locales.
selected_price = "%d %s" % [int(selected.get("list_price", 0)), _tr("金币", "COIN", data)]
selected_texture = InitialCompanyArt.texture_for(selected)
var has_selection := selected_texture != null
if has_selection:
@@ -988,7 +990,7 @@ func _render_m52_market_restore(data: Dictionary) -> void:
detail.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
ledger.add_child(detail)
if has_selection and not selected_price.is_empty():
var price := UIFactory.label(selected_price, "micro", 1.0, MarketChrome.INK_SOFT)
var price := UIFactory.label(selected_price, "label", 1.0, MarketChrome.BRASS)
price.name = "MarketCandidatePrice"
_market_place(price, MarketSlots.slot("ledger", "selected_price"))
price.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
+3 -1
View File
@@ -41,7 +41,9 @@ const LEDGER := {
"selected_portrait": Rect2(0.08, 0.24, 0.38, 0.32),
"selected_name": Rect2(0.50, 0.26, 0.40, 0.10),
"selected_detail": Rect2(0.50, 0.38, 0.40, 0.20),
"selected_price": Rect2(0.50, 0.59, 0.40, 0.06),
# Keep the cost above the teal action dock and give it a readable line of
# its own. This is the primary purchase fact, not secondary footnote copy.
"selected_price": Rect2(0.50, 0.64, 0.40, 0.08),
"action": Rect2(0.10, 0.80, 0.80, 0.14),
}