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

Function AddPersistentHUDMessage

Descent3/hudmessage.cpp:1388–1402  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

1386// for infinite, time = -1.0f
1387// for centering on an axis, set either x or y to -1.
1388void 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
1405void ClearPersistentHUDMessage() {

Callers 6

msafe_CallFunctionFunction · 0.85
MultiDoWorldStatesFunction · 0.85
DoSecretForPlayerFunction · 0.85
DoNewPlayerDeathFrameFunction · 0.85
GoalCompleteMethod · 0.85

Calls 2

Tested by

no test coverage detected