BIS fnc GUImessage: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Changed the formatting to better match with the rest of the wiki and added function information) |
||
Line 8: | Line 8: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | Creates a fully dynamic GUI message box in the center of the player's screen. |= Description | ||
____________________________________________________________________________________________ | |||
| [body, header, OKbutton, Cancelbutton, display, inheritClass, pauseGame] call '''BIS_fnc_GUImessage''' |= Syntax | |||
|p1= [''body'', ''header'', ''OKbutton'', ''Cancelbutton'', ''display'', ''inheritClass'', ''pauseGame'']: [[Array]] |= PARAMETER1 | |||
|p2= body: [[String]] or [[Structured_Text|Structured Text]] (optional) - Default: "". |= PARAMETER2 | |||
|p3= header: [[String]] (optional) - Default: "". |= PARAMETER3 | |||
|p4= OKbutton: [[Boolean]] or [[String]] (optional) - True/False to enable/disable button with default string of "OK", or enable the button with the input string. Default: true. |= PARAMETER4 | |||
|p5= Cancelbutton: [[Boolean]] or [[String]] (optional) - True/False to enable/disable button with default string of "CANCEL", or enable the button with the input string. Default: false. |= PARAMETER5 | |||
|p6= display: [[Display]] (optional) - Default: Main display of current mission/intro/outro. |= PARAMETER6 | |||
| | |p7= inheritClass: [[Boolean]] (optional) - True to use "RscMessageBox" class from the current display, false to use BIS-created "RscMessageBox" class. Default: false. |= PARAMETER7 | ||
| | |p8= pauseGame: [[Boolean]] (optional) - Default: true. |= PARAMETER8 | ||
| |= | | [[Boolean]] - true if "OK" button was activated, false if "Cancel" was activated or user pressed "Escape" key. |= RETURNVALUE | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code></code> |= | |x1= <code>["Example Body", "Example Header", [[true]], [[true]], [[findDisplay]] 46, [[false]], [[true]]] [[call]] [[BIS_fnc_GUImessage]];</code> |= | ||
|x2= <code>[<nowiki></nowiki>[[composeText]] ["Example", [[lineBreak]], "Body"], "Example Header", [[true]], [[true]], [[findDisplay]] 46, [[false]], [[true]]] [[call]] [[BIS_fnc_GUImessage]];</code> |= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 72: | Line 66: | ||
[[if]] (_forEachIndex < (([[count]] [[playableUnits]]) - 1)) [[then]] | [[if]] (_forEachIndex < (([[count]] [[playableUnits]]) - 1)) [[then]] | ||
{ | { | ||
_allPlayers = [[format]] ["%1, | _allPlayers = [[format]] ["%1,lineBreak,", _allPlayers]; | ||
}; | }; | ||
}; | }; |
Revision as of 05:29, 24 December 2014
Description
- Description:
- Creates a fully dynamic GUI message box in the center of the player's screen.
- Execution:
- call
- Groups:
- Uncategorised
Syntax
- Syntax:
- [body, header, OKbutton, Cancelbutton, display, inheritClass, pauseGame] call BIS_fnc_GUImessage
- Parameters:
- [body, header, OKbutton, Cancelbutton, display, inheritClass, pauseGame]: Array
- body: String or Structured Text (optional) - Default: "".
- header: String (optional) - Default: "".
- OKbutton: Boolean or String (optional) - True/False to enable/disable button with default string of "OK", or enable the button with the input string. Default: true.
- Cancelbutton: Boolean or String (optional) - True/False to enable/disable button with default string of "CANCEL", or enable the button with the input string. Default: false.
- display: Display (optional) - Default: Main display of current mission/intro/outro.
- inheritClass: Boolean (optional) - True to use "RscMessageBox" class from the current display, false to use BIS-created "RscMessageBox" class. Default: false.
- pauseGame: Boolean (optional) - Default: true.
- Return Value:
- Boolean - true if "OK" button was activated, false if "Cancel" was activated or user pressed "Escape" key.
Examples
- Example 1:
["Example Body", "Example Header", true, true, findDisplay 46, false, true] call BIS_fnc_GUImessage;
- Example 2:
[composeText ["Example", lineBreak, "Body"], "Example Header", true, true, findDisplay 46, false, true] call BIS_fnc_GUImessage;
Additional Information
- See also:
- 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
Notes
Bottom Section
- Posted on December 24, 2014 - 03:52 (UTC)
- DreadedEntity
-
Some code that should produce a "Mission Credits" GUI (tested with a sample array, not actual MP). Lists all connected players.
_allPlayers = "composeText ["; { if (isPlayer _x) then { _allPlayers = format ["%1'%2'", _allPlayers, name _x]; if (_forEachIndex < ((count playableUnits) - 1)) then { _allPlayers = format ["%1,lineBreak,", _allPlayers]; }; }; }forEach playableUnits; _allPlayers = format ["%1];", _allPlayers]; _structuredText = call compile _allPlayers; [_structuredText, "Mission Credits", "THANK YOU", "THANK YOU", findDisplay 46, false, true] spawn BIS_fnc_GUImessage;