setUserActionText: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "<sqf>([^↵][^\/]*↵[^\/]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(38 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 0.50


|0.50|Game version=
|arg= global


|arg= global |Multiplayer Arguments=
|eff= local


|eff= local |Multiplayer Effects=
|gr1= Interaction


|gr1= Interaction |GROUP1=
|descr= [[File:setUserActionText.jpg|right|350px]] Changes user added action (see [[addAction]]) menu item text. <br><br>
____________________________________________________________________________________________


| Changes user added action (see [[addAction]]) menu item text. <br><br>
|s1= object [[setUserActionText]] [actionIndex, textMenu, textWindowBackground, textWindowForeground]


Since Arma 3 v1.61.136587 it is possible to set 2 more optional texts, one for background and one for foreground when action is displayed on the screen (''showWindow'' <nowiki>=</nowiki> [[true]])<br><br>
|p1= object: [[Object]] - object the action is added to
[[Image:setUserActionText.jpg|500px]]
|DESCRIPTION=
____________________________________________________________________________________________


| object '''setUserActionText''' [actionIndex, textMenu, textWindowBackground, textWindowForeground] |SYNTAX=
|p2= actionIndex: [[Number]] - action id returned by [[addAction]]


|p1= object: [[Object]] - object the action is added to  |PARAMETER1=
|p3= textMenu: [[String]] or [[Structured Text]] - text title shown in scroll action menu


|p2= [actionIndex, textMenu, textWindowBackground, textWindowForeground] : [[Array]] |PARAMETER2=  
|p4= textWindowBackground: [[String]] or [[Structured Text]] - (Optional, default "") background text
|p4since= arma3 1.62


|p3= actionIndex: [[Number]] - action id returned by [[addAction]] |PARAMETER3=  
|p5= textWindowForeground: [[String]] or [[Structured Text]] - (Optional, default "") foreground text
|p5since= arma3 1.62


|p4= textMenu: [[String]] or [[Structured Text]] - Text title shown in scroll action menu |PARAMETER4=
|r1= [[Nothing]]
|p5= textWindowBackground (Optional): [[String]] or [[Structured Text]] - Text displayed at background (''Since Arma 3 v1.61.136587'') |PARAMETER4=
|p6= textWindowForeground (Optional): [[String]] or [[Structured Text]] - Text displayed at foreground (''Since Arma 3 v1.61.136587'')|PARAMETER5=


| [[Nothing]] |RETURNVALUE=
|x1= <sqf>
_id = player addAction ["Hello", ""];
player setUserActionText [_id, "Good Bye"];
</sqf>


 
|x2= <sqf>
|x1= <code>_id = [[player]] [[addAction]] ["Hello", ""];
_id = billboard addAction ["Some Action", {}];
[[player]] [[setUserActionText]] [_id, "Good Bye"];</code>|EXAMPLE1=
billboard setUserActionText [
 
|x2= <code>_id = billboard [[addAction]] ["Some Action", {}];
billboard [[setUserActionText]] [
_id,  
_id,  
"Some Action",  
"Some Action",  
<nowiki>"<t color='#ff0000'>Background-----------------</t><br>Multiline<br>Multiline<br>Multiline<br>. . ."</nowiki>,  
"<t color='#ff0000'>Background-----------------</t><br>Multiline<br>Multiline<br>Multiline<br>. . .",  
<nowiki>"<t color='#00ff00'>-----------------Foreground</t>"</nowiki>
"<t color='#00ff00'>-----------------Foreground</t>"
];</code>|EXAMPLE2=
];
____________________________________________________________________________________________
</sqf>
 
|  [[actionIDs]], [[actionParams]], [[addAction]], [[inGameUISetEventHandler]], [[showHUD]], [[inputAction]], [[removeAction]], [[removeAllActions]], [[action]] |SEEALSO=


| |MPBEHAVIOUR=  
|seealso= [[actionIDs]] [[actionParams]] [[addAction]] [[inGameUISetEventHandler]] [[showHUD]] [[inputAction]] [[removeAction]] [[removeAllActions]] [[action]]
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 11:34, 3 September 2024

Hover & click on the images for description

Description

Description:
setUserActionText.jpg
Changes user added action (see addAction) menu item text.

Groups:
Interaction

Syntax

Syntax:
object setUserActionText [actionIndex, textMenu, textWindowBackground, textWindowForeground]
Parameters:
object: Object - object the action is added to
actionIndex: Number - action id returned by addAction
textMenu: String or Structured Text - text title shown in scroll action menu
since Arma 3 logo black.png1.62
textWindowBackground: String or Structured Text - (Optional, default "") background text
since Arma 3 logo black.png1.62
textWindowForeground: String or Structured Text - (Optional, default "") foreground text
Return Value:
Nothing

Examples

Example 1:
_id = player addAction ["Hello", ""]; player setUserActionText [_id, "Good Bye"];
Example 2:
_id = billboard addAction ["Some Action", {}]; billboard setUserActionText [ _id, "Some Action", "<t color='#ff0000'>Background-----------------</t><br>Multiline<br>Multiline<br>Multiline<br>. . .", "<t color='#00ff00'>-----------------Foreground</t>" ];

Additional Information

See also:
actionIDs actionParams addAction inGameUISetEventHandler showHUD inputAction removeAction removeAllActions action

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note