fix: align market text states and control contrast
This commit is contained in:
@@ -835,10 +835,11 @@ func _render_m52_market_restore(data: Dictionary) -> void:
|
||||
var title := UIFactory.label(_tr("市场", "MARKET", data), "title", 1.0, MarketChrome.INK)
|
||||
title.name = "M50MarketTitle"
|
||||
title.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
title.offset_left = 18.0
|
||||
title.offset_right = -18.0
|
||||
title.offset_top = 15.0
|
||||
title.offset_bottom = -24.0
|
||||
title.offset_left = 12.0
|
||||
title.offset_right = -12.0
|
||||
title.offset_top = 0.0
|
||||
title.offset_bottom = 0.0
|
||||
_market_place(title, Rect2(0.12, 0.22, 0.76, 0.40))
|
||||
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
title.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
title.add_theme_color_override("font_shadow_color", Color(MarketChrome.PAPER_LIGHT, 0.92))
|
||||
@@ -848,22 +849,23 @@ func _render_m52_market_restore(data: Dictionary) -> void:
|
||||
var stage := UIFactory.label(_tr("准备出发", "PREPARE TO DEPART", data), "micro", 1.0, MarketChrome.INK_SOFT)
|
||||
stage.name = "M50MarketStage"
|
||||
stage.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
stage.offset_left = 20.0
|
||||
stage.offset_right = -20.0
|
||||
stage.offset_top = 42.0 if canvas.size.y < 500.0 else 58.0
|
||||
stage.offset_bottom = -8.0
|
||||
stage.offset_left = 0.0
|
||||
stage.offset_right = 0.0
|
||||
stage.offset_top = 0.0
|
||||
stage.offset_bottom = 0.0
|
||||
_market_place(stage, Rect2(0.22, 0.64, 0.56, 0.18))
|
||||
stage.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
stage.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
title_plate.add_child(stage)
|
||||
page.add_child(title_plate)
|
||||
|
||||
var company_facts: Dictionary = Dictionary(data.get("company", {}))
|
||||
var company_badge := _m52_resource_badge("MarketCompanyStatus", "company", _tr("队伍", "LINE", data), "%d/%d" % [int(company_facts.get("owned_count", 0)), int(company_facts.get("line_capacity", 0))], Rect2(0.70, 0.055, 0.12, 0.085))
|
||||
var company_badge := _m52_resource_badge("MarketCompanyStatus", "company", _tr("队伍", "LINE", data), "%d/%d" % [int(company_facts.get("owned_count", 0)), int(company_facts.get("line_capacity", 0))], Rect2(0.69, 0.045, 0.13, 0.10))
|
||||
page.add_child(company_badge)
|
||||
var coin_badge := _m52_resource_badge("MarketCoinStatus", "coin", _tr("金币", "COIN", data), "%d" % int(company_facts.get("coin", 0)), Rect2(0.825, 0.055, 0.105, 0.085))
|
||||
var coin_badge := _m52_resource_badge("MarketCoinStatus", "coin", _tr("金币", "COIN", data), "%d" % int(company_facts.get("coin", 0)), Rect2(0.825, 0.045, 0.11, 0.10))
|
||||
page.add_child(coin_badge)
|
||||
var settings := UIFactory.command_button("MarketSettings", "", "icon", "settings", "flat", "content", Vector2(48, 48))
|
||||
_market_place(settings, Rect2(0.935, 0.050, 0.045, 0.09))
|
||||
_market_place(settings, Rect2(0.94, 0.045, 0.05, 0.10))
|
||||
settings.tooltip_text = _tr("打开设置", "Open settings", data)
|
||||
settings.pressed.connect(func(): emit_intent("settings", {}), CONNECT_DEFERRED)
|
||||
page.add_child(settings)
|
||||
@@ -938,7 +940,7 @@ func _render_m52_market_restore(data: Dictionary) -> void:
|
||||
|
||||
var ledger_title := UIFactory.label(_tr("候选人详情", "CANDIDATE DETAILS", data), "label", 1.0, MarketChrome.INK)
|
||||
ledger_title.name = "M50CommissionBoardTitle"
|
||||
_market_place(ledger_title, Rect2(0.08, 0.07, 0.84, 0.10))
|
||||
_market_place(ledger_title, Rect2(0.32, 0.12, 0.60, 0.11))
|
||||
ledger_title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
ledger_title.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
ledger.add_child(ledger_title)
|
||||
@@ -949,10 +951,14 @@ func _render_m52_market_restore(data: Dictionary) -> void:
|
||||
if not selected_offer_id.is_empty() and not selected.is_empty():
|
||||
var p := _offer_presentation(selected)
|
||||
selected_title = String(p.get("title", ""))
|
||||
selected_detail = String(p.get("short_detail", ""))
|
||||
# The ledger has a narrow right-hand copy column at phone landscape
|
||||
# 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", ""))
|
||||
selected_texture = InitialCompanyArt.texture_for(selected)
|
||||
if selected_texture != null:
|
||||
var has_selection := selected_texture != null
|
||||
if has_selection:
|
||||
var portrait := TextureRect.new()
|
||||
portrait.name = "MarketCandidatePortrait"
|
||||
portrait.texture = selected_texture
|
||||
@@ -962,24 +968,24 @@ func _render_m52_market_restore(data: Dictionary) -> void:
|
||||
_market_place(portrait, Rect2(0.10, 0.24, 0.38, 0.32))
|
||||
portrait.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
ledger.add_child(portrait)
|
||||
var detail_title := UIFactory.label(selected_title if not selected_title.is_empty() else _tr("候选人名册", "ADVENTURER LEDGER", data), "label", 1.0, MarketChrome.INK)
|
||||
var detail_title := UIFactory.label(selected_title if has_selection else _tr("选择候选人", "SELECT A RECRUIT", data), "label", 1.0, MarketChrome.INK)
|
||||
detail_title.name = "MarketCandidateName"
|
||||
_market_place(detail_title, Rect2(0.50, 0.26, 0.40, 0.10))
|
||||
_market_place(detail_title, Rect2(0.14, 0.43, 0.72, 0.10) if not has_selection else Rect2(0.50, 0.26, 0.40, 0.10))
|
||||
detail_title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
detail_title.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
detail_title.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
|
||||
ledger.add_child(detail_title)
|
||||
var detail := UIFactory.label(selected_detail, "micro", 1.0, MarketChrome.INK_SOFT)
|
||||
detail.name = "MarketNoSelection" if selected_offer_id.is_empty() else "M50CommissionDetail"
|
||||
_market_place(detail, Rect2(0.50, 0.38, 0.40, 0.22))
|
||||
_market_place(detail, Rect2(0.16, 0.54, 0.68, 0.14) if not has_selection else Rect2(0.50, 0.38, 0.40, 0.22))
|
||||
detail.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
detail.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
detail.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
ledger.add_child(detail)
|
||||
if not selected_price.is_empty():
|
||||
var price := UIFactory.label(selected_price, "label", 1.0, MarketChrome.INK)
|
||||
if has_selection and not selected_price.is_empty():
|
||||
var price := UIFactory.label(selected_price, "micro", 1.0, MarketChrome.INK_SOFT)
|
||||
price.name = "MarketCandidatePrice"
|
||||
_market_place(price, Rect2(0.50, 0.63, 0.40, 0.07))
|
||||
_market_place(price, Rect2(0.50, 0.59, 0.40, 0.06))
|
||||
price.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
price.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
ledger.add_child(price)
|
||||
@@ -992,11 +998,6 @@ func _render_m52_market_restore(data: Dictionary) -> void:
|
||||
var back := _m52_wood_button("MarketBackGuild", _tr("返回公会", "BACK", data), Rect2(0.045, 0.865, 0.17, 0.105), "back", {}, data)
|
||||
back.z_index = 20
|
||||
page.add_child(back)
|
||||
var flow := UIFactory.label(_tr("选择候选人 → 查看详情 → 进入编队", "SELECT → REVIEW → FORM", data), "micro", 1.0, MarketChrome.PAPER_LIGHT)
|
||||
_market_place(flow, Rect2(0.24, 0.88, 0.38, 0.06))
|
||||
flow.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
flow.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
page.add_child(flow)
|
||||
var return_enabled := bool(return_facts.get("enabled", false))
|
||||
var return_button := _m52_wood_button("MarketReturnContract", _tr("返回委托", "RETURN", data), Rect2(0.72, 0.865, 0.22, 0.105), "risk", {"disabled": not return_enabled}, data)
|
||||
return_button.set_meta("market_command_role", "contract_return")
|
||||
@@ -1128,9 +1129,9 @@ func _m52_wood_button(node_name: String, text_value: String, area: Rect2, icon_k
|
||||
var chrome := _m52_texture_surface(preload("res://assets/ui_m52_market/v2/wood_button.png"), "WoodChrome", Vector4(46, 34, 46, 34))
|
||||
chrome.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
button.add_child(chrome)
|
||||
var icon := UIFactory.attach_icon(button, icon_kind, "CommandIcon", "light", Rect2(0.05, 0.20, 0.18, 0.60))
|
||||
var icon := UIFactory.attach_icon(button, icon_kind, "CommandIcon", "dark", Rect2(0.05, 0.20, 0.18, 0.60))
|
||||
icon.texture_filter = CanvasItem.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS
|
||||
var label := UIFactory.label(text_value, "label", 1.0, MarketChrome.PAPER_LIGHT)
|
||||
var label := UIFactory.label(text_value, "label", 1.0, MarketChrome.INK)
|
||||
label.name = "ButtonLabel"
|
||||
_market_place(label, Rect2(0.22, 0.08, 0.72, 0.84))
|
||||
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
|
||||
Reference in New Issue
Block a user