HTML in macro button labels - what all does it break?

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: HTML in macro button labels - what all does it break?

Post by aliasmask »

Full Bleed wrote:Can you Tool Tip a macro button that is using an image?
Doesn't the macro button already have a tooltip? I guess you can try it out, but I don't think so.

User avatar
Raoden
Dragon
Posts: 381
Joined: Fri Dec 18, 2009 2:33 am
Location: San Diego

Re: HTML in macro button labels - what all does it break?

Post by Raoden »

aliasmask wrote:
Full Bleed wrote:Can you Tool Tip a macro button that is using an image?
Doesn't the macro button already have a tooltip? I guess you can try it out, but I don't think so.
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).
"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

User avatar
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?

Post by Full Bleed »

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. ;)
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
patoace
Dragon
Posts: 313
Joined: Mon Sep 24, 2007 6:10 pm
Location: Rancagua - Chile

Re: HTML in macro button labels - what all does it break?

Post by patoace »

But they do work! Just put an "<html>" tag at the beginning, and you're ready to insert tables and images.

Malekith
Giant
Posts: 245
Joined: Wed Jan 07, 2009 4:36 pm
Location: Gloucester, England
Contact:

Re: HTML in macro button labels - what all does it break?

Post by Malekith »

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
Mal

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: HTML in macro button labels - what all does it break?

Post by Rumble »

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
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.

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.

User avatar
Raoden
Dragon
Posts: 381
Joined: Fri Dec 18, 2009 2:33 am
Location: San Diego

Re: HTML in macro button labels - what all does it break?

Post by Raoden »

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
That's why you use the Import/Export Macro utility instead of the built-in exporting. :mrgreen:
"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

User avatar
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?

Post by Full Bleed »

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."

prestidigitator
Dragon
Posts: 317
Joined: Fri Apr 23, 2010 8:17 pm

Re: HTML in macro button labels - what all does it break?

Post by prestidigitator »

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

User avatar
patoace
Dragon
Posts: 313
Joined: Mon Sep 24, 2007 6:10 pm
Location: Rancagua - Chile

Re: HTML in macro button labels - what all does it break?

Post by patoace »

Full Bleed wrote:Is there a way to pull an image from a table for a button image?
No, and you can't use getImage() either. You can use

Code: Select all

<img src="asset://882ec624750f302bf210c7f8c18caf99">
pointing to some token stored image, or

Code: Select all

<img src="http://www.address.com/image.jpg">
but you need to always be on line.

User avatar
OggDude
Kobold
Posts: 4
Joined: Tue Sep 14, 2010 2:42 pm
Location: Bay Area, CA

Re: HTML in macro button labels - what all does it break?

Post by OggDude »

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.
OggDude
There's someone in my head, but it's not me

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: HTML in macro button labels - what all does it break?

Post by aliasmask »

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.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: HTML in macro button labels - what all does it break?

Post by Azhrei »

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...

User avatar
OggDude
Kobold
Posts: 4
Joined: Tue Sep 14, 2010 2:42 pm
Location: Bay Area, CA

Re: HTML in macro button labels - what all does it break?

Post by OggDude »

Azhrei 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...
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 that :)

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

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: HTML in macro button labels - what all does it break?

Post by Azhrei »

OggDude wrote:Maybe display a font chooser, or just have a free-form style box.
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...

Post Reply

Return to “Macros”