setMacroProps: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function setMacroProps== Sets the properties for the specified Token:Macro Button on the Token:Current Token . The properties are passed to this function as a [[Macros:String P...)
 
Line 1: Line 1:
==Function setMacroProps==
==Function setMacroProps==
Sets the properties for the specified [[Token:Macro Button|Macro Button]] on the [[Token:Current Token|Current Token]] . The properties are passed to this function as a [[Macros:String Property List|String Property List]]. This function accepts either a [[Token:Macro Button Index|Macro Button Index]] or the label of a [[Token:Macro Button|Macro Button]]. If it is a label then all of [[Token:Macro Button|Macro Button]]s on the [[Token:Current Token|Current Token]] with a matching label are changed. If the delimiter is not specified then the default value of ";" is used.
Sets the properties for the specified [[Token:Macro Button|Macro Button]] on the [[Token:Current Token|Current Token]] . The properties are passed to this function as a [[Macros:String Property List|String Property List]]. This function accepts either a [[Token:Macro Button Index|Macro Button Index]] or the label of a [[Token:Macro Button|Macro Button]]. If it is a label then all of [[Token:Macro Button|Macro Button]]s on the [[Token:Current Token|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 [[Macros:json object|json object]] containing the button properties, no delimiter needs to be specified in this case.


'''Valid Properties for Macro Buttons'''
'''Valid Properties for Macro Buttons'''

Revision as of 14:37, 24 December 2008

Function setMacroProps

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)]

Examples

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