2019-03-17 16:48:44 +00:00
|
|
|
#include "script_component.hpp"
|
2016-10-05 22:54:57 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Report awake animation of unit inside vehicle.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The unit <OBJECT>
|
|
|
|
*
|
|
|
|
* ReturnValue:
|
|
|
|
* The animtaion <STRING>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* player call ace_common_fnc_getAwakeAnim
|
|
|
|
*
|
|
|
|
* Public: no
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_unit"];
|
|
|
|
|
|
|
|
private _vehicle = vehicle _unit;
|
|
|
|
|
|
|
|
// --- on foot
|
|
|
|
if (_vehicle isEqualTo _unit) exitWith {""};
|
|
|
|
|
|
|
|
// --- driver
|
2021-02-18 18:58:08 +00:00
|
|
|
private _config = configOf _vehicle;
|
2016-10-05 22:54:57 +00:00
|
|
|
|
|
|
|
if (_unit == driver _vehicle) exitWith {
|
|
|
|
getText (configFile >> "CfgMovesBasic" >> "ManActions" >> getText (_config >> "driverAction")) // return
|
|
|
|
};
|
|
|
|
|
|
|
|
// --- turret
|
|
|
|
private _turret = _unit call CBA_fnc_turretPath;
|
|
|
|
|
2021-02-27 17:05:05 +00:00
|
|
|
if (_turret isNotEqualTo []) exitWith {
|
2016-10-05 22:54:57 +00:00
|
|
|
private _turretConfig = [_vehicle, _turret] call CBA_fnc_getTurret;
|
|
|
|
|
|
|
|
getText (configFile >> "CfgMovesBasic" >> "ManActions" >> getText (_turretConfig >> "gunnerAction")) // return
|
|
|
|
};
|
|
|
|
|
|
|
|
// --- cargo
|
|
|
|
private _cargoIndex = _vehicle getCargoIndex _unit;
|
|
|
|
|
|
|
|
if (_cargoIndex != -1) exitWith {
|
2021-09-13 21:33:56 +00:00
|
|
|
private _cargoAction = getArray (_config >> "cargoAction");
|
|
|
|
_cargoIndex = _cargoIndex min (count _cargoAction - 1); // The array can be smaller than the max cargo index, just use last element
|
|
|
|
getText (configFile >> "CfgMovesBasic" >> "ManActions" >> (_cargoAction select _cargoIndex)) // return
|
2016-10-05 22:54:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// --- default
|
|
|
|
""
|