BIS fnc guiMessage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Added infos about Arma 3 implementation)
(Remove TKOH content)
(30 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Function|= Comments
{{Function|Comments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| TKOH |= Game name
| arma3 |Game name=


|1.00|= Game version
|1.00|Game version=
____________________________________________________________________________________________
____________________________________________________________________________________________


| Shows customized native message box to user |= Description
| [[File:BIS fnc guiMessage.jpg|thumb|right|GUI message in {{arma3}}]] Shows customized native message box to user.
{{Informative | This syntax is for {{arma3}}. For the {{tkoh}} version, see [[BIS_fnc_guiMessage TKOH]].}} |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [message, (header, position, isCancel, parent, pause)] call BIS_fnc_guiMessage; |= Syntax
| [message, header, okButton, cancelButton, parent, useParentBox, pause)] spawn [[BIS_fnc_guiMessage]]
|p1= [[File:TKOH_version.gif|bottom|link=]] <span style="vertical-align:top">'''Take On Helicopters'''</span>
|p2= '''message''':
<br />[[String]] - message
<br />[[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. |=
|p3= '''header''' (Optional): [[String]] or [[Structured Text]] - header |=
|p4= '''position''' (Optional): [[Array]] - position in format [x,y,w,h] |=
|p5= '''isCancel''' (Optional): [[Boolean]] or [[Array]] - true to display cancel button or array with button texts [okText,cancelText] |=
|p6= '''parent''' (Optional): [[Display]] - parent display |=
|p7= '''pause''' (Optional): [[Boolean]] - true to pause simulation when message window is open |=


| [[Array]] - [endState, (lbId)]
|p1= message: [[String]] or [[Structured Text]] - (Optional, default "") message
* endState: [[Boolean]] - [[true]] when clicked OK button, [[false]] when escaped or clicked on Cancel button
 
* lbId: [[Number]] - selected listbox item (when listbox was used)
|p2= header: [[String]] - (Optional) header text
Returned only after message box was closed.|= Return value
____________________________________________________________________________________________


|s2= [message, (header, okButton, cancelButton, parent, useParentBox, pause)] call BIS_fnc_guiMessage; |= Alternative Syntax
|p3= okButton: [[Boolean]] or [[String]] (Optional, default [[true]])
|p21= [[File:arma3_release_version.gif|link=]] <span style="vertical-align:top">'''Arma 3'''</span>
* [[Boolean]] - enable "OK" button
|p22= '''message''':
* [[String]] - custom text for "OK" button
<br />[[String]] - message
<br />[[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. |=
|p23= '''header''' (Optional): [[String]] or [[Structured Text]] - header |=
|p24= '''okButton''' (Optional):
<br />[[Boolean]] - enable/disable "OK" button (default: true)
<br />[[String]] - custom text for "OK" button |=
|p25= '''cancelButton''' (Optional):
<br />[[Boolean]] - enable/disable "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) |=


|r2= [[Boolean]] - true if "OK" button was pressed, otherwise false
|p4= cancelButton: [[Boolean]] or [[String]] - (Optional, default [[false]])
<br />Returned only after message windows was closed.|= Return value
* [[Boolean]] - enable "Cancel" button
____________________________________________________________________________________________
* [[String]] - custom text for "Cancel" button
 
|x1= <code>["Hello World"] spawn BIS_fnc_guiMessage;</code>|=


|x2= <code>["Message","Header",nil,true] spawn BIS_fnc_guiMessage;</code>
|p5= parent: [[Display]] - (Optional, default [[displayNull]]) parent display
Result:<br />
[[File:TakeOn BIS fnc guiMessage.jpg|200px]]|=


|x3= <code>[["Enabled Item",["Disabled Item"]],"Header"] spawn BIS_fnc_guiMessage;</code>|=
|p6= useParentBox: [[Boolean]] - (Optional, default [[false]]) try to use control inherited from "RscMessageBox" in parent instead of creating a new one


|x4= <code>_result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage; // Arma 3</code>|=
|p7= pause: [[Boolean]] - (Optional, default [[true]]) pause simulation when message box is open (no effect in multiplayer)


| [[Boolean]] - [[true]] if "OK" button was pressed, otherwise false. Returned only after message box is closed. |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________


|exec= call |=
|x1= <code>["Hello World"] [[spawn]] [[BIS_fnc_guiMessage]];</code> |EXAMPLE1=


| |= See also
|x2= <code>_result = ["Are you sure?", "Confirm", [[true]], [[true]]] [[call]] [[BIS_fnc_guiMessage]];</code> |EXAMPLE2=
____________________________________________________________________________________________


| [[hintC]], [[BIS_fnc_GUIhint]]
}}
}}


Line 74: Line 45:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on June 24, 2014 - 00:43 (UTC)</dd>
<dt class="note">[[User:AgentRevolution|AgentRev]]</dt>
<dd class="note">
Message boxes can be force-closed with:
<code>[[uiNamespace]] [[setVariable]] ["BIS_fnc_guiMessage_status", [[false]]];</code>
</dd>
<dd class="notedate">Posted on January 13, 2016 - 15:16 (UTC)</dd>
<dt class="note">[[User:Eden|Eden]]</dt>
<dd class="note">
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]]
{
  [[private]] _result = ["Are you sure?", "Confirm", [[true]], [[true]]] [[call]] [[BIS_fnc_guiMessage]];
  {{cc|Use _result here}}
};</code>
</dd>
<dd class="notedate">Posted on November 1, 2017 - 18:35 (UTC)</dd>
<dt class="note">[[User:demellion|demellion]]</dt>
<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]].
</dd>


<!-- Note Section END -->
<!-- Note Section END -->
Line 80: Line 76:
<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>


[[Category:Take_On_Helicopters:_Functions|guiMessage]]
[[Category:Arma_3:_Functions|guiMessage]]
[[Category:Function Group: GUI|guiMessage]]
[[Category:Function Group: GUI|guiMessage]]

Revision as of 19:03, 23 April 2020

Hover & click on the images for description

Description

Description:
GUI message in Arma 3
Shows customized native message box to user.
This syntax is for Arma 3. For the Take On Helicopters version, see BIS_fnc_guiMessage TKOH.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[message, header, okButton, cancelButton, parent, useParentBox, pause)] spawn BIS_fnc_guiMessage
Parameters:
message: String or Structured Text - (Optional, default "") message
header: String - (Optional) header text
okButton: Boolean or String (Optional, default true)
  • Boolean - enable "OK" button
  • String - custom text for "OK" button
cancelButton: Boolean or String - (Optional, default false)
  • Boolean - enable "Cancel" button
  • String - custom text for "Cancel" button
parent: Display - (Optional, default displayNull) parent display
useParentBox: Boolean - (Optional, default false) try to use control inherited from "RscMessageBox" in parent instead of creating a new one
pause: Boolean - (Optional, default true) pause simulation when message box is open (no effect in multiplayer)
Return Value:
Boolean - true if "OK" button was pressed, otherwise false. Returned only after message box is closed.

Examples

Example 1:
["Hello World"] spawn BIS_fnc_guiMessage;
Example 2:
_result = ["Are you sure?", "Confirm", true, true] call 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

Notes

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.

Bottom Section