Fix color escapes of dialogue text on console.

This commit is contained in:
Mari the Deer 2023-06-21 11:38:26 +02:00
commit 90a593a6d5
4 changed files with 15 additions and 4 deletions

View file

@ -150,7 +150,12 @@ extend Class SWWMHandler
{
let l = SWWMOneLiner.Make(oneliner,onelinerspan);
StatusBar.AttachMessage(l,-3473);
if ( swwm_voicelog ) Console.PrintfEx(PRINT_CHAT|PRINT_NONOTIFY,"\cd"..(multiplayer?players[consoleplayer].GetUserName():"Demo").."\c*: "..StringTable.Localize(oneliner).."\c*");
if ( swwm_voicelog )
{
String txt = StringTable.Localize(oneliner);
txt.Replace("\c-","\c*"); // fix color reset escapes
Console.PrintfEx(PRINT_CHAT|PRINT_NONOTIFY,"\cd"..(multiplayer?players[consoleplayer].GetUserName():"Demo").."\c*: "..txt.."\c*");
}
}
SendNetworkEvent("swwmremotelinertxt."..oneliner,consoleplayer,onelinerlevel);
}

View file

@ -461,7 +461,11 @@ extend Class SWWMHandler
if ( swwm_mutevoice >= e.Args[1] ) return;
double dist = players[consoleplayer].Camera.Distance3D(players[e.Args[0]].mo);
if ( dist < 2000 )
Console.PrintfEx(PRINT_CHAT,"\cx%s\cx: %s\c-",players[e.Args[0]].GetUserName(),StringTable.Localize(e.Name.Mid(19)));
{
String txt = StringTable.Localize(e.Name.Mid(19));
txt.Replace("\c-","\c*"); // fix color reset escapes
Console.PrintfEx(PRINT_CHAT,"\cx%s\cx: %s\c-",players[e.Args[0]].GetUserName(),txt);
}
}
else if ( e.Name ~== "swwmcleartransaction" )
{