You're using Lua... The simplest thing to do is change the Script declaration to add a fourth parameter (name, line, wcards, sruns)
MushClient passes in a table to sruns with all the stylerun information.
function MapMunger (name, line, wcards, sruns)
for a,b in ipairs(sruns) do
local newtext = b.text:gsub("%[[ +]%]", "#"):gsub(" ([%/%\%|x]) ", "%1"):gsub(" "," ")
ColourTell(RGBColourToName(b.textcolour), RGBColourToName(b.backcolour), newtext )
end
print()
end
In a Miniwindow, after you have set up your WindowCreate and WindowFont, you can do something like:
vPos = 0
function MapMover (name, line, wcards, sruns)
local hPos = 0
for a,b in ipairs(sruns) do
local hPos = 0
local newtext = b.text:gsub("%[[ +]%]", "#"):gsub(" ([%/%\%|x]) ", "%1"):gsub(" "," ")
hPos = WindowText("Map", "fontID", newtext, hPos, vPos, 0,0, b.textcolour, false)
end
vPos = vPos + WindowFontInfo("fontID", 1)
end
In your triggers, when you re-initialize grid, you'd call WindowRectOp("Map", 2, 0,0,0,0, 0,0) to blank the miniwindow, and vPos = 0 to reset the map's drawing coordinates. |