mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
31 lines
683 B
Plaintext
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]
|