--[[ Functions for "report to textbox" meta: .InfoFor = nil or name .InfoTypeString = The info string displayed (localized) .InfoTypeNum = the info number (same throughout languages) .SelectedFilter = "NONE", "PC", "NPC", "GROUP", "EGROUP" .ClassFilter = "NONE" or Class filter used (capitalized english names) .ClassFilterLocalized = Class filter used localized if known, else .ClassFilter .ShowPercent = true, false .ShowRank = true, false .ShowNumber = true, false .ReportAmount = 1 to 40 #amount of rows to show data: [1] string [2] value [3] nil or color{} [4] group number (normally 1) - Used to group different "things" e.g. used for details where heal and dmg info is displayed [5] % val of total Be sure to add new functions to SW_TE_Functions at the bottom of this file. ]]-- SW_TE_NL = "\r\n"; function SW_TE_Normal(meta, data) strOut = meta.InfoTypeString; if meta.InfoFor then strOut = strOut.." "..meta.InfoFor; end strOut = strOut..SW_TE_NL; if meta.SelectedFilter ~= "NONE" then strOut = strOut..meta.SelectedFilter..SW_TE_NL; end if meta.ClassFilter ~= "NONE" then strOut = strOut..meta.ClassFilterLocalized..SW_TE_NL; end strOut = strOut..SW_TE_NL; for i, v in ipairs(data) do if i > meta.ReportAmount then break; end if meta.ShowRank then strOut = strOut..i.." "..v[1]; else strOut = strOut..v[1]; end if meta.ShowNumber then strOut = strOut.." "..v[2]; end if meta.ShowPercent then strOut = strOut.." ("..v[5].."%)"; end strOut = strOut..SW_TE_NL; end return strOut; end function SW_TE_HTML(meta, data) if meta.InfoFor then strOut = "

"..meta.InfoTypeString.." "..meta.InfoFor.."

"; else strOut = "

"..meta.InfoTypeString.."

"; end strOut = strOut.."
"..SW_TE_NL; if meta.SelectedFilter ~= "NONE" then strOut = strOut..meta.SelectedFilter.."
"..SW_TE_NL; end if meta.ClassFilter ~= "NONE" then strOut = strOut..meta.ClassFilterLocalized.."
"..SW_TE_NL; end strOut = strOut..SW_TE_NL..""..SW_TE_NL; for i, v in ipairs(data) do if i > meta.ReportAmount then break; end strOut = strOut..""; if meta.ShowRank then strOut = strOut..""; else strOut = strOut..""; end if meta.ShowNumber then strOut = strOut..""; end if meta.ShowPercent then strOut = strOut..""; end strOut = strOut..""..SW_TE_NL; end return strOut.."
"..i..""..v[1]..""..v[1]..""..v[2].."("..v[5].."%)
"; end SW_TE_Functions = { [1] = {SW_TE_Normal, "Normal"}, [2] = {SW_TE_HTML, "HTML"}, };