fix: preserve refused loot details in HUD

This commit is contained in:
goose
2026-10-09 10:49:32 -04:00
parent 0d8ba84cf2
commit 8816c31301
7 changed files with 48 additions and 4 deletions
+1
View File
@@ -120,6 +120,7 @@ func test_major_domain_event_kinds_each_map_to_one_named_presentation_event() ->
&"door_opened": &"door",
&"chest_opened": &"chest",
&"loot_taken": &"loot",
&"pickup_refused": &"loot",
&"trap_triggered": &"trap",
&"spell_cast_started": &"spell",
&"quest_started": &"quest",
@@ -118,6 +118,15 @@ func test_hud_localizes_generated_enemy_ids_from_live_state_and_catalog_after_re
assert_eq(removed_text.find("enemy_scavenger_07"), -1)
assert_eq(removed_text.find("_"), -1)
func test_hud_omits_items_with_invalid_quantities() -> void:
var game := GameScene.instantiate() as Game
add_child_autofree(game)
await get_tree().process_frame
var hud := game.get_node("HUD") as GameHud
assert_eq(hud._localized_item_quantity({"item_id": &"weapon_hunting_knife", "quantity": 0}), "")
assert_eq(hud._localized_item_quantity({"item_id": &"weapon_hunting_knife", "quantity": -2}), "")
func test_hud_localizes_active_ranged_and_spell_events_without_english_domain_messages() -> void:
var game := GameScene.instantiate() as Game
add_child_autofree(game)