Text Coloring
Moderator: Eowul
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Text Coloring
Ability to change the color of a word rather than the whole line.
Re: Wishlist
Can you give me a "use case" so I can figure out how to best add this?Gub wrote:Ability to change the color of a word rather than the whole line.
Caretaker of Arda
Re: Text Coloring
Sure. If I want to highlight the word "peculiar" or "unusual" rather than highlighting the entire line. I'd like it to look something like this:
You get an unusual black robe
rather than:
You get an unusual black robe.
You get an unusual black robe
rather than:
You get an unusual black robe.
Re: Text Coloring
Awefull choice in colors .. Anyway, you would then be thinking of something like gwc.output.colorText("unusual", foreground, background) ?Gub wrote:Sure. If I want to highlight the word "peculiar" or "unusual" rather than highlighting the entire line. I'd like it to look something like this:
You get an unusual black robe
rather than:
You get an unusual black robe.
Caretaker of Arda
Re: Text Coloring
Hah, I agree, it looks horrible.
Yeah, thats it exactly.
Yeah, thats it exactly.
Re: Text Coloring
Can you expose some more of the internal API so we can write our own libraries that could be included into the system? Rather than requesting the method call you just suggested, I feel like users should be able to write them and then have them included (after review) into a standard library. Or can we already do this? Thoughts?
Re: Text Coloring
Internal API's should remain exactly that, internal API's, otherwise any change we might do might break users triggers and aliases. That's why I added the script API, as something that remains consistent throughout releases. Ofcourse you are welcome to suggest functionality to add to it, if it's usefull for more people then I am more then happy to include it. Besides, with javascript you should already be able to do a lot of thing.Gub wrote:Can you expose some more of the internal API so we can write our own libraries that could be included into the system? Rather than requesting the method call you just suggested, I feel like users should be able to write them and then have them included (after review) into a standard library. Or can we already do this? Thoughts?
Caretaker of Arda
Re: Text Coloring
Code: Select all
var src_str=$("#mudoutput .line").last().html();
var term = "unusual";
term = term.replace(/(\s+)/,"(<[^>]+>)*$1(<[^>]+>)*");
var pattern = new RegExp("("+term+")", "i");
src_str = src_str.replace(pattern, "<mark>$1</mark>");
src_str = src_str.replace(/(<mark>[^<>]*)((<[^>]+>)+)([^<>]*<\/mark>)/,"$1</mark>$2<mark>$4");
$("#mudoutput .line").last().html(src_str);
Re: Text Coloring
Wow. After playing genesis all these years I still don't have the finest clue what do all these dots and other funny symbols mean! 

http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/