MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / AddColoredHUDMessage

Function AddColoredHUDMessage

Descent3/hudmessage.cpp:518–537  ·  view source on GitHub ↗

adds a colored hud message to the list Returns true if message added, or false if message not (because the previous message was the same)

Source from the content-addressed store, hash-verified

516// adds a colored hud message to the list
517// Returns true if message added, or false if message not (because the previous message was the same)
518bool AddColoredHUDMessage(ddgr_color color, const char *format, ...) {
519 std::va_list args;
520 char *message = NULL;
521 char *last_message = NULL;
522 char temp_message[HUD_MESSAGE_LENGTH * 2];
523
524 va_start(args, format);
525 std::vsnprintf(temp_message, HUD_MESSAGE_LENGTH * 2, format, args);
526 va_end(args);
527
528 if (Demo_flags == DF_RECORDING) {
529 DemoWriteHudMessage(color, false, temp_message);
530 }
531
532 if (Dedicated_server) {
533 return AddLineToHUDMessages(temp_message, color);
534 }
535
536 return AddMultipleLinesToHUDMessages(temp_message, color);
537}
538
539// Adds a HUD message (similar to AddColoredHUDMessage), however can be filtered out by
540// a "-playermessages" command line.

Callers 3

msafe_CallFunctionFunction · 0.85
MultiDoMessageFromServerFunction · 0.85
DemoReadHudMessageFunction · 0.85

Calls 3

DemoWriteHudMessageFunction · 0.85
AddLineToHUDMessagesFunction · 0.85

Tested by

no test coverage detected