BIS fnc guiMessage: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Merge TKOH and Arma 3 BIS_fnc_guimessage) |
(Upgraded page to level 2 (and fixed some errors and clarified some things here and there!)) |
||
Line 54: | Line 54: | ||
|game1= arma3 | |game1= arma3 | ||
|version1= 1.00 | |version1= 1.00 | ||
|eff= local | |||
|gr1= GUI | |gr1= GUI | ||
|descr= [[File:BIS fnc guiMessage.jpg|thumb|right| | |descr= [[File:BIS fnc guiMessage.jpg|thumb|right|[[BIS_fnc_guiMessage]] message dialog in {{arma3}}]] Displays an interactive message dialog in the center of the screen. | ||
|exec= call | |||
|s1= [message, header, okButton, cancelButton, parent, useParentBox, pause | |s1= [message, header, okButton, cancelButton, parent, useParentBox, pause] call [[BIS_fnc_guiMessage]] | ||
|p1= message: [[String]] or [[Structured Text]] - | |p1= message (Optional, default: ""): [[String]] or [[Structured Text]] - Message | ||
|p2= header: [[String]] - | |p2= header (Optional): [[String]] - Header text | ||
|p3= okButton | |p3= okButton (Optional, default: [[true]]): | ||
* [[Boolean]] - Enable "OK" button | * [[Boolean]] - Enable the "OK" button | ||
* [[String]] - Custom text for "OK" button | * [[String]] - Custom text for the "OK" button | ||
|p4= cancelButton | |p4= cancelButton (Optional, default: [[false]]): | ||
* [[Boolean]] - Enable "Cancel" button | * [[Boolean]] - Enable the "Cancel" button | ||
* [[String]] - Custom text for "Cancel" button | * [[String]] - Custom text for the "Cancel" button | ||
|p5= parent | |p5= parent (Optional, default: [[displayNull]]): [[Display]] - Parent display | ||
|p6= useParentBox | |p6= useParentBox (Optional, default: [[false]]): [[Boolean]] - Try to use control inherited from "RscMessageBox" in parent instead of creating a new one | ||
|p7= pause | |p7= pause (Optional, default: [[true]]): [[Boolean]] - Pause simulation while message dialog is open (no effect in multiplayer) | ||
|r1= [[Boolean]] - [[true|True]] if "OK" button was pressed, otherwise false. Returned only after message box is closed. | |r1= [[Boolean]] - [[true|True]] if the "OK" button was pressed, otherwise [[false]]. Returned only after message box is closed. | ||
|x1= <code>["Hello World"] [[spawn]] [[BIS_fnc_guiMessage]];</code> | |x1= Because this example uses [[spawn]], the return value of [[BIS_fnc_guiMessage]] is lost and can not be used. | ||
<code>["Hello World"] [[spawn]] [[BIS_fnc_guiMessage]];</code> | |||
|x2= <code>_result = ["Are you sure?", "Confirm", [[true]], [[true]]] [[ | |x2= <code>[[private]] _result = ["Are you sure?", "Confirm", [[true]], [[true]]] [[call]] [[BIS_fnc_guiMessage]]; | ||
[[if]] (_result) [[then]] { | |||
[[systemChat]] "Player is sure."; | |||
} [[else]] { | |||
[[systemChat]] "Player is not sure."; | |||
};</code> | |||
| | |seealso= [[BIS_fnc_GUIhint]] [[BIS_fnc_3DENShowMessage]] [[hintC]] | ||
}} | }} | ||
}} | }} |
Revision as of 12:04, 19 May 2021
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:
["Hello World"] spawn BIS_fnc_guiMessage;
- Example 2:
-
["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
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 (Optional, default: ""): String or Structured Text - Message
- header (Optional): String - Header text
- okButton (Optional, default: true):
- cancelButton (Optional, default: false):
- parent (Optional, default: displayNull): 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 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 "Player is sure."; } else { systemChat "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.