Polish inventory shop and utility interfaces

Split inventory items and tackle views, standardize bait supply presentation, add status-effect icons, and align shop, logbook, art-kit, and shared utility layouts.
This commit is contained in:
Alexander Sellite 2026-08-15 14:28:13 -04:00
parent 84695c473b
commit a60925bf7b
21 changed files with 1150 additions and 385 deletions

View file

@ -399,6 +399,33 @@ func _run() -> void:
assert(hide_button.button_group.allow_unpress)
assert(brush_option.item_count == 4)
assert(grid_option.item_count == 4)
var expected_brush_icons: Array[String] = [
"art_kit_marker_tip_fine.png",
"art_kit_marker_tip_thin.png",
"art_kit_marker_tip_mid.png",
"art_kit_marker_tip_thick.png",
]
var expected_grid_icons: Array[String] = [
"art_kit_grid_small_light.png",
"art_kit_grid_medium_light.png",
"art_kit_grid_large_light.png",
"art_kit_grid_xl_light.png",
]
for index: int in 4:
assert(brush_option.get_item_text(index).is_empty())
assert(grid_option.get_item_text(index).is_empty())
assert(brush_option.get_item_icon(index) != null)
assert(grid_option.get_item_icon(index) != null)
assert(
brush_option.get_item_icon(index).resource_path.ends_with(
expected_brush_icons[index]
)
)
assert(
grid_option.get_item_icon(index).resource_path.ends_with(
expected_grid_icons[index]
)
)
assert(not brush_option.get_popup().is_item_disabled(0))
assert(brush_option.get_popup().is_item_disabled(1))
assert(not grid_option.get_popup().is_item_disabled(0))

View file

@ -570,6 +570,53 @@ func _test_fishing_shop_sale_ui(
and shop_backdrop != null
and ui_viewport != null
)
var item_catalog := main.get("item_catalog") as ItemCatalog
var worms: ItemData = item_catalog.get_item_by_id(&"worms")
assert(worms != null and worms.max_stack == 10)
if player.bag.get_quantity(worms.item_id) == 0:
assert(player.bag.add_item(worms.item_id, 4))
assert(player.equip_bait(worms))
await process_frame
var expected_bait_supply := UtilityPageStyle.supply_quantity_text(
player.bag.get_quantity(worms.item_id),
worms.max_stack,
)
var hud_bait_quantity := game_ui.get_node(
"%ActiveBaitQuantity"
) as Label
assert(hud_bait_quantity.text == expected_bait_supply)
var hud_bait_badge := hud_bait_quantity.get_parent() as Panel
assert(
is_equal_approx(
hud_bait_badge.rotation_degrees,
UtilityPageStyle.SUPPLY_BADGE_ROTATION_DEGREES,
)
)
player_menu.call("_refresh_tackle_box")
await process_frame
var tackle_bait_button: Button
for child: Node in player_menu.get_node("%BaitItemList").get_children():
var candidate := child as Button
if (
candidate != null
and candidate.get_meta(&"controller_tackle_item_id", StringName())
== worms.item_id
):
tackle_bait_button = candidate
break
assert(tackle_bait_button != null)
var tackle_quantity := tackle_bait_button.get_node(
"QuantityBadge/Quantity"
) as Label
assert(tackle_quantity.text == expected_bait_supply)
assert(tackle_bait_button.tooltip_text.contains(expected_bait_supply))
var tackle_badge := tackle_quantity.get_parent() as Panel
assert(
is_equal_approx(
tackle_badge.rotation_degrees,
UtilityPageStyle.SUPPLY_BADGE_ROTATION_DEGREES,
)
)
player.global_position = interaction.global_position
for _frame: int in 4:
await physics_frame
@ -596,6 +643,14 @@ func _test_fishing_shop_sale_ui(
assert(shop_panel_style.corner_radius_top_left == 24)
var upgrade_grid := shop.get_node("%UpgradeGrid") as GridContainer
assert(upgrade_grid != null and upgrade_grid.columns == 3)
assert(
upgrade_grid.get_theme_constant("h_separation")
== FishingShop.SHOP_SLOT_SEPARATION
)
assert(
upgrade_grid.get_theme_constant("v_separation")
== FishingShop.SHOP_SLOT_SEPARATION
)
assert((shop.get_node("%Upgrades") as Control).visible)
assert(not (shop.get_node("%Supplies") as Control).visible)
for upgrade_name: String in [
@ -638,6 +693,89 @@ func _test_fishing_shop_sale_ui(
assert(sell_mode != null and sell_mode.text == "Sell Fish")
var equipment_tab := shop_tabs[3] as Button
assert(equipment_tab != null and equipment_tab.text == "Equipment")
var supplies_list := shop.get_node("%SuppliesList") as VBoxContainer
var bait_tab := shop_tabs[1] as Button
assert(bait_tab != null and bait_tab.text == "Bait and Lures")
await _activate_pointer_control(bait_tab, ui_viewport)
await process_frame
var worms_button := supplies_list.find_child(
"Supply_worms", true, false
) as Button
var snails_button := supplies_list.find_child(
"Supply_snails", true, false
) as Button
assert(worms_button != null and snails_button != null)
var bait_grid := worms_button.get_parent().get_parent() as GridContainer
assert(bait_grid != null)
assert(
bait_grid.get_theme_constant("h_separation")
== FishingShop.SHOP_SLOT_SEPARATION
)
assert(
bait_grid.get_theme_constant("v_separation")
== FishingShop.SHOP_SLOT_SEPARATION
)
var shop_bait_quantity := worms_button.get_node(
"SupplyQuantityBadge/Quantity"
) as Label
assert(shop_bait_quantity.text == expected_bait_supply)
var shop_bait_badge := shop_bait_quantity.get_parent() as Panel
assert(shop_bait_badge.position.y == FishingShop.BAIT_SUPPLY_BADGE_Y)
assert(
is_equal_approx(
shop_bait_badge.rotation_degrees,
UtilityPageStyle.SUPPLY_BADGE_ROTATION_DEGREES,
)
)
assert(
shop_bait_badge.position.y + shop_bait_badge.size.y
<= FishingShop.SUPPLY_PRICE_Y
)
var worms_unit_price: int = FishingShopStock.get_price(worms.item_id)
assert(
worms_button.tooltip_text.contains(
"%d fish coin%s per bait piece" % [
worms_unit_price,
"" if worms_unit_price == 1 else "s",
]
)
)
assert(not worms_button.tooltip_text.contains("owned"))
var worms_restock_quantity: int = FishingShopStock.get_purchase_quantity(
worms.item_id,
player.bag.get_quantity(worms.item_id),
worms.max_stack,
)
var worms_restock_cost: int = FishingShopStock.get_purchase_cost(
worms.item_id,
worms_restock_quantity,
player.bag.is_bait_unlocked(worms.item_id),
)
var worms_price := worms_button.get_parent().get_node(
"PriceBubble/CurrencyAmount/Price"
) as Label
assert(worms_price.text == str(maxi(worms_restock_cost, 0)))
var bait_receipt: String = shop.call(
"_purchase_success_feedback",
worms.item_id,
NetworkShopProtocol.ProductCategory.SUPPLY,
maxi(worms_restock_quantity, 1),
maxi(worms_restock_cost, worms_unit_price),
)
assert(bait_receipt.begins_with("Bait Restocked\n"))
assert(bait_receipt.contains(CurrencyPresentation.ICON_PATH))
assert(bait_receipt.contains(" spent on "))
assert(bait_receipt.ends_with(" worms"))
assert(snails_button.get_node_or_null("SupplyQuantityBadge") == null)
assert(worms_button.get_node_or_null("UnlockStateIcon") == null)
var snails_lock_icon := snails_button.get_node(
"UnlockStateIcon"
) as TextureRect
assert(not bool(snails_lock_icon.get_meta(&"unlocked")))
assert(snails_lock_icon.texture.resource_path.ends_with(
"/lock_light.png"
))
assert(is_equal_approx(snails_lock_icon.modulate.a, 0.75))
await _activate_pointer_control(equipment_tab, ui_viewport)
await process_frame
var equipment_sections: Array[String] = []
@ -645,17 +783,21 @@ func _test_fishing_shop_sale_ui(
if child is Label:
equipment_sections.append((child as Label).text)
assert(equipment_sections == ["rods", "equipment"])
var supplies_list := shop.get_node("%SuppliesList") as VBoxContainer
var rod_carousel := supplies_list.get_node("RodCarousel") as HBoxContainer
assert(rod_carousel != null)
var rod_cards := rod_carousel.get_node("RodScroll/RodCards") as HBoxContainer
assert(rod_cards != null and rod_cards.get_child_count() == 1)
assert(
rod_cards.get_theme_constant("separation")
== FishingShop.SHOP_SLOT_SEPARATION
)
var basic_rod_button := rod_cards.find_child(
"Rod_basic_fishing_rod", true, false
) as Button
assert(basic_rod_button != null)
assert(basic_rod_button.custom_minimum_size == Vector2(144.0, 144.0))
assert(basic_rod_button.icon != null and basic_rod_button.disabled)
assert(basic_rod_button.get_node_or_null("UnlockStateIcon") == null)
assert(rod_cards.find_child("Rod_aurora_rod", true, false) == null)
await _activate_pointer_control(art_supplies_tab, ui_viewport)
await process_frame
@ -681,6 +823,42 @@ func _test_fishing_shop_sale_ui(
marker_material.get_shader_parameter("marker_color")
== SurfaceDrawingPalette.get_color(color_id)
)
var expected_art_upgrade_icons: Dictionary[StringName, String] = {
&"brush_2x": "art_kit_marker_tip_thin.png",
&"brush_3x": "art_kit_marker_tip_mid.png",
&"brush_4x": "art_kit_marker_tip_thick.png",
&"grid_32x": "art_kit_grid_medium_light.png",
&"grid_64x": "art_kit_grid_large_light.png",
&"grid_128x": "art_kit_grid_xl_light.png",
}
var found_art_upgrade_icons: int = 0
for upgrade_node: Node in shop.find_children("*", "Button", true, false):
var upgrade_button := upgrade_node as Button
if not upgrade_button.has_meta(&"art_product_id"):
continue
var product_id := StringName(
str(upgrade_button.get_meta(&"art_product_id"))
)
if not expected_art_upgrade_icons.has(product_id):
continue
found_art_upgrade_icons += 1
assert(upgrade_button.text.is_empty())
assert(upgrade_button.icon != null)
var product_unlocked: bool = (
player.art_unlocks.owns_product(product_id)
)
var state_icon := upgrade_button.get_node_or_null(
"UnlockStateIcon"
) as TextureRect
assert((state_icon == null) == product_unlocked)
if state_icon != null:
assert(state_icon.texture.resource_path.ends_with("/lock_light.png"))
assert(
upgrade_button.icon.resource_path.ends_with(
expected_art_upgrade_icons[product_id]
)
)
assert(found_art_upgrade_icons == expected_art_upgrade_icons.size())
var price_bubbles := shop.find_children(
"PriceBubble", "PanelContainer", true, false
)

View file

@ -16,6 +16,25 @@ func _initialize() -> void:
var shop := FishingShopType.new()
assert(shop.call("_unlock_status", false) == "locked")
assert(shop.call("_unlock_status", true) == "unlocked")
var locked_button := Button.new()
shop.call(
"_add_unlock_state_icon", locked_button, false, Vector2(72.0, 72.0)
)
var locked_icon := locked_button.get_node(
"UnlockStateIcon"
) as TextureRect
assert(locked_icon.texture.resource_path.ends_with("/lock_light.png"))
assert(locked_icon.size == Vector2(48.0, 48.0))
assert(locked_icon.position == Vector2(12.0, 6.0))
assert(is_equal_approx(locked_icon.modulate.a, 0.75))
assert(not bool(locked_icon.get_meta(&"unlocked")))
locked_button.free()
var unlocked_button := Button.new()
shop.call(
"_add_unlock_state_icon", unlocked_button, true, Vector2(72.0, 72.0)
)
assert(unlocked_button.get_node_or_null("UnlockStateIcon") == null)
unlocked_button.free()
shop.free()
var magnet: ItemDataType = ItemCatalogResource.get_available_item_by_id(
@ -30,6 +49,12 @@ func _initialize() -> void:
assert(FishingShopStockType.get_price(&"magnet") == 250)
assert(FishingShopStockType.get_stock_item_ids().has(&"magnet"))
assert(FishingShopStockType.is_permanent_unlock(&"magnet", magnet))
var crab_net: ItemDataType = ItemCatalogResource.get_available_item_by_id(
&"crab_net"
)
assert(crab_net != null)
assert(crab_net.icon != null)
assert(crab_net.icon.resource_path.ends_with("/equipment/temp_net.png"))
var wallet := PlayerWalletType.new()
wallet.current_balance = 250

View file

@ -58,6 +58,7 @@ func _run() -> void:
))
_validate_shared_inventory_geometry(player_menu)
_validate_inventory_layering(player_menu)
_validate_tackle_to_items_transition(player_menu)
_validate_cooler_notepad_typography(player_menu)
_validate_resolution_matrix()
await _capture_inventory_pages(player_menu)
@ -101,6 +102,15 @@ func _apply_stage_layout(stage: Control, display_size: Vector2) -> void:
func _validate_shared_inventory_geometry(player_menu: PlayerMenu) -> void:
for node_name: StringName in [
&"CoolerOuterWall",
&"BagOuterWall",
&"TackleMainPanel",
]:
var main_panel := player_menu.get_node("%%%s" % node_name) as Control
assert(main_panel != null)
assert(main_panel.position.is_equal_approx(INVENTORY_PANEL_RECT.position))
assert(main_panel.size.is_equal_approx(INVENTORY_PANEL_RECT.size))
for node_name: StringName in [
&"DetailConstellation",
&"BagDetailConstellation",
@ -113,17 +123,24 @@ func _validate_shared_inventory_geometry(player_menu: PlayerMenu) -> void:
func _validate_inventory_layering(player_menu: PlayerMenu) -> void:
var bag_filters := player_menu.get_node("%BagFilterTabs") as Control
var bag_panel := player_menu.get_node("%BagOuterWall") as Control
var sale_confirmation := player_menu.get_node("%SaleConfirmation") as Control
var cooler_panel := player_menu.get_node("%CoolerOuterWall") as Control
var tackle_panel := player_menu.get_node("%TackleMainPanel") as Control
assert(bag_filters != null)
var inventory_tabs := player_menu.get_node("%InventorySubTabs") as Control
var items_tab := player_menu.get_node("%ItemsSubTab") as Button
var bait_list := player_menu.get_node("%BaitItemList") as GridContainer
var lure_list := player_menu.get_node("%LureItemList") as GridContainer
assert(bag_panel != null)
assert(sale_confirmation != null)
assert(cooler_panel != null)
assert(tackle_panel != null)
assert(bag_filters.z_index > bag_panel.z_index)
assert(inventory_tabs != null)
assert(items_tab != null and items_tab.text == "Items")
assert(bait_list != null and bait_list.columns == 3)
assert(lure_list != null and lure_list.columns == 3)
assert(bait_list.get_theme_constant("h_separation") == 28)
assert(lure_list.get_theme_constant("h_separation") == 28)
assert(sale_confirmation.z_index > cooler_panel.z_index)
assert(sale_confirmation.z_index > tackle_panel.z_index)
# The contextual Hotbar uses z=90 while the Player Menu is open.
@ -141,6 +158,28 @@ func _validate_inventory_layering(player_menu: PlayerMenu) -> void:
)
func _validate_tackle_to_items_transition(player_menu: PlayerMenu) -> void:
var empty_state := player_menu.get_node("%BagEmptyState") as Label
player_menu.set("_bag_view", PlayerMenu.BagView.EQUIPMENT)
player_menu.call("_refresh_bag")
assert(empty_state.text == "No equipment in your Bag.")
player_menu.call(
"_show_section_immediate", PlayerMenu.Section.TACKLE_BOX
)
player_menu.call("_show_bag_view", PlayerMenu.BagView.CONSUMABLES)
assert(
player_menu.get("_current_section") == PlayerMenu.Section.BAG
)
assert(
player_menu.get("_bag_view") == PlayerMenu.BagView.CONSUMABLES
)
assert(empty_state.text == "No items in your Bag.")
player_menu.call("_cancel_page_tween")
player_menu.call(
"_show_section_immediate", PlayerMenu.Section.COOLER
)
func _validate_cooler_notepad_typography(player_menu: PlayerMenu) -> void:
var sort_choice := player_menu.get_node("%CoolerSortOption") as Control
var sort_direction := player_menu.get_node(
@ -276,10 +315,10 @@ func _capture_inventory_pages(player_menu: PlayerMenu) -> void:
player_menu.visible = true
var sections: Array[PlayerMenu.Section] = [
PlayerMenu.Section.COOLER,
PlayerMenu.Section.TACKLE_BOX,
PlayerMenu.Section.BAG,
PlayerMenu.Section.TACKLE_BOX,
]
var suffixes: Array[String] = ["cooler", "tackle", "equipment"]
var suffixes: Array[String] = ["cooler", "equipment", "tackle"]
for index: int in sections.size():
player_menu.call("_show_section_immediate", sections[index])
await process_frame

View file

@ -82,6 +82,34 @@ func _validate_page() -> void:
page.get("_category") == LogbookCatalog.Category.FRESH_WATER
)
assert((page.get("_catalog_grid") as GridContainer).columns == 4)
var category_tabs: Array = page.get("_category_tabs") as Array
var category_tab_categories: Array = (
page.get("_category_tab_categories") as Array
)
assert(category_tab_categories == [
LogbookCatalog.Category.FRESH_WATER,
LogbookCatalog.Category.SALT_WATER,
LogbookCatalog.Category.SHELLFISH,
LogbookCatalog.Category.OTHER,
])
assert(category_tabs.size() == category_tab_categories.size())
for tab_node: Variant in category_tabs:
var category_tab := tab_node as Button
assert(category_tab.size == LogbookPage.LOGBOOK_TAB_SIZE)
var text_width: float = UtilityPageStyle.TuffyFont.get_string_size(
category_tab.text,
HORIZONTAL_ALIGNMENT_LEFT,
-1.0,
OrganizerTab.FONT_SIZE,
).x
assert(
text_width + LogbookPage.LOGBOOK_TAB_TEXT_SIDE_INSET * 2.0
<= category_tab.size.x
)
assert(
(category_tabs[0] as Button).get_parent().position.x
== LogbookPage.LOGBOOK_TAB_LEFT_INSET
)
var initial_detail_body := page.get("_detail_body") as VBoxContainer
assert(not initial_detail_body.get_parent() is ScrollContainer)
assert(

View file

@ -43,6 +43,9 @@ func _run() -> void:
var hotbar := game_ui.get_node(
"UIRoot/CanonicalStage/Hotbar"
) as HotbarUI
assert(game_ui.get_node_or_null(
"UIRoot/CanonicalStage/GameplayTransientHUD/EffectStatus"
) == null)
var screen_fade := game_ui.get_node("UIRoot/ScreenFade") as Control
var title_screen := game_ui.get_node("UIRoot/TitleScreen") as TitleScreen
var title_content_stage := title_screen.get_node(
@ -154,9 +157,13 @@ func _run() -> void:
assert(presenter.size.is_equal_approx(Vector2(expected_viewport_size)))
var chat_panel := chat_ui.get_node("ChatPanel") as Control
var clock_panel := chat_ui.get_node("WorldClockPanel") as Control
var status_effect_column := chat_ui.get_node(
"StatusEffectColumn"
) as Control
var weather_icon := chat_ui.get_node("WorldWeatherIcon") as Control
assert(chat_panel != null)
assert(clock_panel != null)
assert(status_effect_column != null)
assert(weather_icon != null)
assert(chat_panel.visible)
assert(is_equal_approx(chat_panel.position.x, 0.0))
@ -168,6 +175,17 @@ func _run() -> void:
ChatUI.CLOCK_EDGE_MARGIN,
ChatUI.CLOCK_EDGE_MARGIN,
)))
assert(is_equal_approx(
status_effect_column.position.x,
clock_panel.position.x
+ (ChatUI.CLOCK_SIZE.x - ChatUI.STATUS_EFFECT_ICON_SIZE.x) * 0.5,
))
assert(is_equal_approx(
status_effect_column.position.y,
clock_panel.position.y
+ ChatUI.CLOCK_SIZE.y
+ ChatUI.STATUS_EFFECT_TOP_GAP,
))
assert(is_equal_approx(
weather_icon.position.y, ChatUI.CLOCK_EDGE_MARGIN
))