New Font Highlighting
Displaying 1-6 of 6 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Eldritch05

Okay, I give. I finally got Serinor's sprites all converted over to VERGE 3.2's new handling of them (which was something of a shock), but now I can't get font highlighting to work. Before I go through and change each @2 to a \f2, I want to make sure I know how to make it work.

Specifically, the string "\f2Text \f0Check" prints that exact string to the screen without any sort of coloring. I'm okay with changing all the instances of highlighted text; I just want to make sure to change it to the way it's supposed to work.

Posted on 2009-10-11 21:05:10

Kildorf

Quote:Originally posted by Eldritch05

Okay, I give. I finally got Serinor's sprites all converted over to VERGE 3.2's new handling of them (which was something of a shock), but now I can't get font highlighting to work. Before I go through and change each @2 to a \f2, I want to make sure I know how to make it work.

Specifically, the string "\f2Text \f0Check" prints that exact string to the screen without any sort of coloring. I'm okay with changing all the instances of highlighted text; I just want to make sure to change it to the way it's supposed to work.

Hey Eldritch, I'm looking into this. Looks like something's up with VergeC's string parsing. Since I'm winding my way through the arcane paths of the VergeC parser it may take me a couple of days to get a fix to you but it should happen eventually.

Posted on 2009-10-13 19:50:07

Overkill

That's cause backslashes are not escaped in string literals in VC. But are escaped in character literals!

In the meantime, try this (ugly) fix!
Textbox("You found a " + chr('\f') + "1Potion" + chr('\f') + "0 in the chest!")
chr() takes an int, ints can be expressed as character literals (which allow escape codes already). It's ugly magic. The same thing needs to be done to put \n newlines into text for prints.

Someone should really fix strings, one day soon. ;_;

The problem is, a lot of old code used backslashes without escapes, since there was no such thing as escape sequences back then. Especially in line-wrappers before we added WrapText(), and in choice-menu systems where they used \ as a special character.

I think we're at the point though, where we can add escape sequences to the language (possibly add a config flag for backwards compatibility).

Posted on 2009-10-14 18:16:15 (last edited on 2009-10-14 18:17:18)

Kildorf

Quote:Originally posted by Overkill

That's cause backslashes are not escaped in string literals in VC. But are escaped in character literals!

In the meantime, try this (ugly) fix!
Textbox("You found a " + chr('\f') + "1Potion" + chr('\f') + "0 in the chest!")
chr() takes an int, ints can be expressed as character literals (which allow escape codes already). It's ugly magic. The same thing needs to be done to put \n newlines into text for prints.

Someone should really fix strings, one day soon. ;_;

The problem is, a lot of old code used backslashes without escapes, since there was no such thing as escape sequences back then. Especially in line-wrappers before we added WrapText(), and in choice-menu systems where they used \ as a special character.

I think we're at the point though, where we can add escape sequences to the language (possibly add a config flag for backwards compatibility).


Actually, Overkill, I think I got it earlier. I've sent a new exe to Eldritch for testing (it seems to work in my small test cases but I don't have a big codebase to run it against). Once we know it works/I fix it completely I'll put a link up here and commit it to the repo.

Posted on 2009-10-14 19:48:38

Overkill

Okay, awesome. Hopefully you just had to change how EmitStringLiteral copies the junk out of the source? Can you make sure that it errors if an escape sequence is incorrect, so that people adapting old source can see their problems? Also what escape sequences will we support?

Just would be nice to have this part out in the open in case someone asks in the future.

Posted on 2009-10-15 08:58:01

Kildorf

Quote:Originally posted by Overkill

Okay, awesome. Hopefully you just had to change how EmitStringLiteral copies the junk out of the source? Can you make sure that it errors if an escape sequence is incorrect, so that people adapting old source can see their problems? Also what escape sequences will we support?

Just would be nice to have this part out in the open in case someone asks in the future.

Okay, just heard from Eldritch that it looks like things are good to go (except for a few gotchas).

I'll post more about it this evening after work. Or the weekend. One of those.

Posted on 2009-10-15 12:09:58


Displaying 1-6 of 6 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.