hankinsoft / MudClient

MudClient
3 stars 0 forks source link

[Feature] Color Triggers #4

Open dak opened 1 year ago

dak commented 1 year ago

Allow lines from the MUD to be re-stylized with a different color text (or even modify the text).

hankinsoft commented 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?

dak commented 1 year ago

Yeah, that would be perfect. I was just aiming for colorization, but exposing a full replaceText along with colorization would be fantastic.