mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
d1f0dc5e83
* Update CfgVehicles.hpp * Cargo cleanup * Update menu.hpp * Updated status effect key * Update fnc_onMenuOpen.sqf * Update fnc_onMenuOpen.sqf * fix comment from merge * nil interaction GVARs on menu close * fix carry bug * Fix floating objects in MP * Updated ace_cargoAdded doc * Fix progress bar prematurely stopping * Finer cursor object selection --------- Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
36 lines
906 B
Plaintext
36 lines
906 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: JasperRab
|
|
* Gets the name of the item, and alternatively the custom name if requested and available.
|
|
*
|
|
* Arguments:
|
|
* 0: Item <STRING> or <OBJECT> (default: "")
|
|
* 1: Add custom name <BOOL> (default: false)
|
|
*
|
|
* Return Value:
|
|
* Item name <STRING>
|
|
*
|
|
* Example:
|
|
* cursorObject call ace_cargo_fnc_getNameItem
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params [["_item", "", [objNull, ""]], ["_addCustomName", false, [false]]];
|
|
|
|
private _displayName = if (_item isEqualType "") then {
|
|
getText (configFile >> "CfgVehicles" >> _item >> "displayName")
|
|
} else {
|
|
getText (configOf _item >> "displayName")
|
|
};
|
|
|
|
if (_addCustomName && {_item isEqualType objNull}) then {
|
|
private _customName = _item getVariable [QGVAR(customName), ""];
|
|
|
|
if (_customName isNotEqualTo "") then {
|
|
_displayName = _displayName + " [" + _customName + "]";
|
|
};
|
|
};
|
|
|
|
_displayName
|