diff --git a/Tomb1Main.json b/Tomb1Main.json index 95c21536d..4c77a7904 100644 --- a/Tomb1Main.json +++ b/Tomb1Main.json @@ -54,11 +54,14 @@ // Changes how the healthbar is displayed. Possible values: // - always: always show the healthbar - // - flashing: show the healthbar only when Lara's health is 20% or below // - default: show the healthbar at the beginning of a level, after // getting hit or while having weapons equipped (as in OG) + // - flashing-or-default: show the healthbar when Lara's health is 20% or + // below, or under default circumstances + // - flashing-only: show the healthbar *only* when Lara's health is 20% or + // below (useful for challenge runs) // - never: never display the healthbar (for challenge runs) - "healthbar_showing_mode": "flashing", + "healthbar_showing_mode": "flashing-or-default", // Location where the healthbar is displayed. Possible values: // - top-left @@ -83,9 +86,15 @@ // Changes how the airbar is displayed. Possible values: // - always: always show the airbar - // - flashing: show the airbar only when Lara's oxygen is 20% or below // - default: show the airbar only in the water + // - flashing-or-default: show the airbar when Lara's oxygen is 20% or + / below or under normal circumstances + // - flashing-only: show the airbar *only* when Lara's oxygen is 20% or / + // below (useful for challenge runs) // - never: never display the airbar (for challenge runs) + // In case of airbar, the flashing-or-default mode is there mostly for + // consistency and the only practical difference is that it's shown when + // Lara dies. When using the fly cheat, the airbar is never shown. "airbar_showing_mode": "default", // Location where the airbar is displayed. diff --git a/src/config.c b/src/config.c index 21a130592..eae8a4b11 100644 --- a/src/config.c +++ b/src/config.c @@ -15,8 +15,10 @@ static int8_t ReadBarShowingMode(struct json_value_s* root, const char* name) const char* value_str = JSONGetStringValue(root, name); if (!value_str) { return T1M_BSM_DEFAULT; - } else if (!strcmp(value_str, "flashing")) { - return T1M_BSM_FLASHING; + } else if (!strcmp(value_str, "flashing-or-default")) { + return T1M_BSM_FLASHING_OR_DEFAULT; + } else if (!strcmp(value_str, "flashing-only")) { + return T1M_BSM_FLASHING_ONLY; } else if (!strcmp(value_str, "always")) { return T1M_BSM_ALWAYS; } else if (!strcmp(value_str, "never")) { diff --git a/src/config.h b/src/config.h index 83b446321..7b4e96aad 100644 --- a/src/config.h +++ b/src/config.h @@ -26,9 +26,10 @@ typedef enum { typedef enum { T1M_BSM_DEFAULT = 0, - T1M_BSM_FLASHING = 1, - T1M_BSM_ALWAYS = 2, - T1M_BSM_NEVER = 3, + T1M_BSM_FLASHING_OR_DEFAULT = 1, + T1M_BSM_FLASHING_ONLY = 2, + T1M_BSM_ALWAYS = 3, + T1M_BSM_NEVER = 4, } T1M_BAR_SHOW_MODE; struct { diff --git a/src/game/health.c b/src/game/health.c index 743040a03..fe8e9cc81 100644 --- a/src/game/health.c +++ b/src/game/health.c @@ -58,11 +58,12 @@ void DrawHealthBar() break; case T1M_BSM_NEVER: show = 0; - return; - case T1M_BSM_FLASHING: - if (hit_points <= (LARA_HITPOINTS * 20) / 100) { - show = 1; - } + break; + case T1M_BSM_FLASHING_OR_DEFAULT: + show |= hit_points <= (LARA_HITPOINTS * 20) / 100; + break; + case T1M_BSM_FLASHING_ONLY: + show = hit_points <= (LARA_HITPOINTS * 20) / 100; break; } if (!show) { @@ -88,11 +89,12 @@ void DrawAirBar() break; case T1M_BSM_NEVER: show = 0; - return; - case T1M_BSM_FLASHING: - if (Lara.air > (LARA_AIR * 20) / 100) { - show = 0; - } + break; + case T1M_BSM_FLASHING_OR_DEFAULT: + show |= Lara.air <= (LARA_AIR * 20) / 100; + break; + case T1M_BSM_FLASHING_ONLY: + show = Lara.air <= (LARA_AIR * 20) / 100; break; } if (!show) {