easy text colouring Mod/Test: (9)

1 Name: Hogan : 2009-11-10 05:06 ID:QWQyOFto [Del]

G'day everyone:

I've been playing around with the source code of VNDSx 1.4.8, partly as a crash course in c++, and I've been looking at ways to make colouring text more user-friendly for scripters.

I've modified the script_interpreter and script_engine files, so now I've got 6 extra 'commands' (those words at the start of the line), which change the colour of the line of text:

  • textred (e.g. 'textred pie' produces 'pie' in red font)
  • textblue
  • textgreen
  • textcyan
  • textpurple
  • textyellow

I chose to do it this way as, I figured, few people would require colours beyond these.

As I stated, this is more a personal project, but I'd like some feedback If people think a mode like this is better then the whole ANSI code method. Anyway:
compiled: http://www.mediafire.com/file/mwajorjtjjm/vndsxH.zip
source: http://www.mediafire.com/file/z2rymlmtttg/vndsxH-src.zip

2 Name: Anonymous : 2009-11-10 11:55 ID:FpBa3z4t [Del]

That really makes it more simple xD. Just wondering though, do the original commands still work? Because sometimes it could be that people want to use the color on a specific word within the sentence like (just made up a syntax for demonstration) "This is the [textred]Red words[/textred] and this is the [textblue]Blue words[/textblue]."?

3 Name: Anonymous : 2009-11-10 12:13 ID:UcObE1/K [Del]

needs more .patch

4 Name: Hogan : 2009-11-10 13:44 ID:QWQyOFto [Del]

>>2
The way this works is simply changing the 'defualt colour' of the text for each line, so yes, you can still use the ANSI codes to change the text colour

>>3
??

5 Name: Rai : 2009-11-10 14:22 ID:iRA0muLy [Del]

>>4
I believe he means more colors to choose from.
Honestly that seems like enough to me though.

6 Name: Anonymous : 2009-11-10 14:37 ID:UcObE1/K [Del]

>>4
diff, whatever.

some way for me to merge it into the main branch without me having to just copy/paste over my stuff.

7 Name: anoNL : 2009-11-10 15:17 ID:c+fRGOHR [Del]

You don't really need language support:
gsetvar red = "\x1b[36;1m"
text $red This text is red

8 Name: Anonymous : 2009-11-10 16:35 ID:BxF2d0Al [Del]

>>7
anoNL, you are definitely a genius xD. I would have totally never thought of that.

9 Name: Hogan : 2009-11-12 02:41 ID:QWQyOFto [Del]

>>7

...whoa, why didn't I think of that??!

ah well, it was a good intro to the language anyway...

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:
Image: