setMacroProps: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added version.)
No edit summary
Line 36: Line 36:
[h: setMacroProps("Attack", "color=red;fontColor=white")]
[h: setMacroProps("Attack", "color=red;fontColor=white")]
</source>
</source>
|changes=
{{change|1.3b49|Added ability for {{code|props}} to accept a JSON object.}}
}}
}}
[[Category:Metamacro Function]]
[[Category:Metamacro Function]]

Revision as of 22:25, 22 March 2009

setMacroProps() Function

Introduced in version 1.3b48
Sets the properties for the specified Macro Button on the Current Token . The properties are passed to this function as a String Property List. This function accepts either a Macro Button Index or the label of a Macro Button. If it is a label then all of Macro Buttons on the Current Token with a matching label are changed. If the delimiter is not specified then the default value of ";" is used. As of MapTool 1.3b49 setMacroProps() accepts a json object containing the button properties, no delimiter needs to be specified in this case.

Valid Properties for Macro Buttons

  • autoExec - true/false - Will the macro be automatically executed when the button is clicked on.
  • color - The name of the color for the button.
  • fontColor - The name of the font color for the button.
  • includeLabel - true/false - Will the label be output when the button is clicked.
  • group - The name of the group that the button is in.
  • sortBy - The sort by value of the macro button.
  • index - The index of the button.
  • label - the lavle of the button.
  • fontSize - The size of the font for the button.
  • minWidth - the minimum width of the button.

Usage

setMacroProps(index, props)
setMacroProps(index, props, delim)
setMacroProps(label, props)
setMacroProps(label, props, delim)

Example

[h: setMacroProps(1, "color=red;fontColor=white")]
[h: setMacroProps("Attack", "color=red;fontColor=white")]


Version Changes

  • 1.3b49 - Added ability for props to accept a JSON object.