BIS fnc 3DENShowMessage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (fixed example)
(Add Boolean option)
Line 6: Line 6:
|gr1= Eden Editor
|gr1= Eden Editor


|descr= Shows a pop-up message. In case one wants to add custom code to the buttons but preserve the localized text, use the following stringtable entries:
|descr= Shows a pop-up message.
In order to skip any optional parameter in between other parameters, send [[nil]] as parameter.
{{Feature|informative|The following [[Stringtable.xml|stringtable]] entries are useful to add custom [[Code]] but keep the default button texts:
* <tt>"STR_DISP_OK"</tt>
* <tt>"STR_DISP_OK"</tt>
* <tt>"STR_DISP_CLOSE"</tt>
* <tt>"STR_DISP_CLOSE"</tt>
* <tt>"STR_DISP_CANCEL"</tt>
* <tt>"STR_DISP_CANCEL"</tt>
In order to skip any optional parameter in between other parameters, send [[nil]] as parameter.
}}


|s1= [text, title, buttonOK, buttonCancel, icon] call [[BIS_fnc_3DENShowMessage]]
|s1= [text, title, buttonOK, buttonCancel, icon] call [[BIS_fnc_3DENShowMessage]]
Line 18: Line 20:
|p2= title: [[String]] - (Optional, default "") Title header
|p2= title: [[String]] - (Optional, default "") Title header


|p3= buttonOK: [[String]] - (Optional, default "") If [[String]] then it is the text of the button. Can also be [[Array]] in format:<br>
|p3= buttonOK: [[String]], [[Boolean]] or [[Array]] - (Optional, default "") can be one of:
0: [[String]] - Text<br>
* [[String]] - button's text
1: [[Code]] - Code executed when button is pressed
* [[Boolean]] - show button or not
* [[Array]] - in format [<nowiki/>[[String]] or [[Boolean]], [[Code]]]:
** [[String]] or [[Boolean]] - same as above
** [[Code]] - code executed when button is pressed


|p4= buttonCancel: [[String]] - (Optional, default "") Same as buttonOK
|p4= buttonCancel: [[String]], [[Boolean]] or [[Array]] - (Optional, default "") can be one of:
* [[String]] - button's text
* [[Boolean]] - show button or not
* [[Array]] - in format [<nowiki/>[[String]] or [[Boolean]], [[Code]]]:
** [[String]] or [[Boolean]] - same as above
** [[Code]] - code executed when button is pressed


|p5= icon: [[String]] - (Optional, default "") Path to an icon which will be shown on the left side of the message
|p5= icon: [[String]] - (Optional, default "") Path to an icon which will be shown on the left side of the message


|p6= parentDisplay: [[Display]] - (Optional, default [[findDisplay]] 313 (Display Eden)) Display from which the window is opened from
|p6= parentDisplay: [[Display]] - (Optional, default {{ic|[[findDisplay]] 313}} (Eden Display)) display from which the window is opened from


|r1= [[Display]]
|r1= [[Display]]
Line 37: Line 47:
[
[
"Yes",
"Yes",
{BIS_Message_Confirmed = [[true]]}
{ BIS_Message_Confirmed = [[true]] }
],
],
[
[
"No",
"No",
{BIS_Message_Confirmed = [[false]]}
{ BIS_Message_Confirmed = [[false]] }
],
],
"\A3\ui_f\data\map\markers\handdrawn\warning_CA.paa",
"\A3\ui_f\data\map\markers\handdrawn\warning_CA.paa",
[[findDisplay]] 313
[[findDisplay]] 313
] [[call]] [[BIS_fnc_3DENShowMessage]]; {{cc|A confirm window}}</code>
] [[call]] [[BIS_fnc_3DENShowMessage]];</code>


|x3= <code>{{cc|Only change the OK button's code}}
|x3= <code>{{cc|Only change the OK button's code}}
Line 53: Line 63:
[
[
[[nil]],
[[nil]],
{BIS_Message_Confirmed = [[true]]}
{ BIS_Message_Confirmed = [[true]] }
],
],
[[nil]],
[[nil]],
"\A3\ui_f\data\map\markers\handdrawn\warning_CA.paa",
"\A3\ui_f\data\map\markers\handdrawn\warning_CA.paa",
[[findDisplay]] 313
[[findDisplay]] 313
] [[call]] [[BIS_fnc_3DENShowMessage]]; {{cc|A confirm window}}</code>
] [[call]] [[BIS_fnc_3DENShowMessage]];</code>


|seealso= [[BIS_fnc_guiMessage]]
|seealso= [[BIS_fnc_guiMessage]]
}}
}}

Revision as of 09:34, 15 September 2021

Hover & click on the images for description

Description

Description:
Shows a pop-up message. In order to skip any optional parameter in between other parameters, send nil as parameter.
The following stringtable entries are useful to add custom Code but keep the default button texts:
  • "STR_DISP_OK"
  • "STR_DISP_CLOSE"
  • "STR_DISP_CANCEL"
Execution:
call
Groups:
Eden Editor

Syntax

Syntax:
[text, title, buttonOK, buttonCancel, icon] call BIS_fnc_3DENShowMessage
Parameters:
text: String - Text to display
title: String - (Optional, default "") Title header
buttonOK: String, Boolean or Array - (Optional, default "") can be one of:
buttonCancel: String, Boolean or Array - (Optional, default "") can be one of:
icon: String - (Optional, default "") Path to an icon which will be shown on the left side of the message
parentDisplay: Display - (Optional, default findDisplay 313 (Eden Display)) display from which the window is opened from
Return Value:
Display

Examples

Example 1:
["Message","Title of the Message"] call BIS_fnc_3DENShowMessage;
Example 2:
[ "Are you sure you want to delete / modify the selected variables?", "Delete / Modify", [ "Yes", { BIS_Message_Confirmed = true } ], [ "No", { BIS_Message_Confirmed = false } ], "\A3\ui_f\data\map\markers\handdrawn\warning_CA.paa", findDisplay 313 ] call BIS_fnc_3DENShowMessage;
Example 3:
// Only change the OK button's code [ "Are you sure you want to delete / modify the selected variables?", "Delete / Modify", [ nil, { BIS_Message_Confirmed = true } ], nil, "\A3\ui_f\data\map\markers\handdrawn\warning_CA.paa", findDisplay 313 ] call BIS_fnc_3DENShowMessage;

Additional Information

See also:
BIS_fnc_guiMessage

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