aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2026-01-07 03:57:09 +0000
committernathan <nathansmith@disroot.org>2026-01-07 03:57:09 +0000
commitfd070849940355741b69fe5fbdf75a01dcc8f424 (patch)
tree068b2d87e5db33fe9978a8a1fd5c3fef8697bd55 /src/player.c
parent382cb08822808f57902f67a842259e64afb33e72 (diff)
downloadFindThings-fd070849940355741b69fe5fbdf75a01dcc8f424.tar.gz
FindThings-fd070849940355741b69fe5fbdf75a01dcc8f424.tar.bz2
FindThings-fd070849940355741b69fe5fbdf75a01dcc8f424.zip
Cool text animation thingy
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/player.c b/src/player.c
index c3e9119..df59ffe 100644
--- a/src/player.c
+++ b/src/player.c
@@ -1,6 +1,7 @@
#include "player.h"
#include "game.h"
#include "settings.h"
+#include "ui.h"
Player createPlayer()
{
@@ -408,13 +409,27 @@ void playerUpdateSelectedEntity(Player* player, WorldUID uid, Game* game)
{
playerInteractWithEntity(player, uid, game, SELECTION_INTERACT);
}
- else if (IsKeyPressed(game->settings.leaveKey))
+
+ // Actions that should only be done while interacting.
+ if (!player->isInteracting)
+ {
+ return;
+ }
+
+ if (IsKeyPressed(game->settings.leaveKey))
{
playerInteractWithEntity(player, uid, game, SELECTION_LEAVE);
}
else if (IsKeyPressed(game->settings.nextMessageKey))
{
- playerInteractWithEntity(player, uid, game, SELECTION_NEXT_MESSAGE);
+ if (isInteractionChatAnimationDone(chat))
+ {
+ playerInteractWithEntity(player, uid, game, SELECTION_NEXT_MESSAGE);
+ }
+ else
+ {
+ endInteractionChatAnimation(chat);
+ }
}
else if (keyPressed >= KEY_ONE && keyPressed <= KEY_NINE)
{