Maptool: Allow images in macro buttons

Created on 17 May 2020  Â·  4Comments  Â·  Source: RPTools/maptool

Is your feature request related to a problem? Please describe.
Explicitly allowing a macro button to be an image instead of text would be a nice way to jazz up the current macro panels.

It's actually already possible to have an image as the macro button (see https://forums.rptools.net/viewtopic.php?t=14551), but doing so is not straightforward and results in a macro that has something like

<img src="asset://8984680f892304f4d1ce0d1886fd5461" width=25 height=25>

as its name.

Describe the solution you'd like
An extra tab in the macro settings, that allow an image to be used without changing the name of the macro.

design needed feature

Most helpful comment

Agreed with @JamzTheMan on point 4 - In general, the macro name and the macro label/button display should be separable. Perhaps a displayLabel should just equal the current Label property by default unless a custom label with or without an image is defined.

I add things like <hr> and <b> tags to labels, and it is messy. For instance, here is a button I made recently: Simple5e Update Guide<hr>2.0 → <b>2.1</b>
image

This should probably have a name like 'updateGuide' and the label should be separate. Being able to add an image to this button easily as well would be a boon.

All 4 comments

I thought we had an issue for this but probably not, maybe it's just been in my "head" all this time :)

  1. Lets not add a new tab, there's plenty of space on the Details tab on the right.
  2. We can add a "preview" maybe? Reuse the token/handout/portrait UI from Token Detail panel? + button is there to pick images already.
  3. Are we storing the Asset on the macro button now? I think we should (it has to be stored somewhere).
  4. Lets also add a Label. It's useful to sometimes have an image + text. This allows you to have a macro name of findToken which can easily be called via findToken@campaign but with an image plus text of "Find Me!"
  5. Label probably needs placement options. It can default to just under the image but probably should have ability to go above, below, left, right, center of image with maybe additional option to flow around or over image?
  6. Image should fill by default unless height/width are supplied?
  7. All the new properties need to be added to the various metaMacro functions.

Thoughts?

Agreed with @JamzTheMan on point 4 - In general, the macro name and the macro label/button display should be separable. Perhaps a displayLabel should just equal the current Label property by default unless a custom label with or without an image is defined.

I add things like <hr> and <b> tags to labels, and it is messy. For instance, here is a button I made recently: Simple5e Update Guide<hr>2.0 → <b>2.1</b>
image

This should probably have a name like 'updateGuide' and the label should be separate. Being able to add an image to this button easily as well would be a boon.

This will also help us in the future by possible restricting macro names to a unique name with no funny characters and we could save them off to the file system a lot easier for...um... new features.

I like the idea of a label for the macro button very much. I think I'd rather implement that first instead of the image.

On the "Details" tab of macros, instead of

Label:
Group:

we could change it to

Name:
Label:
Group:

with label being displayed in the UI, and name being used for meta macros.

Was this page helpful?
0 / 5 - 0 ratings