moonlightUI = moonlightUI or {} mUI = moonlightUI mUI.comms = mUI.comms or {} mUI.comms.sendchat = function (chatwindow, text, fcolor, bcolor) text = text .. "\n" local textcolor = "" if fcolor and bcolor then textcolor = "<" .. fcolor .. ":" .. bcolor .. ">" elseif fcolor then textcolor = "<" .. fcolor .. ">" end -- if text = textcolor .. text chatwindow = "ChatBox" .. chatwindow if chatwindow ~= "ChatBoxAll" then mUI[chatwindow]:cecho ("\n") mUI["ChatBoxAll"]:cecho (text) end -- if mUI[chatwindow]:cecho (text) end -- function mUI.comms.parsechat = function () local channel = mData.comms.channel local chatbox = mUI.comms.channels[channel] if chatbox then local text = mData.comms.text local fcolor = false local bcolor = false if mUI.comms.colors[channel] then fcolor = mUI.comms.colors[channel][1] bcolor = mUI.comms.colors[channel][2] end -- if mUI.comms.sendchat (chatbox, text, fcolor, bcolor) end -- if end -- func do local reg = registerAnonymousEventHandler reg ("mData.comms", "mUI.comms.parsechat") end -- do