diff options
| author | nathan <nathansmith@disroot.org> | 2025-12-23 23:56:36 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-12-23 23:56:36 +0000 |
| commit | a5443e22bfce9ac00fdc6e746e17eb4aa68565f2 (patch) | |
| tree | 8e38ce63353df35c0ff7a8f42c8c6f85fe169247 | |
| parent | bdeb4f943fc351daeec22b4ef71d551342dc5a01 (diff) | |
| download | FindThings-a5443e22bfce9ac00fdc6e746e17eb4aa68565f2.tar.gz FindThings-a5443e22bfce9ac00fdc6e746e17eb4aa68565f2.tar.bz2 FindThings-a5443e22bfce9ac00fdc6e746e17eb4aa68565f2.zip | |
More menu shit
| -rw-r--r-- | src/entities/ron.c | 11 | ||||
| -rw-r--r-- | src/entity.c | 1 | ||||
| -rw-r--r-- | src/entity.h | 3 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/entities/ron.c b/src/entities/ron.c index d01f25a..5c0eedb 100644 --- a/src/entities/ron.c +++ b/src/entities/ron.c @@ -16,6 +16,13 @@ void updateRon(Entity* entity, Game* game) DrawModel(game->assets.models[RON_MODEL], entity->position, 1.0, WHITE); } +InteractionCommand handleRonMenu(Entity* entity, Game* game, int index) +{ + setInteractionChat(&game->interactionChat, + TextFormat("You selected test %d", index + 1)); + return INTERACTION_TALK; +} + InteractionCommand interactWithRon(Entity* entity, Game* game, Selection selection) { @@ -40,10 +47,12 @@ InteractionCommand interactWithRon(Entity* entity, Game* game, return INTERACTION_SHOW_MENU; case SELECTION_LEAVE: return INTERACTION_END; + case SELECTION_NEXT_MESSAGE: + return INTERACTION_END; default: if (selection >= SELECTION_MENU_ITEM && selection < SELECTION_LEAVE) { - printf("%d\n", getInteractionMenuIndex(selection)); + return handleRonMenu(entity, game, getInteractionMenuIndex(selection)); } return INTERACTION_DO_NOTHING; diff --git a/src/entity.c b/src/entity.c index bcb7735..e25cc90 100644 --- a/src/entity.c +++ b/src/entity.c @@ -30,7 +30,6 @@ Entity createEntity(EntityId id, Vector3 position) { Entity entity; entity.id = id; - entity.state = ENTITY_DEFAULT_STATE; entity.data = NULL; // Run init callback. diff --git a/src/entity.h b/src/entity.h index 9d6bf9a..2391762 100644 --- a/src/entity.h +++ b/src/entity.h @@ -12,10 +12,8 @@ #define INTERACTION_MENU_MAX 9 #define INTERACTION_LABEL_MAX 32 #define INTERACTION_CHAT_MAX 256 -#define ENTITY_DEFAULT_STATE -1 typedef int8_t EntityId; -typedef int16_t EntityState; typedef enum InteractionCommand InteractionCommand; typedef enum Selection Selection; @@ -65,7 +63,6 @@ struct Entity { EntityId id; Vector3 position; // Shouldnt be changed directly. BoundingBox box; - EntityState state; void* data; }; |
