Interaction - Add distance to interaction anims (#10233)

This commit is contained in:
johnb432 2024-08-21 00:27:28 +02:00 committed by GitHub
parent 52c19d53af
commit ffba612011
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 7 deletions

View File

@ -420,15 +420,11 @@ class CfgVehicles {
class GVAR(anims) {
class showBags {
phase = 0;
// Rotate interactions with turret rotation
positions[] = {
"[0, -1.6, 0] vectorAdd ([[1, -1, 0.1], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)",
"[0, -1.6, 0] vectorAdd ([[-1, -1, 0.1], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"
};
selections[] = {"vhc_bags"};
items[] = {"B_Carryall_cbr", "B_Carryall_cbr"};
name = "$STR_a3_cfgvehicleclasses_backpacks0";
text = "$STR_a3_cfgvehicleclasses_backpacks0";
distance = 3;
};
};
};

View File

@ -180,13 +180,19 @@ private _config = configOf _object;
private _icon = [_animConfig >> "icon", "TEXT", "\A3\ui_f\data\igui\cfg\actions\take_ca.paa"] call CBA_fnc_getConfigEntry;
private _duration = [_animConfig >> "duration", "NUMBER", 10] call CBA_fnc_getConfigEntry;
private _text = getText (_animConfig >> "text");
private _distance = [_animConfig >> "distance", "NUMBER", 2] call CBA_fnc_getConfigEntry;
{
private _action = [
format [QGVAR(anim_%1_%2), _anim, _forEachIndex],
_name, _icon, _statement, _condition, {},
_name,
_icon,
_statement,
_condition,
{},
[_anim, _phase, _duration, _text],
_x
_x,
_distance
] call EFUNC(interact_menu,createAction);
[_class, 0, [], _action] call EFUNC(interact_menu,addActionToClass);
TRACE_3("add anim",_class,_anim,_x);