Improve shop item previews

This commit is contained in:
2026-06-18 22:56:49 +09:00
parent 65d6dff0f0
commit 2183580d81
2 changed files with 131 additions and 6 deletions

View File

@@ -195,6 +195,29 @@ func _check_scene_texture_loading(failures: Array[String]) -> void:
var merchant_notice := scene._format_shop_merchant_notice_text(scene.state.get_shop_merchant())
if not merchant_notice.contains("Camp Merchant") or not merchant_notice.contains("Roadside stores"):
failures.append("shop merchant notice should include name and flavor lines")
var bean: Dictionary = scene.state.get_item_def("bean")
var bean_buy_detail := scene._format_shop_buy_item_detail_text("bean", bean, int(bean.get("price", 0)), 0)
if not bean_buy_detail.contains("Heal 20") or not bean_buy_detail.contains("Owned x0"):
failures.append("shop buy detail should summarize item effect and owned count")
scene.campaign_state.gold = 10
var need_gold_detail := scene._format_shop_buy_item_detail_text("bean", bean, int(bean.get("price", 0)), 0)
if not need_gold_detail.contains("Need 40G"):
failures.append("shop buy detail should explain missing gold")
var sold_out_detail := scene._format_shop_buy_item_detail_text("bean", bean, int(bean.get("price", 0)), 2, 3, 0)
if not sold_out_detail.contains("Stock 0/3") or not sold_out_detail.contains("Sold out"):
failures.append("shop buy detail should explain exhausted finite stock")
var sell_detail := scene._format_shop_sell_item_detail_text("bean", bean, 25, 2)
if not sell_detail.contains("Half-price sale") or not sell_detail.contains("Owned x2"):
failures.append("shop sell detail should summarize sale rule and owned count")
var bean_action := scene._format_shop_buy_action_text("bean", bean, int(bean.get("price", 0)))
if not bean_action.contains("Buy Bean") or not bean_action.contains("50G"):
failures.append("shop buy action should be concise and priced")
var bean_tooltip := scene._format_shop_item_tooltip_text(
scene._format_shop_item_button_text("bean", bean, int(bean.get("price", 0)), 0),
bean_buy_detail
)
if not bean_tooltip.contains("\n") or not bean_tooltip.contains("Owned x0"):
failures.append("shop item tooltip should preserve full item detail")
scene.free()
_check_scenario_background_texture_loading(failures)