BIS fnc guiMessage: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 36: | Line 36: | ||
Returned only after message box is closed. | Returned only after message box is closed. | ||
|x1= < | |x1= <sqf>["Hello World"] spawn BIS_fnc_guiMessage;</sqf> | ||
|x2= [[File:TakeOn BIS fnc guiMessage.jpg|right|200px]] | |x2= [[File:TakeOn BIS fnc guiMessage.jpg|right|200px]] | ||
< | <sqf>["Message", "Header", nil, true] spawn BIS_fnc_guiMessage;</sqf> | ||
|x3= < | |x3= <sqf>[["Enabled Item", ["Disabled Item"]], "Header"] spawn BIS_fnc_guiMessage;</sqf> | ||
|seealso= [[hintC]] [[BIS_fnc_GUIhint]] | |seealso= [[hintC]] [[BIS_fnc_GUIhint]] | ||
Line 88: | Line 88: | ||
|x1= Because this example uses [[spawn]], the return value of [[BIS_fnc_guiMessage]] is lost and can not be used. | |x1= Because this example uses [[spawn]], the return value of [[BIS_fnc_guiMessage]] is lost and can not be used. | ||
< | <sqf>["Hello World"] spawn BIS_fnc_guiMessage;</sqf> | ||
|x2= < | |x2= <sqf> | ||
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."; | |||
};</ | }; | ||
</sqf> | |||
|seealso= [[BIS_fnc_GUIhint]] [[BIS_fnc_3DENShowMessage]] [[hintC]] | |seealso= [[BIS_fnc_GUIhint]] [[BIS_fnc_3DENShowMessage]] [[hintC]] | ||
Line 103: | Line 105: | ||
}} | }} | ||
{{Note | |||
|user= AgentRev | |||
|timestamp= 20140624004300 | |||
|text= Message boxes can be force-closed with: | |||
<sqf>uiNamespace setVariable ["BIS_fnc_guiMessage_status", false];</sqf> | |||
}} | |||
Message boxes can be force-closed with: | |||
< | |||
< | {{Note | ||
|user= Eden | |||
|timestamp= 20160113151600 | |||
|text= 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: | |||
<sqf> | |||
[] spawn | |||
{ | { | ||
private _result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage; | |||
// Use _result here | |||
};</ | }; | ||
</sqf> | |||
}} | |||
{{Note | |||
|user= Demellion | |||
|timestamp= 20171101183500 | |||
|text= 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]]. | |||
}} | |||
Revision as of 21:29, 18 April 2022
Take On Helicopters
Arma 3
Description
Syntax
- Syntax:
- [message, header, position, isCancel, parent, pause] spawn BIS_fnc_guiMessage
- Parameters:
- message: String, Structured Text or Array:
- String or Structured Text - message
- Array - listbox, every item is defined as String (enabled) or String in Array (disabled)
- 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] Returned only after message box is closed.
Examples
- Example 1:
- Example 2:
- Example 3:
Additional Information
- See also:
- hintC BIS_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
Description
- Description:
-
Displays an interactive message dialog in the center of the screen.
- Execution:
- call
- Groups:
- GUI
Syntax
- Syntax:
- [message, header, okButton, cancelButton, parent, useParentBox, pause] call BIS_fnc_guiMessage
- Parameters:
- message: String or Structured Text - (Optional, default: "") message
- header: String - (Optional, default: "") header text
- okButton Boolean or String - (Optional, default true):
- cancelButton: Boolean or String - (Optional, default false):
- parent: Display - (Optional, default:
[] call BIS_fnc_displayMission
) 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 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.
- 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 Jun 24, 2014 - 00:43 (UTC)
-
Message boxes can be force-closed with:
- Posted on Jan 13, 2016 - 15:16 (UTC)
- 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:
- Posted on Nov 01, 2017 - 18:35 (UTC)
- 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.