mudgangster

Log | Files | Refs

commit 87680a987b30cf041fb6aa24a398bea29de77d21
parent 87af2a24bea9ec5983cf3dbf926d94f3dc91b5c4
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun,  4 May 2014 20:13:08 +0100

Parse gagged lines for colour codes

Diffstat:
handlers.lua | 26++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/handlers.lua b/handlers.lua @@ -174,29 +174,27 @@ local function handleData( data ) action.doPreActions( noAnsi ) action.doAnsiPreActions( clean ) - if not gagged then - local subbed = sub.doSubs( clean ) + local subbed = sub.doSubs( clean ) - for text, opts, escape in ( subbed .. "\27[m" ):gmatch( "(.-)\27%[([%d;]*)(%a)" ) do - if text ~= "" then - mud.printMain( text, fg, bg, bold ) - end - - for opt in opts:gmatch( "([^;]+)" ) do - if Escapes[ escape ][ opt ] then - Escapes[ escape ][ opt ]() - end - end + for text, opts, escape in ( subbed .. "\27[m" ):gmatch( "(.-)\27%[([%d;]*)(%a)" ) do + if text ~= "" and not gagged then + mud.printMain( text, fg, bg, bold ) end - if not hasGA then - mud.newlineMain() + for opt in opts:gmatch( "([^;]+)" ) do + if Escapes[ escape ][ opt ] then + Escapes[ escape ][ opt ]() + end end end if hasGA then lastWasGA = true printPendingInputs() + else + if not gagged then + mud.newlineMain() + end end action.doActions( noAnsi )