Adds a message to the HUD message list. If the list is already full, punt the top one and move the others up Returns true if message added, or false if message not (because the previous message was the same)
| 612 | // top one and move the others up |
| 613 | // Returns true if message added, or false if message not (because the previous message was the same) |
| 614 | bool AddHUDMessage(const char *format, ...) { |
| 615 | std::va_list args; |
| 616 | char *message = NULL; |
| 617 | char *last_message = NULL; |
| 618 | char temp_message[HUD_MESSAGE_LENGTH * 2]; |
| 619 | |
| 620 | va_start(args, format); |
| 621 | std::vsnprintf(temp_message, HUD_MESSAGE_LENGTH * 2, format, args); |
| 622 | va_end(args); |
| 623 | |
| 624 | if (Demo_flags == DF_RECORDING) { |
| 625 | DemoWriteHudMessage(0, false, temp_message); |
| 626 | } |
| 627 | |
| 628 | if (Dedicated_server) { |
| 629 | return AddLineToHUDMessages(temp_message); |
| 630 | } |
| 631 | |
| 632 | return AddMultipleLinesToHUDMessages(temp_message); |
| 633 | } |
| 634 | |
| 635 | // Adds a blinking message to the HUD message list. If the list is already full, punt the |
| 636 | // top one and move the others up |
no test coverage detected