From 8394a306ed1d8dfdc9ca72e4c2c7888a4b79c576 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 18 Dec 2025 04:23:16 -0700 Subject: A lot of code for a lot of nothing --- src/game.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/game.c') diff --git a/src/game.c b/src/game.c index d8823d2..b2f2d32 100644 --- a/src/game.c +++ b/src/game.c @@ -152,6 +152,38 @@ void drawCrosshair(float crossHairSize, float crossHairThickness, Color color) crossHairThickness, color); } +void updateGameEntityInfo(Game* game) +{ + // Get size. + float screenWidth = GetRenderWidth(); + float screenHeight = GetRenderWidth(); + float x = game->map.rect.x + (game->map.rect.width * 0.25); + float y = game->map.rect.y + game->map.rect.height; + + int lines = 1; + int fontSize = game->settings.entityInfoFontSize; + + if (!game->map.isEnabled) + { + y = 0.0; + } + + WorldUID selected = game->player.selectedEntity; + + if (selected == ENTITY_NONE) + { + return; + } + + Color backgroundColor = PINK; + backgroundColor.a = game->settings.entityInfoAlpha; + DrawRectangle(x, y, screenWidth - x, lines * fontSize, backgroundColor); + + // Draw name. + Entity* selectedEntity = &game->world.entities[selected]; + DrawText(getEntityName(selectedEntity->id), x, y, fontSize, BLACK); +} + void updateGameScene(Game* game) { // Handle toggle cursor. @@ -189,6 +221,7 @@ void updateGameScene(Game* game) drawGameScreen(game); updateMap(&game->map, game); + updateGameEntityInfo(game); updateInteractionChat(&game->chat, game); // Cross hair. -- cgit v1.2.3