summaryrefslogtreecommitdiff
path: root/src/koopatlas/hud.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/koopatlas/hud.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp
index ff9a0e2..3802c33 100644
--- a/src/koopatlas/hud.cpp
+++ b/src/koopatlas/hud.cpp
@@ -277,15 +277,31 @@ void dWMHud_c::loadHeaderInfo() {
int l = nodeForHeader->levelNumber[1] - 1;
u32 conds = GetSaveFile()->GetBlock(-1)->GetLevelCondition(w, l);
+ // States: 0 = invisible, 1 = visible, 2 = faded
+ int normalState = 0, secretState = 0;
+
+ if ((conds & COND_BOTH_EXITS) && (infEntry->flags & 0x30) == 0x30) {
+ // If this level has two exits and one of them is already collected,
+ // then show the faded flags
+ normalState = 2;
+ secretState = 2;
+ }
+
+ if ((conds & COND_NORMAL) && (infEntry->flags & 0x10))
+ normalState = 1;
+ if ((conds & COND_SECRET) && (infEntry->flags & 0x20))
+ secretState = 1;
NormalExitFlag->trans.x = currentPos;
- NormalExitFlag->SetVisible(conds & COND_NORMAL);
- if (conds & COND_NORMAL)
+ NormalExitFlag->alpha = (normalState == 2) ? 80 : 255;
+ NormalExitFlag->SetVisible(normalState > 0);
+ if (normalState > 0)
currentPos += NormalExitFlag->size.x;
SecretExitFlag->trans.x = currentPos;
- SecretExitFlag->SetVisible(conds & COND_SECRET);
- if (conds & COND_SECRET)
+ SecretExitFlag->alpha = (secretState == 2) ? 80 : 255;
+ SecretExitFlag->SetVisible(secretState > 0);
+ if (secretState > 0)
currentPos += SecretExitFlag->size.x;
// are star coins enabled or not?