User Tools

Site Tools


4rpl:commands:setmsgbutton

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
4rpl:commands:setmsgbutton [2022/04/26 17:47] – [Description] Text format access and details to background color Vertu4rpl: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 [[4rpl:commands:sendmsg|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.  
-**<fs medium>slot</fs>** : The slot number for the button. The slots range 0 to 11 inclusive.  \\  +  ? slot 
-**<fs medium>enabled</fs>**: 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. 
-**<fs medium>text</fs>**: 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|implemented formatting]]. \\  +  ? enabled 
-**<fs medium>color</fs>**: The background color of the button, a float from [0,1]. Any numbers above 1 are treated as 1. Should be V4. Example: V4(1 1 1 1would be white. V4(0 0 1) is red. V4(0 1 0 1is green. V4(0 0 1 1) is blue. V4(<color #ff5555>Red</color> <color #55ff55>Green</color> <color #6666ff>Blue</color> <color #999999>Opacity</color>((How "not transparent" the background isAn opacity of 0 is fully transparent/see-through, a value of is fully Opacic/"not see through".))). The background color has visual details and won't ever be fully saturated with color, meaning red text on a red background will be clearly visible.\\  +  : A Boolean indicating if the button is visible.  All buttons are disabled by default. 
-**<fs medium>msgChannel</fs>**: The MSG channel to send the message on when clicked.  \\  +  ? text 
-**<fs medium>msgText</fs>**: 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 a [[V4]] [[4rpl:commands:specialsyntax#vectors|vector]]. Each of the 4 fields is floating-point value between 0 (zeroand 1 (oneindicating, respectively, the RedGreenBlue and Alpha component valuesNumbers larger than 1 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.1651009635.txt.gz · Last modified: 2022/04/26 17:47 by Vertu