Doesn't the macro button already have a tooltip? I guess you can try it out, but I don't think so.Full Bleed wrote:Can you Tool Tip a macro button that is using an image?
HTML in macro button labels - what all does it break?
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: HTML in macro button labels - what all does it break?
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: HTML in macro button labels - what all does it break?
Depends whether he means "using the built-in tooltip feature that all macros have" (which I think should work fine even if the macro label is an image), or "including an HTML tooltip in the macro's label" (which I doubt would work).aliasmask wrote:Doesn't the macro button already have a tooltip? I guess you can try it out, but I don't think so.Full Bleed wrote:Can you Tool Tip a macro button that is using an image?
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton
Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0
- G. K. Chesterton
Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: HTML in macro button labels - what all does it break?
I never use the built in tool-tip feature so I wasn't looking for it... that works fine.
I haven't been able to get an HTML tooltip to work. But I guess it doesn't really matter.
I haven't been able to get an HTML tooltip to work. But I guess it doesn't really matter.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: HTML in macro button labels - what all does it break?
But they do work! Just put an "<html>" tag at the beginning, and you're ready to insert tables and images.
Re: HTML in macro button labels - what all does it break?
I can imagine html tooltips would be preferred (especially for front-end camp macros that wont get macrolink called) as the in-built macro tooltips get lost when exported.
However this does mean that the macro label would become huge and cluttered xD
Mal
However this does mean that the macro label would become huge and cluttered xD
Mal
Mal
Re: HTML in macro button labels - what all does it break?
Yeah, one of the downsides is that if you wanted to manipulate the button itself (change its color, etc), you'd have to refer to the label in its entirety (including the tooltip), or create a table cross-referencing the name of the macro as it appears vs. the actual text in the label or something like that.Malekith wrote:I can imagine html tooltips would be preferred (especially for front-end camp macros that wont get macrolink called) as the in-built macro tooltips get lost when exported.
However this does mean that the macro label would become huge and cluttered xD
Mal
I ran into that in updating my D&D framework - I put an image in the macro labels, and then realized that I'd have to refer to the full label including all the image gobbledygook if I wanted to alter the button itself. I stored the text of the actual button label in the JSON that described the power, so I could pull it out. But it can make the labels somewhat unwieldy.
Re: HTML in macro button labels - what all does it break?
That's why you use the Import/Export Macro utility instead of the built-in exporting.Malekith wrote:I can imagine html tooltips would be preferred (especially for front-end camp macros that wont get macrolink called) as the in-built macro tooltips get lost when exported.
However this does mean that the macro label would become huge and cluttered xD
Mal
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton
Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0
- G. K. Chesterton
Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: HTML in macro button labels - what all does it break?
Is there a way to pull an image from a table for a button image?
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
-
- Dragon
- Posts: 317
- Joined: Fri Apr 23, 2010 8:17 pm
Re: HTML in macro button labels - what all does it break?
Perhaps it would be worth separating the displayed button label from the macro name? The former could be interpreted as HTML for display, whereas the latter would be used for calling the macro and identifying it programmatically? The label could default to being equal to the name if it is not set....
"He knows not how to know who knows not also how to un-know." --Sir Richard Burton
Re: HTML in macro button labels - what all does it break?
No, and you can't use getImage() either. You can useFull Bleed wrote:Is there a way to pull an image from a table for a button image?
Code: Select all
<img src="asset://882ec624750f302bf210c7f8c18caf99">
Code: Select all
<img src="http://www.address.com/image.jpg">
Re: HTML in macro button labels - what all does it break?
Saw this thread and thought I'd share a discovery...
I'm currently creating a "framework" (fairly simple so far) that stores powers for tokens, then creates macros for those powers. I wanted to use the name of the power as the name of the macro and control it through the name. For instance, say I have a "Potion of Healing" power. Sometimes, the user has a potion of healing or two, sometimes not. Whether or not he has one depends on whether or not he has a macro for it in the "Consumable" group. If he has 3 potions, I create three different macros for it, which self-delete when used. The power remains, however.
Now, when deleting or adding macros, I didn't want to have to futz around with bold or other tags in the macro's name, yet I wanted to have bolded macro labels. So, I discovered how to do this without adding the tags to the macro name. I apologize ahead of time if someone's already posted about this technique.
To make a macro title bold without adding tags to the name, just r-click the macro, go to Edit, and look at the "Font Size" setting. If you notice, this looks surprisingly like stylesheet notation. That's actually what it is, in fact.
So, say the font size is currently at "1.00em" To add bolding to the macro name, change it to this:
1.00em; font-weight: bold
Viola! Bolded macro label.
You'll need a later version of MapTools that uses an actual combo box for Font Size, rather than a dropdown list. I know it doesn't work in b66, but does in b84 and higher. And, of course, you can add whatever other styles you want to the button by using the Font Size entry as well.
I'm currently creating a "framework" (fairly simple so far) that stores powers for tokens, then creates macros for those powers. I wanted to use the name of the power as the name of the macro and control it through the name. For instance, say I have a "Potion of Healing" power. Sometimes, the user has a potion of healing or two, sometimes not. Whether or not he has one depends on whether or not he has a macro for it in the "Consumable" group. If he has 3 potions, I create three different macros for it, which self-delete when used. The power remains, however.
Now, when deleting or adding macros, I didn't want to have to futz around with bold or other tags in the macro's name, yet I wanted to have bolded macro labels. So, I discovered how to do this without adding the tags to the macro name. I apologize ahead of time if someone's already posted about this technique.
To make a macro title bold without adding tags to the name, just r-click the macro, go to Edit, and look at the "Font Size" setting. If you notice, this looks surprisingly like stylesheet notation. That's actually what it is, in fact.
So, say the font size is currently at "1.00em" To add bolding to the macro name, change it to this:
1.00em; font-weight: bold
Viola! Bolded macro label.
You'll need a later version of MapTools that uses an actual combo box for Font Size, rather than a dropdown list. I know it doesn't work in b66, but does in b84 and higher. And, of course, you can add whatever other styles you want to the button by using the Font Size entry as well.
OggDude
There's someone in my head, but it's not me
There's someone in my head, but it's not me
Re: HTML in macro button labels - what all does it break?
Interesting find, but I know that will play havoc with my RPEdit when trying to edit buttons. Oh, and so you know, using em values other than 1 will cause a cascading problem, so the actual results will not be the desired results. I tend to use pt when setting font sizes. 11pt matches the current font size.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: HTML in macro button labels - what all does it break?
It probably won't happen because we're in a feature freeze for 1.3, but also be aware that the font size could suddenly be put into a CSS parameter or style attribute with quotes around it in the future, so this hack isn't guaranteed to work in the future.
But as I said, I don't see that part of the MT code changing unless there's a must-fix bug report regarding it...
But as I said, I don't see that part of the MT code changing unless there's a must-fix bug report regarding it...
Re: HTML in macro button labels - what all does it break?
Understood. Since a lot of people like modifying the appearance of the macro buttons, maybe the macro editor just needs more flexibility than fore color, back color, and font size. Maybe display a font chooser, or just have a free-form style box. A picture chooser with placement options (left, right, background) would also please a lot of people, apparently. Or, just separate the "name" of the macro from the display label. They can default to be the same, but you can allow any sort of HTML you want to on the display label and forbid it in the name. Something like thatAzhrei wrote:It probably won't happen because we're in a feature freeze for 1.3, but also be aware that the font size could suddenly be put into a CSS parameter or style attribute with quotes around it in the future, so this hack isn't guaranteed to work in the future.
But as I said, I don't see that part of the MT code changing unless there's a must-fix bug report regarding it...
My main focus on this was being able to modify the button's appearance without adding HTML code to the label. I want my labels to be the text-only name of the macro and access them as such.
OggDude
There's someone in my head, but it's not me
There's someone in my head, but it's not me
Re: HTML in macro button labels - what all does it break?
Well, the "right way" to do it is to provide a way for the user to specify a "global" CSS stylesheet. Then they can use CSS classes to control appearance. That's likely to be the approach taken in the next version...OggDude wrote:Maybe display a font chooser, or just have a free-form style box.