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