BIS fnc initDisplay: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_this" to "_this")
m (Text replacement - "{{Inline code|" to "{{ic|")
Line 42: Line 42:
* configFile >> "RscInGameUI"
* configFile >> "RscInGameUI"
* configFile >> "Cfg3DEN" >> "Attributes"
* configFile >> "Cfg3DEN" >> "Attributes"
If both of these attributes are defined (and the attribute "scriptIsInternal" is not defined or 0) then the display function is compiled into the [[uiNamespace]] in the following way: The "scriptPath" attribute points to a config attribute in {{Inline code|configFile >> "CfgScriptPaths"}} which in turn points to a folder in which the {{Inline code|scriptName.sqf}} resides, for example "\a3\ui_f\scripts\GUI\RscDisplayAAR.sqf". The function name of this display's uiNamespace function is therefore {{Inline code|RscDisplayAAR_script}}.
If both of these attributes are defined (and the attribute "scriptIsInternal" is not defined or 0) then the display function is compiled into the [[uiNamespace]] in the following way: The "scriptPath" attribute points to a config attribute in {{ic|configFile >> "CfgScriptPaths"}} which in turn points to a folder in which the {{ic|scriptName.sqf}} resides, for example "\a3\ui_f\scripts\GUI\RscDisplayAAR.sqf". The function name of this display's uiNamespace function is therefore {{ic|RscDisplayAAR_script}}.
<br><br>
<br><br>
When the display is opened or closed:<br>
When the display is opened or closed:<br>
Line 49: Line 49:
* Display is registred:
* Display is registred:
** The config class of the display (eg. RscDisplayAAR) is saved as "BIS_fnc_initDisplay_configClass" to the display
** The config class of the display (eg. RscDisplayAAR) is saved as "BIS_fnc_initDisplay_configClass" to the display
** A list of open UIs ({{Inline code|uiNamespace getVariable ["PATH_displays", []]}}) is updated with the display, where PATH is the afformentioned scriptPath, eg GUI_displays
** A list of open UIs ({{ic|uiNamespace getVariable ["PATH_displays", []]}}) is updated with the display, where PATH is the afformentioned scriptPath, eg GUI_displays
* The display's script (eg. RscDisplayAAR_script) is executed in uiNamespace
* The display's script (eg. RscDisplayAAR_script) is executed in uiNamespace



Revision as of 18:10, 27 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Execution:
call
Groups:
GUI

Syntax

Syntax:
Syntax needed
Parameters:
parameters: Array
  • [ ] (empty array) - init displays during preStart
  • [mode, params, displayClass, scriptPath, register]
    • mode: String - mode, can be "onLoad" or "onUnload"
    • params: Array - params passed from onLoad or onUnload UI event handler
    • displayClass: String - Display class, usually to format "RscDisplayXXX"
    • scriptPath: String - script path from CfgScriptPaths
    • register: Number or Bool - Save variables associated with the display to the uiNamespace. Usually this is false when the function is called from a control.
 
Return Value:
Return value needed

Examples

Example 1:
["onLoad", _this, "RscDisplayAAR", "GUI", true] call (uiNamespace getVariable "BIS_fnc_initDisplay");

Additional Information

See also:
See also needed

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