void AddChat(string text) { text = text.TrimEnd().Replace('%', '&'); if (!IDrawer2D.IsWhiteCol(lastCol)) { text = "&" + lastCol + text; } char col = IDrawer2D.LastCol(text, text.Length); if (col != '\0') { lastCol = col; } game.Chat.Add(text, MessageType.Normal); }
protected char GetLastColour(int indexX, int indexY) { int x = indexX; for (int y = indexY; y >= 0; y--) { string part = lines[y]; char code = IDrawer2D.LastCol(part, x); if (code != '\0') { return(code); } if (y > 0) { x = lines[y - 1].Length; } } return('\0'); }