BIS fnc guiMessage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(formatting and execution type)
(Merge TKOH and Arma 3 BIS_fnc_guimessage)
Line 1: Line 1:
{{TabView
|selected= 2
|title1= {{Icon|tkoh|24|link=}} {{tkoh}}
|content1=
{{RV|type=function
|game1= TKOH
|version1= 1.00
|gr1= GUI
|descr= Shows customized native message box to user.
|s1= [message, header, position, isCancel, parent, pause] spawn [[BIS_fnc_guiMessage]]
|p1= 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)
When variable '''BIS_fnc_guiMessage_cursel''' is defined as a [[Number]], item with this index will be selected.
|p2= header: [[String]] or [[Structured Text]] - (Optional, default "") header text
|p3= position: [[Array]] - (Optional) position in format [x,y,w,h]
|p4= isCancel: [[Boolean]] or [[Array]] - (Optional, default [[true]]) true to display cancel button or array with button texts [okText, cancelText]
|p5= parent: [[Display]] - (Optional) parent display
|p6= pause: [[Boolean]] - (Optional) true to pause simulation when message window is open
|r1= [[Array]] - [endState, lbId]
* endState: [[Boolean]] - [[true]] when clicked OK button, [[false]] when escaped or clicked on Cancel button
* lbId: [[Number]] - (Optional, returned if listbox was used) selected listbox item
Returned only after message box is closed.
|x1= <code>["Hello World"] [[spawn]] [[BIS_fnc_guiMessage TKOH|BIS_fnc_guiMessage]];</code>
|x2= [[File:TakeOn BIS fnc guiMessage.jpg|right|200px]]
<code>["Message", "Header", [[nil]], [[true]]] [[spawn]] [[BIS_fnc_guiMessage TKOH|BIS_fnc_guiMessage]];</code><div style="clear: both"></div>
|x3= <code>[["Enabled Item", ["Disabled Item"]], "Header"] [[spawn]] [[BIS_fnc_guiMessage TKOH|BIS_fnc_guiMessage]];</code>
|seealso= [[hintC]], [[BIS_fnc_GUIhint]]
|exec= spawn
}}
|title2= {{Icon|arma3|24|link=}} {{arma3}}
|content2=
{{RV|type=function
{{RV|type=function


|game1= arma3
|game1= arma3
|version1= 1.00
|version1= 1.00


Line 8: Line 58:


|descr= [[File:BIS fnc guiMessage.jpg|thumb|right|GUI message in {{arma3}}]] Shows customized native message box to user.
|descr= [[File:BIS fnc guiMessage.jpg|thumb|right|GUI message in {{arma3}}]] Shows customized native message box to user.
{{Feature | Informative | This syntax is for {{arma3}}. For the {{tkoh}} version, see [[BIS_fnc_guiMessage TKOH]].}}


|s1= [message, header, okButton, cancelButton, parent, useParentBox, pause)] spawn [[BIS_fnc_guiMessage]]
|s1= [message, header, okButton, cancelButton, parent, useParentBox, pause)] spawn [[BIS_fnc_guiMessage]]
Line 39: Line 88:


|exec= spawn
|exec= spawn
}}
}}
}}


Line 49: Line 99:
<code>[[uiNamespace]] [[setVariable]] ["BIS_fnc_guiMessage_status", [[false]]];</code>
<code>[[uiNamespace]] [[setVariable]] ["BIS_fnc_guiMessage_status", [[false]]];</code>
</dd>
</dd>
<dt><dt>
<dt><dt>
<dd class="notedate">Posted on January 13, 2016 - 15:16 (UTC)</dd>
<dd class="notedate">Posted on January 13, 2016 - 15:16 (UTC)</dd>
Line 57: Line 108:
<code>[] [[spawn]]
<code>[] [[spawn]]
{
{
  [[private]] _result = ["Are you sure?", "Confirm", [[true]], [[true]]] [[call]] [[BIS_fnc_guiMessage]];
[[private]] _result = ["Are you sure?", "Confirm", [[true]], [[true]]] [[call]] [[BIS_fnc_guiMessage]];
  {{cc|Use _result here}}
{{cc|Use _result here}}
};</code>
};</code>
</dd>
</dd>
<dt><dt>
<dt><dt>
<dd class="notedate">Posted on November 1, 2017 - 18:35 (UTC)</dd>
<dd class="notedate">Posted on November 1, 2017 - 18:35 (UTC)</dd>
Line 67: Line 119:
'''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]].
'''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]].
</dd>
</dd>
</dl>
</dl>

Revision as of 19:19, 18 May 2021

tkoh logo small.png Take On Helicopters
Arma 3 logo black.png Arma 3
Hover & click on the images for description

Description

Description:
Shows customized native message box to user.
Execution:
spawn
Groups:
GUI

Syntax

Syntax:
[message, header, position, isCancel, parent, pause] spawn BIS_fnc_guiMessage
Parameters:
message: String, Structured Text or Array: When variable BIS_fnc_guiMessage_cursel is defined as a Number, item with this index will be selected.
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]
  • endState: Boolean - true when clicked OK button, false when escaped or clicked on Cancel button
  • lbId: Number - (Optional, returned if listbox was used) selected listbox item
Returned only after message box is closed.

Examples

Example 1:
["Hello World"] spawn BIS_fnc_guiMessage;
Example 2:
TakeOn BIS fnc guiMessage.jpg
["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
Hover & click on the images for description

Description

Description:
GUI message in Arma 3
Shows customized native message box to user.
Execution:
spawn
Groups:
GUI

Syntax

Syntax:
[message, header, okButton, cancelButton, parent, useParentBox, pause)] spawn BIS_fnc_guiMessage
Parameters:
message: String or Structured Text - (Optional, default "") Message
header: String - (Optional) Header text
okButton: Boolean or String (Optional, default true)
  • Boolean - Enable "OK" button
  • String - Custom text for "OK" button
cancelButton: Boolean or String - (Optional, default false)
  • Boolean - Enable "Cancel" button
  • String - Custom text for "Cancel" button
parent: Display - (Optional, default displayNull) 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 when message box is open (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:
_result = ["Are you sure?", "Confirm", true, true] spawn BIS_fnc_guiMessage;

Additional Information

See also:
hintCBIS_fnc_GUIhint BIS_fnc_3DENShowMessage

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.