diff --git a/src/common/scripting/interface/vmnatives.cpp b/src/common/scripting/interface/vmnatives.cpp index 8a5674afd..2b57ceb25 100644 --- a/src/common/scripting/interface/vmnatives.cpp +++ b/src/common/scripting/interface/vmnatives.cpp @@ -1162,6 +1162,17 @@ DEFINE_ACTION_FUNCTION(_Console, PrintfEx) return 0; } +DEFINE_ACTION_FUNCTION(_Console, DebugPrintf) +{ + PARAM_PROLOGUE; + PARAM_INT(debugLevel); + PARAM_VA_POINTER(va_reginfo); + + FString s = FStringFormat(VM_ARGS_NAMES, 1); + DPrintf(debugLevel, "%s\n", s.GetChars()); + return 0; +} + static void StopAllSounds() { soundEngine->StopAllChannels(); diff --git a/wadsrc/static/zscript/engine/base.zs b/wadsrc/static/zscript/engine/base.zs index f55919116..c4322918f 100644 --- a/wadsrc/static/zscript/engine/base.zs +++ b/wadsrc/static/zscript/engine/base.zs @@ -143,6 +143,15 @@ enum EPrintLevel PRINT_NOLOG = 2048, // Flag - do not print to log file }; +enum EDebugLevel +{ + DMSG_OFF, // no developer messages. + DMSG_ERROR, // general notification messages + DMSG_WARNING, // warnings + DMSG_NOTIFY, // general notification messages + DMSG_SPAMMY, // for those who want to see everything, regardless of its usefulness. +}; + enum EConsoleState { c_up = 0, @@ -665,6 +674,7 @@ struct Console native native static void HideConsole(); native static vararg void Printf(string fmt, ...); native static vararg void PrintfEx(int printlevel, string fmt, ...); + native static vararg void DebugPrintf(int debuglevel, string fmt, ...); } struct CVar native