huderlem/poryscript

{COLOR ...} Constants apply to the character count for msgbox formatting

barcedev opened this issue · 2 comments

My poryscript code

msgbox(format("Ryder: {COLOR BLUE}You were late to getting your first Pokémon from {COLOR GREEN}Professor Cypress{COLOR BLUE}!))

Compiled code

	.string "Ryder: {COLOR BLUE}You were late to\n"
	.string "getting your first Pokémon from {COLOR\l"
	.string "GREEN}Professor Cypress{COLOR BLUE}!\p"

As you can see, {COLOR GREEN} is cut off halfway due to Poryscript thinking that the Color Code are actual characters that will show up in the message, which is incorrect.

Due to this cutoff, when executing the make command in my project, it causes an error since {COLOR GREEN} is cut up and is obfuscated by the \l

I attempted to add some colors to the font_widths.json file, but it doesn't seem to change how the message is formatted.

	 ...
	  "{COLOR RED}": 0,
	  "{COLOR BLUE}": 0,
	  "{COLOR DARK_GREY}": 0,
	  "{COLOR GREEN}": 0,
	 ...

Good find. I'm guessing the root-cause is because there are multiple words between the curly braces. I'll fix this in the next day or two.