- try to preserve a bit more information about incorrect use of user variables to print more meaningful error messages. This is not complete yet and will need integration with the previous commit.

This commit is contained in:
Christoph Oelckers 2016-11-13 12:02:41 +01:00
commit f238f0ba5c
11 changed files with 94 additions and 5 deletions

View file

@ -1046,7 +1046,10 @@ void FScriptPosition::Message (int severity, const char *message, ...) const
{
FString composed;
if ((severity == MSG_DEBUG || severity == MSG_DEBUGLOG) && developer < DMSG_NOTIFY) return;
if (severity == MSG_DEBUGLOG && developer < DMSG_NOTIFY) return;
if (severity == MSG_DEBUGERROR && developer < DMSG_ERROR) return;
if (severity == MSG_DEBUGWARN && developer < DMSG_WARNING) return;
if (severity == MSG_DEBUGMSG && developer < DMSG_NOTIFY) return;
if (severity == MSG_OPTERROR)
{
severity = StrictErrors || strictdecorate ? MSG_ERROR : MSG_WARNING;
@ -1073,9 +1076,11 @@ void FScriptPosition::Message (int severity, const char *message, ...) const
return;
case MSG_WARNING:
case MSG_DEBUGWARN:
case MSG_DEBUGERROR: // This is intentionally not being printed as an 'error', the difference to MSG_DEBUGWARN is only the severity level at which it gets triggered.
WarnCounter++;
type = "warning";
color = TEXTCOLOR_YELLOW;
color = TEXTCOLOR_ORANGE;
break;
case MSG_ERROR:
@ -1085,7 +1090,7 @@ void FScriptPosition::Message (int severity, const char *message, ...) const
break;
case MSG_MESSAGE:
case MSG_DEBUG:
case MSG_DEBUGMSG:
type = "message";
color = TEXTCOLOR_GREEN;
break;