User Tools

Site Tools


4rpl:commands:setmsgbutton

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
4rpl:commands:setmsgbutton [2022/04/24 14:17] – created virgilw4rpl:commands:setmsgbutton [2022/06/17 11:00] (current) Grabz
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
-<=[[4rpl:start| Index]]+<=[[4rpl:start| Index]] \\ 
 +<= [[4rpl:start#Messaging]] 
  
 :!: Available in version 2.3.2 and later. :!: Available in version 2.3.2 and later.
Line 7: Line 8:
  
 ===== Description ===== ===== Description =====
-Sets the state of a MSG Button.  MSG Buttons appear on the left of the display and to the right of the unit build pane. Up to 12 MSG buttons are supported.  Each MSG button will send a 4rpl message (same as SendMSG) when clicked if the msgChannel and msgText are set. \\ \\  +Sets the state of a MSG Button.  MSG Buttons appear on the left of the display and to the right of the unit build pane. Up to 12 MSG buttons are supported.  Each MSG button will send a 4rpl message (same as [[4rpl:commands:sendmsg|SendMSG]]) when clicked if the msgChannel and msgText are set.  
-**slot** : The slot number for the button. The slots range 0 to 11 inclusive.  \\  +  ? slot 
-**enabled**: A boolean indicating if the button is visible.  All buttons are disabled by default. \\  +  : The slot number for the button. The slots range 0 to 11 inclusive. 
-**text**: The text to appear on the button. Keep it short.  It will wrap and the button height will stretch to accommodate the text. \\  +  ? enabled 
-**color**: The background color of the button.  Should be a V4. ExampleV4(1,1,1,1) would be whiteV4(0 0 1) is redV4(0 1 0 1) is green. V4(0 0 1 1) is blue. \\  +  : A Boolean indicating if the button is visible.  All buttons are disabled by default. 
-**msgChannel**: The MSG channel to send the message on when clicked.  \\  +  ? text 
-**msgText**: The string to send to the MSG channel. \\ +  : The text to appear on the button. Keep it short.  It will wrap and the button height will stretch to accommodate the text. This has access to all of CW4's [[cw4:a.d.a_syntax_syntax_guide|rich text formatting can be used]]. 
 +  ? color 
 +   The background color of the button, expressed as [[V4]] [[4rpl:commands:specialsyntax#vectors|vector]]. Each of the 4 fields is a floating-point value between 0 (zero) and (one) indicatingrespectivelythe RedGreen, Blue and Alpha component valuesNumbers larger than are treated as 1.  
 +  ? msgChannel 
 +  : The MSG channel to send the message on when clicked.  
 +  ? msgText 
 +  : The string to send to the MSG channel. You must provide a non-empty string, otherwise the message will not be sent. 
 +  
  
 MSG buttons persist across save/load. So you can set the MSG buttons once from script and they will be present for the rest of a game, even across saves. MSG buttons persist across save/load. So you can set the MSG buttons once from script and they will be present for the rest of a game, even across saves.
4rpl/commands/setmsgbutton.1650824239.txt.gz · Last modified: 2022/04/24 14:17 by virgilw