2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-03-14 12:51:23 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
2023-07-23 23:07:37 +00:00
|
|
|
* Initializes variables for draggable / carryable objects. Called from init EH.
|
2015-03-14 12:51:23 +00:00
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2023-07-23 23:07:37 +00:00
|
|
|
* 0: Object <OBJECT>
|
2015-03-14 12:51:23 +00:00
|
|
|
*
|
2015-08-09 12:53:13 +00:00
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2016-01-28 18:52:53 +00:00
|
|
|
* Example:
|
2023-07-23 23:07:37 +00:00
|
|
|
* [cursorTarget] call ace_dragging_fnc_initObject;
|
2016-01-28 18:52:53 +00:00
|
|
|
*
|
2015-08-09 12:53:13 +00:00
|
|
|
* Public: No
|
2015-03-14 12:51:23 +00:00
|
|
|
*/
|
|
|
|
|
2015-08-09 12:53:13 +00:00
|
|
|
params ["_object"];
|
2015-03-14 12:51:23 +00:00
|
|
|
|
2021-02-18 18:58:08 +00:00
|
|
|
private _config = configOf _object;
|
2015-03-17 14:42:25 +00:00
|
|
|
|
|
|
|
if (getNumber (_config >> QGVAR(canDrag)) == 1) then {
|
2021-07-23 14:11:57 +00:00
|
|
|
private _position = [_config >> QGVAR(dragPosition), "ARRAY", [0, 1.5, 0]] call CBA_fnc_getConfigEntry;
|
2016-01-28 18:52:53 +00:00
|
|
|
private _direction = getNumber (_config >> QGVAR(dragDirection));
|
2023-09-12 22:57:55 +00:00
|
|
|
private _ignoreWeight = getNumber (_config >> QGVAR(ignoreWeight));
|
2015-03-14 12:51:23 +00:00
|
|
|
|
2023-09-12 22:57:55 +00:00
|
|
|
[_object, true, _position, _direction, _ignoreWeight > 0] call FUNC(setDraggable);
|
2015-03-14 12:51:23 +00:00
|
|
|
};
|
2015-03-17 14:42:25 +00:00
|
|
|
|
2015-08-26 07:10:29 +00:00
|
|
|
if (getNumber (_config >> QGVAR(canCarry)) == 1) then {
|
2021-07-23 14:11:57 +00:00
|
|
|
private _position = [_config >> QGVAR(carryPosition), "ARRAY", [0, 1, 1]] call CBA_fnc_getConfigEntry;
|
2016-01-28 18:52:53 +00:00
|
|
|
private _direction = getNumber (_config >> QGVAR(carryDirection));
|
2023-09-12 22:57:55 +00:00
|
|
|
private _ignoreWeight = getNumber (_config >> QGVAR(ignoreWeightCarry));
|
2015-03-17 14:42:25 +00:00
|
|
|
|
2023-09-12 22:57:55 +00:00
|
|
|
[_object, true, _position, _direction, _ignoreWeight > 0] call FUNC(setCarryable);
|
2015-03-17 14:42:25 +00:00
|
|
|
};
|