BIS fnc guiMessage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= |p6=" to "|PARAMETER5= |p6=")
m (Text replacement - "<div style="clear: both"></div>" to "{{Clear}}")
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{TabView
____________________________________________________________________________________________


| TKOH |Game name=
|selected= 2


|1.00|Game version=
|title1= {{Icon|tkoh|24|link=}} {{tkoh}}
____________________________________________________________________________________________
|content1=
{{RV|type=function


| Shows customized native message box to user |DESCRIPTION=
|game1= TKOH
____________________________________________________________________________________________
|version1= 1.00


| [message, (''header'', ''position'', ''isCancel'', ''parent'', ''pause'')] call BIS_fnc_guiMessage; |SYNTAX=
|gr1= GUI
|p1= [[File:TKOH_version.gif|bottom|link=]] <span style="vertical-align: top; font-weight: bold">Take On Helicopters</span>
|p2= '''message''':
<br />[[String]] or [[Structured Text]] - message
<br />[[Array]] - listbox, every item is defined as [[String]] (enabled) or [[String]] in [[Array]] (disabled)
<br />
<br />When variable '''BIS_fnc_guiMessage_cursel''' is defined and is [[Number]], item with index equal to the variable will be selected by default. |Parameter2=


|p3= '''header''' (Optional): [[String]] or [[Structured Text]] - header text |=
|descr= Shows customized native message box to user.
|p4= '''position''' (Optional): [[Array]] - position in format [x,y,w,h] |PARAMETER4=


|p5= '''isCancel''' (Optional): [[Boolean]] or [[Array]] - true to display cancel button or array with button texts [okText,cancelText] |PARAMETER5=
|s1= [message, header, position, isCancel, parent, pause] spawn [[BIS_fnc_guiMessage]]


|p6= '''parent''' (Optional): [[Display]] - parent display |=
|p1= message: [[String]], [[Structured Text]] or [[Array]]:
|p7= '''pause''' (Optional): [[Boolean]] - true to pause simulation when message window is open |=
* [[String]] or [[Structured Text]] - message
* [[Array]] - listbox, every item is defined as [[String]] (enabled) or [[String]] in [[Array]] (disabled)
When variable '''BIS_fnc_guiMessage_cursel''' is defined as a [[Number]], item with this index will be selected.


| [[Array]] - [endState, (lbId)]
|p2= header: [[String]] or [[Structured Text]] - (Optional, default "") header text
 
|p3= position: [[Array]] - (Optional) position in format [x,y,w,h]
 
|p4= isCancel: [[Boolean]] or [[Array]] - (Optional, default [[true]]) true to display cancel button or array with button texts [okText, cancelText]
 
|p5= parent: [[Display]] - (Optional) parent display
 
|p6= pause: [[Boolean]] - (Optional) true to pause simulation when message window is open
 
|r1= [[Array]] - [endState, lbId]
* endState: [[Boolean]] - [[true]] when clicked OK button, [[false]] when escaped or clicked on Cancel button
* endState: [[Boolean]] - [[true]] when clicked OK button, [[false]] when escaped or clicked on Cancel button
* lbId: [[Number]] - selected listbox item (when listbox was used)
* lbId: [[Number]] - (Optional, returned if listbox was used) selected listbox item
Returned only after message box is closed.|RETURNVALUE=
Returned only after message box is closed.
____________________________________________________________________________________________
 
|x1= <code>["Hello World"] [[spawn]] [[BIS_fnc_guiMessage TKOH|BIS_fnc_guiMessage]];</code>
 
|x2= [[File:TakeOn BIS fnc guiMessage.jpg|right|200px]]
<code>["Message", "Header", [[nil]], [[true]]] [[spawn]] [[BIS_fnc_guiMessage TKOH|BIS_fnc_guiMessage]];</code>{{Clear}}
 
|x3= <code>[["Enabled Item", ["Disabled Item"]], "Header"] [[spawn]] [[BIS_fnc_guiMessage TKOH|BIS_fnc_guiMessage]];</code>
 
|seealso= [[hintC]], [[BIS_fnc_GUIhint]]
 
|exec= spawn
}}
 
|title2= {{Icon|arma3|24|link=}} {{arma3}}
|content2=
{{RV|type=function
 
|game1= arma3
|version1= 1.00
 
|eff= local
 
|gr1= GUI
 
|descr= [[File:BIS fnc guiMessage.jpg|thumb|right|[[BIS_fnc_guiMessage]] dialog in {{arma3}}]]
Displays an interactive message dialog in the center of the screen.
{{Feature|important|This function internally utilizes suspension ([[waitUntil]] to be specific) and therefore has to be executed in a [[Scheduler#Scheduled_Environment|scheduled environment]].}}
 
|exec= call


|s2= [(''message'', ''header'', ''okButton'', ''cancelButton'', ''parent'', ''useParentBox'', ''pause'')] call BIS_fnc_guiMessage; |Alternative Syntax=
|s1= [message, header, okButton, cancelButton, parent, useParentBox, pause] call [[BIS_fnc_guiMessage]]
|p21= [[File:arma3_release_version.gif|link=]] <span style="vertical-align: top; font-weight: bold">Arma 3</span>
|p22= '''message''' (Optional): [[String]] or [[Structured Text]] - message |=
|p23= '''header''' (Optional): [[String]] - header text |=
|p24= '''okButton''' (Optional):
<br />[[Boolean]] - enable "OK" button (default: true)
<br />[[String]] - custom text for "OK" button |=
|p25= '''cancelButton''' (Optional):
<br />[[Boolean]] - enable "Cancel" button (default: false)
<br />[[String]] - custom text for "Cancel" button |=
|p26= '''parent''' (Optional): [[Display]] - parent display |=
|p27= '''useParentBox''' (Optional): [[Boolean]] - try to use control inherited from "RscMessageBox" in parent instead of creating a new one (default: false) |=
|p28= '''pause''' (Optional): [[Boolean]] - pause simulation when message box is open (default: true, no effect in multiplayer)|=


|r2= [[Boolean]] - true if "OK" button was pressed, otherwise false
|p1= message (Optional, default: ""): [[String]] or [[Structured Text]] - Message
<br />Returned only after message box is closed.|RETURNVALUE=
____________________________________________________________________________________________
 
|x1= <code>["Hello World"] spawn BIS_fnc_guiMessage;</code>|Example1=


|x2= <code>["Message","Header",nil,true] spawn BIS_fnc_guiMessage;</code>
|p2= header (Optional, default: ""): [[String]] - Header text
Result:<br />
[[File:TakeOn BIS fnc guiMessage.jpg|200px]]|Example2=


|x3= <code>[["Enabled Item",["Disabled Item"]],"Header"] spawn BIS_fnc_guiMessage; // TKOH</code>|=
|p3= okButton (Optional, default: [[true]]):
* [[Boolean]] - Enable the "OK" button
* [[String]] - Custom text for the "OK" button


|x4= <code>_result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage; // Arma 3</code>|=
|p4= cancelButton (Optional, default: [[false]]):
* [[Boolean]] - Enable the "Cancel" button
* [[String]] - Custom text for the "Cancel" button


____________________________________________________________________________________________
|p5= parent (Optional, default: {{ic|[] [[call]] [[BIS_fnc_displayMission]]}}): [[Display]] - Parent display


| [[hintC]], [[BIS_fnc_GUIhint]] |SEEALSO=
|p6= useParentBox (Optional, default: [[false]]): [[Boolean]] - Try to use control inherited from "RscMessageBox" in parent instead of creating a new one


}}
|p7= pause (Optional, default: [[true]]): [[Boolean]] - Pause simulation while message dialog is open (no effect in multiplayer)


<h3 style="display:none">Notes</h3>
|r1= [[Boolean]] - [[true|True]] if the "OK" button was pressed, otherwise [[false]]. Returned only after the message box is closed.
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x1= Because this example uses [[spawn]], the return value of [[BIS_fnc_guiMessage]] is lost and can not be used.
</dl>
<code>["Hello World"] [[spawn]] [[BIS_fnc_guiMessage]];</code>


<h3 style="display:none">Bottom Section</h3>
|x2= <code>[[private]] _result = ["Are you sure?", "Confirm", [[true]], [[true]]] [[call]] [[BIS_fnc_guiMessage]];


[[Category:Functions|guiMessage]]
[[if]] (_result) [[then]] {
[[Category:Take_On_Helicopters:_Functions|guiMessage]]
[[systemChat]] "The player is sure.";
[[Category:Arma_3:_Functions|guiMessage]]
} [[else]] {
[[Category:Function Group: GUI|guiMessage]]
[[systemChat]] "The player is not sure.";
};</code>
 
|seealso= [[BIS_fnc_GUIhint]] [[BIS_fnc_3DENShowMessage]] [[hintC]]
}}
}}


<!-- CONTINUE Notes -->
<dl class="command_description">
<dl class="command_description">
<dt><dt>
<dd class="notedate">Posted on June 24, 2014 - 00:43 (UTC)</dd>
<dd class="notedate">Posted on June 24, 2014 - 00:43 (UTC)</dd>
<dt class="note">[[User:AgentRevolution|AgentRev]]</dt>
<dt class="note">[[User:AgentRevolution|AgentRev]]</dt>
<dd class="note">
<dd class="note">
Message boxes can be force-closed with:
Message boxes can be force-closed with:
<code>uiNamespace setVariable ["BIS_fnc_guiMessage_status", false];</code>
<code>[[uiNamespace]] [[setVariable]] ["BIS_fnc_guiMessage_status", [[false]]];</code>
</dd>
</dd>
</dl>
<!-- DISCONTINUE Notes -->


<!-- CONTINUE Notes -->
<dt><dt>
<dl class="command_description">
<dd class="notedate">Posted on January 13, 2016 - 15:16 (UTC)</dd>
<dd class="notedate">Posted on January 13, 2016 - 15:16 (UTC)</dd>
<dt class="note">[[User:Eden|Eden]]</dt>
<dt class="note">[[User:Eden|Eden]]</dt>
Line 98: Line 118:
Calling this function can cause an game crash. When doing this you have to [[spawn]] the function or add an spawn around it so you can use the result:
Calling this function can cause an game crash. When doing this you have to [[spawn]] the function or add an spawn around it so you can use the result:


<code>[] spawn
<code>[] [[spawn]]
{
{
  _result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage;
[[private]] _result = ["Are you sure?", "Confirm", [[true]], [[true]]] [[call]] [[BIS_fnc_guiMessage]];
 
{{cc|Use _result here}}
  //use _result here
};</code>
}</code>
</dd>
</dd>
</dl>
<!-- DISCONTINUE Notes -->
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on January 13, 2016 - 19:38 (UTC)</dd>
<dt class="note">[[User:Revo|Revo]]</dt>
<dd class="note">
That's how it looks in Arma 3
[http://i.imgur.com/WUZLaK1.jpg Screenshot]
--[[User:Revo|Revo]] ([[User talk:Revo|talk]]) 20:38, 13 January 2016 (CET)
</dd>
</dl>
<!-- DISCONTINUE Notes -->


<!-- CONTINUE Notes -->
<dt><dt>
<dl class="command_description">
<dd class="notedate">Posted on November 1, 2017 - 18:35 (UTC)</dd>
<dd class="notedate">Posted on November 1, 2017 - 18:35 (UTC)</dd>
<dt class="note">[[User:demellion|demellion]]</dt>
<dt class="note">[[User:demellion|demellion]]</dt>
<dd class="note">
<dd class="note">
'''NOTE''': This function only exists along with mission display ([[findDisplay]] 46). If this function is called before with ''-skipIntro'' parameter enabled (see [[Arma_3_Startup_Parameters]]) it will result as [[Void]].
'''NOTE''': This function only exists along with mission display ([[findDisplay]] 46). If this function is called before with ''-skipIntro'' parameter enabled (see [[Arma 3: Startup Parameters]]) it will result as [[Void]].
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 00:02, 22 June 2021

tkoh logo small.png Take On Helicopters
Arma 3 logo black.png Arma 3
Hover & click on the images for description

Description

Description:
Shows customized native message box to user.
Execution:
spawn
Groups:
GUI

Syntax

Syntax:
[message, header, position, isCancel, parent, pause] spawn BIS_fnc_guiMessage
Parameters:
message: String, Structured Text or Array: When variable BIS_fnc_guiMessage_cursel is defined as a Number, item with this index will be selected.
header: String or Structured Text - (Optional, default "") header text
position: Array - (Optional) position in format [x,y,w,h]
isCancel: Boolean or Array - (Optional, default true) true to display cancel button or array with button texts [okText, cancelText]
parent: Display - (Optional) parent display
pause: Boolean - (Optional) true to pause simulation when message window is open
Return Value:
Array - [endState, lbId]
  • endState: Boolean - true when clicked OK button, false when escaped or clicked on Cancel button
  • lbId: Number - (Optional, returned if listbox was used) selected listbox item
Returned only after message box is closed.

Examples

Example 1:
["Hello World"] spawn BIS_fnc_guiMessage;
Example 2:
TakeOn BIS fnc guiMessage.jpg
["Message", "Header", nil, true] spawn BIS_fnc_guiMessage;
Example 3:
[["Enabled Item", ["Disabled Item"]], "Header"] spawn BIS_fnc_guiMessage;

Additional Information

See also:
hintCBIS_fnc_GUIhint

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
Hover & click on the images for description

Description

Description:
BIS_fnc_guiMessage dialog in Arma 3

Displays an interactive message dialog in the center of the screen.

This function internally utilizes suspension (waitUntil to be specific) and therefore has to be executed in a scheduled environment.
Execution:
call
Groups:
GUI

Syntax

Syntax:
[message, header, okButton, cancelButton, parent, useParentBox, pause] call BIS_fnc_guiMessage
Parameters:
message (Optional, default: ""): String or Structured Text - Message
header (Optional, default: ""): String - Header text
okButton (Optional, default: true):
  • Boolean - Enable the "OK" button
  • String - Custom text for the "OK" button
cancelButton (Optional, default: false):
  • Boolean - Enable the "Cancel" button
  • String - Custom text for the "Cancel" button
parent (Optional, default: [] call BIS_fnc_displayMission): Display - Parent display
useParentBox (Optional, default: false): Boolean - Try to use control inherited from "RscMessageBox" in parent instead of creating a new one
pause (Optional, default: true): Boolean - Pause simulation while message dialog is open (no effect in multiplayer)
Return Value:
Boolean - True if the "OK" button was pressed, otherwise false. Returned only after the message box is closed.

Examples

Example 1:
Because this example uses spawn, the return value of BIS_fnc_guiMessage is lost and can not be used. ["Hello World"] spawn BIS_fnc_guiMessage;
Example 2:
private _result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage; if (_result) then { systemChat "The player is sure."; } else { systemChat "The player is not sure."; };

Additional Information

See also:
BIS_fnc_GUIhint BIS_fnc_3DENShowMessage hintC

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
Posted on June 24, 2014 - 00:43 (UTC)
AgentRev
Message boxes can be force-closed with: uiNamespace setVariable ["BIS_fnc_guiMessage_status", false];
Posted on January 13, 2016 - 15:16 (UTC)
Eden
Calling this function can cause an game crash. When doing this you have to spawn the function or add an spawn around it so you can use the result: [] spawn { private _result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage; // Use _result here };
Posted on November 1, 2017 - 18:35 (UTC)
demellion
NOTE: This function only exists along with mission display (findDisplay 46). If this function is called before with -skipIntro parameter enabled (see Arma 3: Startup Parameters) it will result as Void.