- Blood: do color highlighting for trigger messages, like NBlood does.

This commit is contained in:
Christoph Oelckers 2022-01-22 09:38:01 +01:00
parent 7b560a3d79
commit c11000e4cd
5 changed files with 6 additions and 6 deletions

View file

@ -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());

View file

@ -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);
}
}

View file

@ -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);
}
//---------------------------------------------------------------------------

View file

@ -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)

View file

@ -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);