From 2254600c6dfb50333327ddb94457427596b51807 Mon Sep 17 00:00:00 2001 From: nathan Date: Sun, 21 Dec 2025 18:17:44 -0700 Subject: Interaction menu stuff and fps adhd --- src/game.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'src/game.c') diff --git a/src/game.c b/src/game.c index b2f2d32..7dbe9e8 100644 --- a/src/game.c +++ b/src/game.c @@ -52,6 +52,7 @@ void initGame(Game* game) // Settings. game->settings = defaultSettings(); game->isCrossHairEnabled = game->settings.isCrossHairEnabledDefault; + game->showFPS = game->settings.showFPSDefault; // Window. InitWindow(game->settings.windowWidth, game->settings.windowHeight, @@ -85,8 +86,9 @@ void initGame(Game* game) // Map. initMap(&game->map, &game->world, &game->settings); - // Interaction chat. - initInteractionChat(&game->chat, &game->settings); + // Interaction chat and menu. + initInteractionChat(&game->interactionChat, &game->settings); + initInteractionMenu(&game->interactionMenu, &game->settings); disableGameCursor(game); } @@ -220,10 +222,6 @@ void updateGameScene(Game* game) drawGameScreen(game); - updateMap(&game->map, game); - updateGameEntityInfo(game); - updateInteractionChat(&game->chat, game); - // Cross hair. if (IsKeyPressed(game->settings.toggleCrossHairKey)) { @@ -236,6 +234,11 @@ void updateGameScene(Game* game) game->settings.crossHairThickness, game->settings.crossHairColor); } + + updateMap(&game->map, game); + updateGameEntityInfo(game); + updateInteractionChat(&game->interactionChat, game); + updateInteractionMenu(&game->interactionMenu, game); } void handleGameResize(Game* game) @@ -264,7 +267,16 @@ void updateGame(Game* game) break; } - DrawFPS(0, 0); + // FPS stuff. + if (IsKeyPressed(game->settings.toggleFPSKey)) + { + game->showFPS = !game->showFPS; + } + + if (game->showFPS) + { + DrawFPS(0, 0); + } EndDrawing(); } -- cgit v1.2.3