Thread: Formattedtext for tooltips?
-
June 7th, 2018, 04:38 #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.
-
June 7th, 2018, 04:41 #2
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!
-
June 7th, 2018, 05:01 #3---
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.
-
June 7th, 2018, 06:03 #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.
-
June 8th, 2018, 05:23 #5
Archangel
- 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