aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2026-01-08 02:48:07 +0000
committernathan <nathansmith@disroot.org>2026-01-08 02:48:07 +0000
commit6e0fabd2798d7e602e243a35a922703cde7ef750 (patch)
treea2b73295756c0ac8afe984b2bc1d92a18c465a71
parent75338c84cca4f0dad1fb1d79f0db42922a3ea6b5 (diff)
downloadFindThings-6e0fabd2798d7e602e243a35a922703cde7ef750.tar.gz
FindThings-6e0fabd2798d7e602e243a35a922703cde7ef750.tar.bz2
FindThings-6e0fabd2798d7e602e243a35a922703cde7ef750.zip
I feel like a java programmer
-rw-r--r--src/ui.c24
-rw-r--r--src/ui.h22
2 files changed, 46 insertions, 0 deletions
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