Merge pull request #2 from MarkSuckerberg/inventory-adjustment

Inventory Display Tweak
This commit is contained in:
Shweet
2025-12-30 16:47:51 -08:00
committed by GitHub
5 changed files with 132 additions and 58 deletions

View File

@@ -123,9 +123,16 @@ 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);
ImGui::DragInt(Item::NAMES[i], &inventory.values[(Item::Type)i], 0.1f, 0, 999);
//TODO: Probably a cleaner way to do this, maybe
int value = inventory.get_item((Item::Type)i);
if (ImGui::DragInt(Item::NAMES[i], &value, 0.1f, 0, 999))
{
inventory.set_item((Item::Type)i, value);
}
ImGui::PopID();
}
ImGui::PopItemWidth();