Expose Print Flags to ZScript

This commit is contained in:
Ricardo Luís Vaz Silva 2022-07-10 18:39:01 -03:00 committed by Christoph Oelckers
parent aae1d1439a
commit 03c8da8a44
2 changed files with 26 additions and 0 deletions

View file

@ -1009,6 +1009,16 @@ DEFINE_ACTION_FUNCTION(_Console, Printf)
return 0; return 0;
} }
DEFINE_ACTION_FUNCTION(_Console, PrintString)
{
PARAM_PROLOGUE;
PARAM_INT(printlevel);
PARAM_STRING(str);
Printf(printlevel,"%s\n", str.GetChars());
return 0;
}
static void StopAllSounds() static void StopAllSounds()
{ {
soundEngine->StopAllChannels(); soundEngine->StopAllChannels();

View file

@ -600,6 +600,22 @@ struct Console native
{ {
native static void HideConsole(); native static void HideConsole();
native static vararg void Printf(string fmt, ...); native static vararg void Printf(string fmt, ...);
enum EPrintLevel {
PRINT_LOW, // pickup messages
PRINT_MEDIUM, // death messages
PRINT_HIGH, // critical messages
PRINT_CHAT, // chat messages
PRINT_TEAMCHAT, // chat messages from a teammate
PRINT_LOG, // only to logfile
PRINT_BOLD = 200, // What Printf_Bold used
PRINT_TYPES = 1023, // Bitmask.
PRINT_NONOTIFY = 1024, // Flag - do not add to notify buffer
PRINT_NOLOG = 2048, // Flag - do not print to log file
PRINT_NOTIFY = 4096, // Flag - add to game-native notify display - messages without this only go to the generic notification buffer.
};
native static void PrintString(int printlevel, string str);
} }
struct CVar native struct CVar native