Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: impossible to reference macros in subdirectories of addon with macro links #3259

Closed
dark-ether opened this issue Dec 8, 2021 · 3 comments · Fixed by #3860
Closed
Assignees
Labels

Comments

@dark-ether
Copy link
Contributor

dark-ether commented Dec 8, 2021

Describe the Bug

macro links with / don't work , and neither does escaping them.

To Reproduce

  1. create addon with a subdirectory containing a macro
  2. try to reference it with a macro link
  3. see that it doesn't work

Expected Behaviour

macros in addons should be able to be linked even if in subdirectories

Screenshots

No response

MapTool Info

1.11.3

Desktop

arch linux

Additional Context

No response

@dark-ether dark-ether added the bug label Dec 8, 2021
@emmebi
Copy link
Collaborator

emmebi commented Mar 5, 2023

The problem appears to be in the regular expression used to parse the macro links.

In a link like

macro://jukebox/playAllClient@lib:bizland5e/all/Impersonated?281_Escape_from_Shadow.mp3

the above regular expression will match jukebox as the macro name, with no qualification, causing the macro to fail with an error like

Must specify a location for the macro jukebox

@emmebi
Copy link
Collaborator

emmebi commented Mar 5, 2023

Assign this to me, I will give it a try at fixing as suggested in the discord chat

@Phergus Phergus moved this from Todo to In Progress in MapTool 1.13.0 Mar 5, 2023
emmebi added a commit to emmebi/maptool that referenced this issue Mar 11, 2023
Changed all the regular expression related to MacroLinkFunction class
to directly match the longest possible path in the macro path.
@emmebi
Copy link
Collaborator

emmebi commented Mar 11, 2023

Uploading the following two files to expose the problem. The add on exposes a macro in the folder1 folder called hello which takes a parameter.

There is a macro in the Campaign window of the campaign which will call the add-on. This doesn't work with MapTool 1.12.2, but works with the fix applied.

maptool-test-addon.zip
bug3259.zip

@emmebi emmebi mentioned this issue Mar 11, 2023
Phergus added a commit that referenced this issue Mar 12, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Merged in MapTool 1.13.0 Mar 12, 2023
@kwvanderlinde kwvanderlinde moved this from Merged to Done in MapTool 1.13.0 Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants