ACE3/addons/common/functions/fnc_getConfigName.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
722 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: johnb43
* Returns an item's config case sensitive name.
*
* Arguments:
* 0: Class name (item or object) <STRING>
*
* Return Value:
* Config case item name ("" if config is not found) <STRING>
*
* Example:
* ["arifle_AK12_F"] call ace_common_fnc_getConfigName
*
* Public: Yes
*/
params ["_className"];
(uiNamespace getVariable QGVAR(configNames)) getOrDefaultCall [toLower _className, {
private _config = configNull;
{
_config = configFile >> _x >> _className;
if (isClass _config) exitWith {};
} forEach ["CfgWeapons", "CfgMagazines", "CfgGlasses", "CfgVehicles", "CfgVoice", "CfgUnitInsignia"];
configName _config
}, true]