1. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice
  2. Melee Mapping Contest #3 - Results are out! Congratulate the winners and check plenty of new 4v4 melee maps designed for this competition!
    Dismiss Notice
  3. The winners of our cinematic soundtrack competition have been decided! Step by the Music Contest #11 - Results to check the entries and congratulate the winners!
    Dismiss Notice

Tooltips: |n vs Enter

Discussion in 'World Editor Help Zone' started by SAUS, Feb 19, 2016.

  1. SAUS

    SAUS

    Joined:
    May 22, 2015
    Messages:
    1,048
    Resources:
    0
    Resources:
    0
    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!
     
  2. vuakudo

    vuakudo

    Joined:
    Jul 15, 2013
    Messages:
    54
    Resources:
    0
    Resources:
    0
    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
     
  3. Warseeker

    Warseeker

    Joined:
    Feb 18, 2014
    Messages:
    2,294
    Resources:
    1
    Maps:
    1
    Resources:
    1
    You can find all those tooltip in Magos Model Editor and copy-paste them in OE, so yes it's safe
     
  4. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,043
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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.
     
  5. SAUS

    SAUS

    Joined:
    May 22, 2015
    Messages:
    1,048
    Resources:
    0
    Resources:
    0
    Interesting. Is this something that a map maker controls or should I worry about using new line characters in my tooltips because of this?
     
  6. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,043
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    I am not sure. As far as I know no maps have been localized into multiple languages.