• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Tooltips: |n vs Enter

Status
Not open for further replies.
Level 12
Joined
May 22, 2015
Messages
1,051
The Blizzard spells with line breaks use this special "|n" tag to make the rest of the text appear on the next line (which is much like \n, so it makes sense).

Tooltip length for items is capped (at some number, I don't know how many characters), and colour codes count towards this cap (all of the |cff111111|r characters count). I assume |n counts as two characters because of this despite \n (new line) being only 1.

I found this by accident. Normally, hitting the "Enter" key will just save what you have entered in a tooltip field and close the little dialog window that pops up for editing it. However, I was copy-pasting some stuff around and accidentally pasted some JASS into an item tooltip lol. Anyway, the point is that it pasted the new line character into the tooltip :D

I checked it in-game and it did put it on a new line. This got me thinking - I might be able to save a bit of tooltip space for those few items that needed to be reworded. It also makes the tooltip more readable in the editor since you can see the line breaks.

I will do some tests myself to see if it actually saves characters.

TL;DR;
I found out you can copy-paste new line characters into tooltips. It seems like I can save tooltip length (even if just a bit) and make tooltips more readable in the editor by doing this.

My questions:
Does anyone know about this?
Is this safe to use?

Thanks in advance!
 
Level 3
Joined
Jul 15, 2013
Messages
54
I found out using Ctrl + Enter in tooltip box also drops the line which is very convenient for me :D
IMO, i think it is safe to use
 
Level 12
Joined
May 22, 2015
Messages
1,051
Its because the tooltip text can end up being parsed from a localized text file. Since the parsing assigns new line a meaning, using such a character would cause malformed tooltips. Hence why |n exists as it is not a physical new line when read but represents one when parsed.

Interesting. Is this something that a map maker controls or should I worry about using new line characters in my tooltips because of this?
 
Status
Not open for further replies.
Top