DICE PACKS BUNDLE
  1. #1

    Formattedtext for tooltips?

    I've been trying to find docs of setTooltipText() and to see if there is a way to make it properly display formattedtext. Is that just not possible?

    If not I suppose I could write a function that I can pass formattedtext to and get back just clean text with line breaks I guess.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    https://www.fantasygrounds.com/refdo...setTooltipText

    It's only a string, not formatted text.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    Quote Originally Posted by Trenloe View Post
    https://www.fantasygrounds.com/refdo...setTooltipText

    It's only a string, not formatted text.
    Thanks, I figured it had to be there I just have terrible luck with search finding things there.

    Sounds like I'll have to strip it all out ;(
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  4. #4
    If anyone else needs to do strip formattedtext to text, this works for me so far.

    Code:
    -- strip out formattedtext from a string
    function stripFormattedText(sText)
      local sTextOnly = sText;
      sTextOnly = sTextOnly:gsub("</p>","\n");
      sTextOnly = sTextOnly:gsub("<.?[ubiphUBIPH]>","");
      sTextOnly = sTextOnly:gsub("<.?table>","");
      sTextOnly = sTextOnly:gsub("<.?frame>","");
      sTextOnly = sTextOnly:gsub("<.?t.?>","");
      sTextOnly = sTextOnly:gsub("<.?list>","");
      sTextOnly = sTextOnly:gsub("<.?li>","");
      return sTextOnly;  
    end
    Last edited by celestian; June 9th, 2018 at 02:26. Reason: Minor tweak to get the new line breaks a bit better.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  5. #5

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Thanks, Celestian.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in