diff options
| author | nathan <nathansmith@disroot.org> | 2026-01-07 03:57:09 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2026-01-07 03:57:09 +0000 |
| commit | fd070849940355741b69fe5fbdf75a01dcc8f424 (patch) | |
| tree | 068b2d87e5db33fe9978a8a1fd5c3fef8697bd55 /src/player.c | |
| parent | 382cb08822808f57902f67a842259e64afb33e72 (diff) | |
| download | FindThings-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.c | 19 |
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) { |
