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

Add Macro(s) for Token Image Layout #979

Closed
Phergus opened this issue Dec 9, 2019 · 3 comments
Closed

Add Macro(s) for Token Image Layout #979

Phergus opened this issue Dec 9, 2019 · 3 comments
Assignees
Labels
feature Adding functionality that adds value macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) tested This issue has been QA tested by someone other than the developer.

Comments

@Phergus
Copy link
Contributor

Phergus commented Dec 9, 2019

Is your feature request related to a problem? Please describe.
The majority of functions within the Edit Token dialog has macro equivalents. The image layout functions on the Config tab have none.

Describe the solution you'd like
A macro that can handle the two functions available with the Layout portion of the Config tab

  1. Scale
  2. Position

Something like:
[setTokenLayoutProps(scale, xOffset, yOffset, tokenID, mapName)]

Where:

  • scale - is a decimal scale factor, e.g. 0.8 or 1.25
  • xOffset/yOffset - are +/- integer pixel offsets
  • tokenID - token name or ID
  • mapName - the map the token is on

A corresponding getTokenLayoutProps(delim) macro that returned the information as a JSON or String Property List would complete the set.

Describe alternatives you've considered
While these attributes of the token image can be adjusted via the Config tab, having the ability to adjust them via macro may prove useful.

@Phergus Phergus added feature Adding functionality that adds value documentation needed Missing, out-of-date or bad documentation macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) labels Dec 9, 2019
Merudo added a commit to Merudo/maptool that referenced this issue Mar 22, 2020
- Add getTokenLayoutProps(delim, tokenID, mapName) to return a jsonArray or String Property List containing the scale, xOffset, and yOffset of a layout. Default delim is ",".
- Add setTokenLayoutProps(scale, xOffset, yOffset, tokenID, mapName) to set the token layout. If the scale/xOffset/yOffset is set to the empty string "" then it will not be changed
- Close RPTools#979
@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Mar 22, 2020
@Phergus
Copy link
Contributor Author

Phergus commented Mar 22, 2020

Tested. Documented.

@Phergus Phergus removed the documentation needed Missing, out-of-date or bad documentation label Mar 22, 2020
@Phergus
Copy link
Contributor Author

Phergus commented Mar 23, 2020

@Merudo the set function requires pixel offsets to be integers but get returns floats. Maybe get should be changed to return an integer for the offsets?

Merudo added a commit to Merudo/maptool that referenced this issue Mar 23, 2020
- Change getTokenLayoutProps to return xOffset and yOffset as integer instead of double
- Discussed in RPTools#979
@Phergus
Copy link
Contributor Author

Phergus commented Mar 23, 2020

Retested. getTokenLayoutProps() now returns integer values for offsets.

@Phergus Phergus closed this as completed Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding functionality that adds value macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) tested This issue has been QA tested by someone other than the developer.
Projects
None yet
Development

No branches or pull requests

2 participants