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

Function aShowColoredHUDMessageObj

scripts/DallasFuncs.cpp:1310–1324  ·  view source on GitHub ↗

$$ACTION Misc Show Colored HUD message of color [i:Red] [i:Green] [i:Blue] saying [s:Message] for player [o:PlayerObject=IT] aShowColoredHUDMessageObj Show Colored HUD message Shows a colored HUD message for a specific player Parameters: Red: Red component of color (0-255) Green: Green component of color (0-255) Blue: Blue component of color (0-255) Message: The message to show Playe

Source from the content-addressed store, hash-verified

1308$$END
1309*/
1310void aShowColoredHUDMessageObj(int red, int green, int blue, const char *format, int objhandle, ...) {
1311 msafe_struct mstruct;
1312 va_list args;
1313
1314 va_start(args, objhandle);
1315 std::vsnprintf(mstruct.message, sizeof(mstruct.message) - 1, format, args);
1316 va_end(args);
1317 mstruct.message[sizeof(mstruct.message) - 1] = 0; // if message too long, vsnprintf() won't terminate
1318
1319 mstruct.state = 1;
1320 mstruct.objhandle = dfGetPlayer(objhandle);
1321 mstruct.color = GR_RGB((uint8_t)red, (uint8_t)green, (uint8_t)blue);
1322
1323 MSafe_CallFunction(MSAFE_MISC_HUD_MESSAGE, &mstruct);
1324}
1325
1326/*
1327$$ACTION

Callers 3

CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85

Calls 2

dfGetPlayerFunction · 0.85
GR_RGBFunction · 0.70

Tested by

no test coverage detected