diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui.c | 24 | ||||
| -rw-r--r-- | src/ui.h | 22 |
2 files changed, 46 insertions, 0 deletions
@@ -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) +{ +} @@ -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 |
