---
name: "BIS_fnc_configViewer"
type: function
status: ok
groups: ["Diagnostic"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_configViewer
revid: 348118
updated: 2023-11-08T11:32:17Z
---

# BIS_fnc_configViewer

*Function · Diagnostic · Arma 3 v0.50 · introduced in Arma 2: Operation Arrowhead v1.50*

## Description

Opens the Splendid™ Config Viewer.

## Syntax

```sqf
[parent, cfg, showOk, onSelect, onAdd, header] call BIS_fnc_configViewer
```

**Parameters:**

- `parent`: [Display](../topics/Display.md) - (Optional, default mission display) parent display
- `cfg`: [Config](../topics/Config.md) - (Optional, default all configs) root config
- `showOk`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) [true](../commands/true.md) to display OK button. Script will then wait until viewer is closed and return selected class and param
- `onSelect`: [Code](../topics/Code.md) - (Optional, default {}) executed upon selecting a class. **Must return [String](../topics/String.md)**, which will be shown as structured text instead of params. Currently evaluated config is passed in the `_this` variable.
- `onAdd`: [Code](../topics/Code.md) - (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 `_this` variable.
- `header`: [String](../topics/String.md) - (Optional, default "%1") custom header. Use %1 to refer to original name ("Splendid Config Viewer")

**Returns:** [Array](../topics/Array.md)
- When OK button is not displayed, empty array is returned
- Else, an array of currently selected entries in format [class ([Config](../topics/Config.md)), param ([String](../topics/String.md))] is returned.

## Examples

### Example 1

```sqf
call BIS_fnc_configViewer;
```

### Example 2

```sqf
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];
```

## See also

[BIS_fnc_animViewer](../functions/BIS_fnc_animViewer.md) · [BIS_fnc_help](../functions/BIS_fnc_help.md)

<sub>Source: [BI Community Wiki — BIS fnc configViewer](https://community.bistudio.com/wiki/BIS_fnc_configViewer) (revision 348118).</sub>
