BIS fnc guiMessage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= |p7=" to "|PARAMETER6= |p7=")
m (Text replacement - "<br />" to "<br>")
Line 13: Line 13:
|p1= [[File:TKOH_version.gif|bottom|link=]] <span style="vertical-align: top; font-weight: bold">Take On Helicopters</span>
|p1= [[File:TKOH_version.gif|bottom|link=]] <span style="vertical-align: top; font-weight: bold">Take On Helicopters</span>
|p2= '''message''':
|p2= '''message''':
<br />[[String]] or [[Structured Text]] - message
<br>[[String]] or [[Structured Text]] - message
<br />[[Array]] - listbox, every item is defined as [[String]] (enabled) or [[String]] in [[Array]] (disabled)
<br>[[Array]] - listbox, every item is defined as [[String]] (enabled) or [[String]] in [[Array]] (disabled)
<br />
<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=
<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 |PARAMETER3=
|p3= '''header''' (Optional): [[String]] or [[Structured Text]] - header text |PARAMETER3=
Line 39: Line 39:
|p23= '''header''' (Optional): [[String]] - header text |=
|p23= '''header''' (Optional): [[String]] - header text |=
|p24= '''okButton''' (Optional):
|p24= '''okButton''' (Optional):
<br />[[Boolean]] - enable "OK" button (default: true)
<br>[[Boolean]] - enable "OK" button (default: true)
<br />[[String]] - custom text for "OK" button |=
<br>[[String]] - custom text for "OK" button |=
|p25= '''cancelButton''' (Optional):
|p25= '''cancelButton''' (Optional):
<br />[[Boolean]] - enable "Cancel" button (default: false)
<br>[[Boolean]] - enable "Cancel" button (default: false)
<br />[[String]] - custom text for "Cancel" button |=
<br>[[String]] - custom text for "Cancel" button |=
|p26= '''parent''' (Optional): [[Display]] - parent display |=
|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) |=
|p27= '''useParentBox''' (Optional): [[Boolean]] - try to use control inherited from "RscMessageBox" in parent instead of creating a new one (default: false) |=
Line 49: Line 49:


|r2= [[Boolean]] - true if "OK" button was pressed, otherwise false
|r2= [[Boolean]] - true if "OK" button was pressed, otherwise false
<br />Returned only after message box is closed.|RETURNVALUE=
<br>Returned only after message box is closed.|RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
Line 55: Line 55:


|x2= <code>["Message","Header",nil,true] spawn BIS_fnc_guiMessage;</code>
|x2= <code>["Message","Header",nil,true] spawn BIS_fnc_guiMessage;</code>
Result:<br />
Result:<br>
[[File:TakeOn BIS fnc guiMessage.jpg|200px]]|Example2=
[[File:TakeOn BIS fnc guiMessage.jpg|200px]]|Example2=



Revision as of 10:33, 19 March 2020

Hover & click on the images for description

Description

Description:
Shows customized native message box to user
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[message, (header, position, isCancel, parent, pause)] call BIS_fnc_guiMessage;
Parameters:
TKOH version.gif Take On Helicopters
message:
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 and is Number, item with index equal to the variable will be selected by default.
header (Optional): String or Structured Text - header text
position (Optional): Array - position in format [x,y,w,h]
isCancel (Optional): Boolean or Array - true to display cancel button or array with button texts [okText,cancelText]
parent (Optional): Display - parent display
pause (Optional): Boolean - 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 - selected listbox item (when listbox was used)
Returned only after message box is closed.

Alternative Syntax

Syntax:
[(message, header, okButton, cancelButton, parent, useParentBox, pause)] call BIS_fnc_guiMessage;
Parameters:
arma3 release version.gif Arma 3
message (Optional): String or Structured Text - message
header (Optional): String - header text
okButton (Optional):
Boolean - enable "OK" button (default: true)
String - custom text for "OK" button
cancelButton (Optional):
Boolean - enable "Cancel" button (default: false)
String - custom text for "Cancel" button
parent (Optional): Display - parent display
useParentBox (Optional): Boolean - try to use control inherited from "RscMessageBox" in parent instead of creating a new one (default: false)
pause (Optional): Boolean - pause simulation when message box is open (default: true, 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:
["Message","Header",nil,true] spawn BIS_fnc_guiMessage; Result:
TakeOn BIS fnc guiMessage.jpg
Example 3:
[["Enabled Item",["Disabled Item"]],"Header"] spawn BIS_fnc_guiMessage; // TKOH
Example 4:
_result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage; // Arma 3

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

Bottom Section

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 { _result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage; //use _result here }
Posted on January 13, 2016 - 19:38 (UTC)
Revo
That's how it looks in Arma 3 Screenshot --Revo (talk) 20:38, 13 January 2016 (CET)
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.