From dacb561e62e959a9d54f41d82a1b6ac5d44b54c0 Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 14 Feb 2018 07:13:28 +0000 Subject: [PATCH] Hide inventory if selected. Clamp objective values to max. --- src/world/hud.c | 7 +++++-- src/world/hud.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/world/hud.c b/src/world/hud.c index da60c5d..e0927b9 100644 --- a/src/world/hud.c +++ b/src/world/hud.c @@ -69,7 +69,10 @@ void drawHud(void) drawText(5, 80, 16, TA_LEFT, colors.white, "Weapon: %s", getWeaponName(world.bob->weaponType)); - drawInventory(); + if (app.config.hudInventory) + { + drawInventory(); + } if (messageTime > 0) { @@ -235,7 +238,7 @@ void drawMissionStatus(void) } drawText(x + 20, y, 24, TA_LEFT, c, o->description); - drawText(SCREEN_WIDTH / 2 + 100, y, 24, TA_LEFT, c, "%d / %d", o->currentValue, o->targetValue); + drawText(SCREEN_WIDTH / 2 + 100, y, 24, TA_LEFT, c, "%d / %d", MIN(o->currentValue, o->targetValue), o->targetValue); drawText(x + w - 20, y, 24, TA_RIGHT, c, status); y += 55; diff --git a/src/world/hud.h b/src/world/hud.h index c35f43c..f50fc2c 100644 --- a/src/world/hud.h +++ b/src/world/hud.h @@ -31,6 +31,7 @@ extern Texture *getTexture(const char *filename); extern SDL_Rect getCurrentFrame(Sprite *s); extern int getPercent(float current, float total); +extern App app; extern Dev dev; extern Camera camera; extern Colors colors;