setMacroProps

From RPTools Wiki
Jump to navigation Jump to search

setMacroProps() Function

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

[h: setMacroProps(index, props)]
[h: setMacroProps(index, props, delim)]
[h: setMacroProps(label, props)]
[h: setMacroProps(label, props, delim)]

Example

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