diff options
author | majestic <majesticcoding@gmail.com> | 2020-08-30 22:47:12 +0200 |
---|---|---|
committer | majestic <majesticcoding@gmail.com> | 2020-09-01 18:42:17 +0200 |
commit | 9f43b1988ba44a3704d4e9dbed21d48014694c95 (patch) | |
tree | b558deb3827025a77677144132881dd1f55228d7 /src/render/Hud.cpp | |
parent | Merge pull request #697 from erorcun/miami (diff) | |
download | re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar.gz re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar.bz2 re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar.lz re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar.xz re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar.zst re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.zip |
Diffstat (limited to 'src/render/Hud.cpp')
-rw-r--r-- | src/render/Hud.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp index cbf3c7f2..c05a3d31 100644 --- a/src/render/Hud.cpp +++ b/src/render/Hud.cpp @@ -21,6 +21,8 @@ #include "User.h" #include "World.h" #include "CutsceneMgr.h" +#include "Stats.h" +#include "main.h" // Game has colors inlined in code. // For easier modification we collect them here: @@ -91,6 +93,8 @@ float CHud::PagerXOffset; int16 CHud::PagerTimer; int16 CHud::PagerOn; +wchar *prevChaseString; + uint32 CHud::m_WantedFadeTimer; uint32 CHud::m_WantedState; uint32 CHud::m_WantedTimer; @@ -524,6 +528,53 @@ void CHud::Draw() } } + static int32 nMediaLevelCounter = 0; + if (CStats::ShowChaseStatOnScreen != 0) { + float fCurAttentionLevel = CWorld::Players[CWorld::PlayerInFocus].m_fMediaAttention; + if (0.7f * CStats::HighestChaseValue > fCurAttentionLevel + || fCurAttentionLevel <= 40.0f || CTheScripts::IsPlayerOnAMission()) { + nMediaLevelCounter = 0; + } + else { + if (fCurAttentionLevel == CStats::HighestChaseValue) { + sprintf(gString, "%s %d", UnicodeToAscii(TheText.Get("CHSE")), (int32)fCurAttentionLevel); + } + else { + sprintf(gString, "%s %d" "-%d-", UnicodeToAscii(TheText.Get("CHSE")), (int32)fCurAttentionLevel, (int32)CStats::HighestChaseValue); + } + AsciiToUnicode(gString, gUString); + CFont::SetBackgroundOff(); + CFont::SetScale(SCREEN_SCALE_X(HUD_TEXT_SCALE_X), SCREEN_SCALE_Y(HUD_TEXT_SCALE_Y)); + CFont::SetCentreOff(); + CFont::SetRightJustifyOn(); + CFont::SetRightJustifyWrap(0.0f); + CFont::SetBackGroundOnlyTextOff(); + CFont::SetFontStyle(FONT_HEADING); + CFont::SetPropOff(); + CFont::SetDropShadowPosition(2); + CFont::SetDropColor(CRGBA(0, 0, 0, 255)); + + CRGBA colour; + if (CTimer::GetTimeInMilliseconds() & 0x200) + colour = CRGBA(204, 0, 185, 180); + else + colour = CRGBA(178, 0, 162, 180); + CFont::SetColor(colour); + CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f), SCREEN_SCALE_Y(113.0f), gUString); + + if (CStats::FindChaseString(fCurAttentionLevel) != prevChaseString) { + prevChaseString = CStats::FindChaseString(fCurAttentionLevel); + nMediaLevelCounter = 100; + } + + if (nMediaLevelCounter != 0) { + nMediaLevelCounter--; + UnicodeMakeUpperCase(gUString, CStats::FindChaseString(fCurAttentionLevel)); + CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(110.0f), SCREEN_SCALE_Y(138.0f), gUString); + } + } + } + /* DrawZoneName */ |