diff options
| author | nathan <nathansmith@disroot.org> | 2026-01-08 02:48:07 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2026-01-08 02:48:07 +0000 |
| commit | 6e0fabd2798d7e602e243a35a922703cde7ef750 (patch) | |
| tree | a2b73295756c0ac8afe984b2bc1d92a18c465a71 | |
| parent | 75338c84cca4f0dad1fb1d79f0db42922a3ea6b5 (diff) | |
| download | FindThings-6e0fabd2798d7e602e243a35a922703cde7ef750.tar.gz FindThings-6e0fabd2798d7e602e243a35a922703cde7ef750.tar.bz2 FindThings-6e0fabd2798d7e602e243a35a922703cde7ef750.zip | |
I feel like a java programmer
| -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 |
