adds a persistent hud message that is timed, or infinite until removed for infinite, time = -1.0f for centering on an axis, set either x or y to -1.
| 1386 | // for infinite, time = -1.0f |
| 1387 | // for centering on an axis, set either x or y to -1. |
| 1388 | void AddPersistentHUDMessage(ddgr_color color, int x, int y, float time, int flags, int sound_index, const char *fmt, |
| 1389 | ...) { |
| 1390 | std::va_list args; |
| 1391 | char temp_message[HUD_MESSAGE_LENGTH * 2]; |
| 1392 | |
| 1393 | // start new message |
| 1394 | va_start(args, fmt); |
| 1395 | std::vsnprintf(temp_message, HUD_MESSAGE_LENGTH * 2, fmt, args); |
| 1396 | va_end(args); |
| 1397 | |
| 1398 | if (Hud_persistent_msg_id != HUD_INVALID_ID) // already one active, so queue the new one |
| 1399 | QueuePersistentHUDMessage(color, x, y, time, flags, sound_index, temp_message); |
| 1400 | else |
| 1401 | StartPersistentHUDMessage(color, x, y, time, flags, sound_index, temp_message); |
| 1402 | } |
| 1403 | |
| 1404 | // Clears the current message, and plays the next in the queue |
| 1405 | void ClearPersistentHUDMessage() { |
no test coverage detected