ACE3/addons/cargo/functions/fnc_renameObject.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

29 lines
720 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: JasperRab
* Renames object.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_cargo_fnc_renameObject
*
* Public: Yes
*/
private _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isNil "_display") exitWith {};
private _ctrlEditText = ctrlText 100;
_ctrlEditText = _ctrlEditText select [0,32];
if (_ctrlEditText isEqualTo "") then { // custom name has been removed
[LSTRING(clearedCustomName), 3] call EFUNC(common,displayTextStructured);
} else {
[[LSTRING(renamedObject), _ctrlEditText], 3] call EFUNC(common,displayTextStructured);
};
GVAR(interactionVehicle) setVariable [QGVAR(customName), _ctrlEditText, true];