Open dak opened 1 year ago
So you want a function that lets you add/modify received text (with the ability to colorize it)?
Current with matches, I use parameters such as \0, \1 to get the match string, but I'm thinking I can add match objects with some basic psudocode like:
class match { str matchedString; int location; int length; }
var matches = []; // Populated via mud client
Then in javascript you could do something like:
replaceText(match[0].location, match[1].length, "Some new text");
And also allow the "Some new text" to contain 'color macros'.
Would something like that be what you are looking for?
Yeah, that would be perfect. I was just aiming for colorization, but exposing a full replaceText along with colorization would be fantastic.
Allow lines from the MUD to be re-stylized with a different color text (or even modify the text).