1. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  2. The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!
    Dismiss Notice
  3. We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.
    Dismiss Notice
  4. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    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,347
    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,265
    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,265
    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.