From 5c519288c928f4136b973613733e70b829dda480 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 12 May 2013 23:41:19 +0200 Subject: show faded out missing exits --- src/koopatlas/hud.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/koopatlas') 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? -- cgit v1.2.3