ACE3/addons/common/functions/fnc_getAddon.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

31 lines
683 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: johnb43
* Returns a config's addon.
*
* Arguments:
* 0: Config entry <CONFIG>
*
* Return Value:
* Addon name <STRING>
*
* Example:
* [configFile >> "CfgWeapons" >> "arifle_AK12_F"] call ace_common_fnc_getAddon
*
* Public: Yes
*/
params ["_config"];
(uiNamespace getVariable QGVAR(addonCache)) getOrDefaultCall [_config, {
private _addons = configSourceAddonList _config;
// Return first addon
if (_addons isNotEqualTo []) then {
(configSourceModList (configfile >> "CfgPatches" >> _addons select 0)) param [0, ""]
} else {
// If nothing found at all, return ""
""
}
}, true]