Wintermute Engine Forum

Wintermute Engine => Bug reports => Topic started by: manarius on April 18, 2008, 05:26:29 PM

Title: string highlighting bug
Post by: manarius on April 18, 2008, 05:26:29 PM
i know its not important, cause there seem to be no player-felt bugs because of this,
and i think you know it already,
but its kind of disturbing if you encounter it the first time:

if you write for example:

ITEM.SetImage("items\png\"+anythinguseful+".sprite");

the highlighting ist completely screwed, ".sprite" is black, while the rest is grey and the engine makes that purple bar which indicates script errors.

as i said, its not anyway relevant for the player, its just a bit confusing for me.

cheers,
manarius

ps:
i think its because of the \ in the string?
Title: Re: string highlighting bug
Post by: jbw on April 25, 2008, 12:02:03 PM
ITEM.SetImage("items\png\"+anythinguseful+".sprite");

the highlighting ist completely screwed, ".sprite" is black, while the rest is grey and the engine makes that purple bar which indicates script errors.

The \" sequence is misunderstood by color highlighter as escaped quote. To get rid of annoyning purples I always write such lines as follows:
Code: [Select]
ITEM.SetImage("items\png\"+anythinguseful[i]+".sprite");//"
If the path "items\png\" is used more than once, you can define it as constant named e.g. IPNG, then use:
Code: [Select]
ITEM.SetImage(IPNG+anythinguseful[i]+".sprite");with perfect highlighting.