From 6e0fabd2798d7e602e243a35a922703cde7ef750 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 7 Jan 2026 19:48:07 -0700 Subject: I feel like a java programmer --- src/ui.c | 24 ++++++++++++++++++++++++ src/ui.h | 22 ++++++++++++++++++++++ 2 files changed, 46 insertions(+) (limited to 'src') diff --git a/src/ui.c b/src/ui.c index 4035b44..66560bb 100644 --- a/src/ui.c +++ b/src/ui.c @@ -227,3 +227,27 @@ void updateInteractionMenu(InteractionMenu* menu, Game* game) position.y += fontSize; } } + +void initInventory(Inventory* inventory) +{ + inventory->visable = false; + inventory->itemCount = 0; +} + +void showInventory(Inventory* inventory) +{ + inventory->visable = true; +} + +void hideInventory(Inventory* inventory) +{ + inventory->visable = false; +} + +void addItemToInventory(Inventory* inventory, InventoryItem item) +{ +} + +void updateInventory(Inventory* inventory) +{ +} diff --git a/src/ui.h b/src/ui.h index 9d3f999..b5089a3 100644 --- a/src/ui.h +++ b/src/ui.h @@ -1,11 +1,13 @@ #include "utils.h" #include "entity.h" +#include "assets.h" #include "world.h" #ifndef UI_H #define UI_H #define INTERACTION_COLUMN_MAX 80 +#define INVENTORY_MAX 10 typedef char InteractionItems[INTERACTION_MENU_MAX][INTERACTION_LABEL_MAX]; @@ -28,6 +30,19 @@ typedef struct { EntityId entityId; } InteractionMenu; +typedef struct { + EntityId id; + AssetId texture; + int count; +} InventoryItem; + +typedef struct { + Rectangle rect; + bool visable; + InventoryItem items[INVENTORY_MAX]; + int itemCount; +} Inventory; + // Interaction chat procedures. void initInteractionChat(InteractionChat* chat, const Settings* settings); void showInteractionChat(InteractionChat* chat); @@ -49,4 +64,11 @@ void showInteractionMenu(InteractionMenu* menu); void hideInteractionMenu(InteractionMenu* menu); void updateInteractionMenu(InteractionMenu* menu, Game* game); +// Inventory +void initInventory(Inventory* inventory); +void showInventory(Inventory* inventory); +void hideInventory(Inventory* inventory); +void addItemToInventory(Inventory* inventory, InventoryItem item); +void updateInventory(Inventory* inventory); + #endif -- cgit v1.2.3