From c11000e4cd0d7590279bd53045805db498ed395a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 22 Jan 2022 09:38:01 +0100 Subject: [PATCH] - Blood: do color highlighting for trigger messages, like NBlood does. --- source/games/blood/src/eventq.cpp | 2 +- source/games/blood/src/player.cpp | 2 +- source/games/blood/src/triggers.cpp | 2 +- source/games/blood/src/view.cpp | 4 ++-- source/games/blood/src/view.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/games/blood/src/eventq.cpp b/source/games/blood/src/eventq.cpp index 8cb9cc2f6..764a09bce 100644 --- a/source/games/blood/src/eventq.cpp +++ b/source/games/blood/src/eventq.cpp @@ -401,7 +401,7 @@ void evSend(EventObject& eob, int rxId, COMMAND_ID command) gSecretMgr.Found(command - kCmdNumberic); if (gGameOptions.nGameType == 0) { - viewSetMessage(GStrings(FStringf("TXTB_SECRET%d", Random(2))), 0, MESSAGE_PRIORITY_SECRET); + viewSetMessage(GStrings(FStringf("TXTB_SECRET%d", Random(2))), nullptr, MESSAGE_PRIORITY_SECRET); } } else viewSetSystemMessage("Invalid Trigger-Secret command by %s", eob.description().GetChars()); diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 4e874c250..1efa0cdca 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1355,7 +1355,7 @@ void PickUp(PLAYER* pPlayer, DBloodActor* actor) pPlayer->pickupEffect = 30; if (pPlayer == gMe) { if (customMsg > 0) trTextOver(customMsg - 1); - else if (msg) viewSetMessage(msg, 0, MESSAGE_PRIORITY_PICKUP); + else if (msg) viewSetMessage(msg, nullptr, MESSAGE_PRIORITY_PICKUP); } } diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index c35ebc6d3..38ac3c5d3 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -2343,7 +2343,7 @@ void trTextOver(int nId) { const char* pzMessage = currentLevel->GetMessage(nId); if (pzMessage) - viewSetMessage(pzMessage, VanillaMode() ? 0 : 8, MESSAGE_PRIORITY_INI); // 8: gold + viewSetMessage(pzMessage, VanillaMode() ? nullptr : TEXTCOLOR_GOLD, MESSAGE_PRIORITY_INI); } //--------------------------------------------------------------------------- diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index f38b6deec..18171187a 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -265,10 +265,10 @@ void viewSetSystemMessage(const char* pMessage, ...) { Printf(PRINT_HIGH | PRINT_NOTIFY, "%s\n", buffer); // print it also in console } -void viewSetMessage(const char* pMessage, const int pal, const MESSAGE_PRIORITY priority) +void viewSetMessage(const char* pMessage, const char* color, const MESSAGE_PRIORITY priority) { int printlevel = priority <= MESSAGE_PRIORITY_NORMAL ? PRINT_LOW : priority < MESSAGE_PRIORITY_SYSTEM ? PRINT_MEDIUM : PRINT_HIGH; - Printf(printlevel | PRINT_NOTIFY, "%s\n", pMessage); + Printf(printlevel | PRINT_NOTIFY, "%s%s\n", color? color : TEXTCOLOR_TAN, pMessage); } void viewSetErrorMessage(const char* pMessage) diff --git a/source/games/blood/src/view.h b/source/games/blood/src/view.h index 80df07a66..9305a05ce 100644 --- a/source/games/blood/src/view.h +++ b/source/games/blood/src/view.h @@ -148,7 +148,7 @@ void InitStatusBar(void); void UpdateStatusBar(); void viewInit(void); void viewprocessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t smooth); -void viewSetMessage(const char* pMessage, const int pal = 0, const MESSAGE_PRIORITY priority = MESSAGE_PRIORITY_NORMAL); +void viewSetMessage(const char* pMessage, const char* color = nullptr, const MESSAGE_PRIORITY priority = MESSAGE_PRIORITY_NORMAL); void viewSetErrorMessage(const char* pMessage);