Description
Opens the Splendid™ Config Viewer.
Syntax
[parent, cfg, showOk, onSelect, onAdd, header] call BIS_fnc_configViewer
Parameters:
parent: Display - (Optional, default mission display) parent displaycfg: Config - (Optional, default all configs) root configshowOk: Boolean - (Optional, default false) true to display OK button. Script will then wait until viewer is closed and return selected class and paramonSelect: Code - (Optional, default {}) executed upon selecting a class. Must return String, which will be shown as structured text instead of params. Currently evaluated config is passed in the_thisvariable.onAdd: Code - (Optional, default {}) executed upon adding a class to list. Returned value (STRING) is item text. Empty string will skip the item. Currently evaluated config is passed in the_thisvariable.header: String - (Optional, default "%1") custom header. Use %1 to refer to original name ("Splendid Config Viewer")
Returns: Array
- When OK button is not displayed, empty array is returned
- Else, an array of currently selected entries in format [class (Config), param (String)] is returned.
Examples
Example 1
call BIS_fnc_configViewer;
Example 2
private _return = [
nil,
configFile >> "CfgWeapons",
true,
nil,
{
params ["_cfg"];
if (
getNumber(_cfg >> "scope") == 2 &&
{ // Layzy evaluation
getNumber(_cfg >> "type") in [1,2,4] && // primary, secondary, handgun weapons
{ !isClass (_cfg >> "LinkedItems") or getText(_cfg >> "baseWeapon") == configName _cfg } // only base weapons, no accessories
}
) exitWith {
[_cfg] call BIS_fnc_displayName; // add the weapon with its displayname
};
"" // don't add
},
"Select Weapon"
] call BIS_fnc_configViewer;
_cfgSelected = _return param [0, configNull];
systemChat str [configName _cfgSelected, _cfgSelected];