From 0f4ba92de5e83c8a4910f9c956b6c62beefb2048 Mon Sep 17 00:00:00 2001 From: Mark Suckerberg Date: Tue, 30 Dec 2025 17:53:57 -0600 Subject: [PATCH] Adjusts to also hide impossible item silhouettes --- src/window/inventory.cpp | 7 ++++--- src/window/main_menu.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/window/inventory.cpp b/src/window/inventory.cpp index 05b0f37..f0ddfbe 100644 --- a/src/window/inventory.cpp +++ b/src/window/inventory.cpp @@ -45,9 +45,11 @@ namespace game::window for (int index = 0; index < Item::ITEM_COUNT; index++) { - if (index == Item::INVALID) continue; - auto type = (Item::Type)index; + auto seen = values.contains(type); + + //Hide invalid items and impossible-to-obtain items when not seen. + if (!seen && (Item::CATEGORIES[type] == Item::INVALID || Item::RARITIES[type] == Item::IMPOSSIBLE)) continue; auto columns = (int)(texture.size.x / ITEM_SIZE.x); auto crop = vec2(type % columns, type / columns) * ITEM_SIZE; @@ -59,7 +61,6 @@ namespace game::window auto cursorScreenPos = ImGui::GetCursorScreenPos(); auto quantity = 0; - auto seen = values.contains(type); if (seen) { diff --git a/src/window/main_menu.cpp b/src/window/main_menu.cpp index 0ef4d5b..b19119c 100644 --- a/src/window/main_menu.cpp +++ b/src/window/main_menu.cpp @@ -115,7 +115,7 @@ namespace game::window ImGui::PushItemWidth(100); for (int i = 0; i < Item::ITEM_COUNT; i++) { - if (i == Item::INVALID) continue; + if (Item::CATEGORIES[i] == Item::INVALID) continue; ImGui::PushID(i); //TODO: Probably a cleaner way to do this, maybe