Skip to content

Commit cd7a404

Browse files
committed
add knobs to scriptedInteract
1 parent eb885c6 commit cd7a404

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

addons/interaction/functions/fnc_knobAnimate.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
params ["_vehicle", "_animDirection", "_knobConfig"];
1010
_knobConfig params KNOBPARAMS;
11-
diag_log format ["%2: knob animate %1", _name, time];
11+
diag_log format ["%2: knob animate %1", _animation, time];
1212

1313
if (isNil{_vehicle getVariable "hct_interaction"}) exitWith {false};
1414
if (!isNil "hct_interaction_knobHolding" && hct_interaction_knobHolding # 0 != _animation) exitWith {false};

addons/interaction/functions/fnc_scriptedInteract.sqf

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "script_component.hpp"
12
/*
23
* hct_interaction_fnc_scriptedInteract
34
*
@@ -20,9 +21,15 @@ if (isNil "_animationTargetLabel") exitWith {
2021
};
2122

2223
_interactionConfig params ["_name","_condition","_subItems",["_positionType", nil],["_position", nil],["_label", nil],["_radius", nil],["_clickSound",""],["_interactCondition",{true}],["_buttonConfig", nil], ["_animConfig", nil], ["_knobConfig", nil]];
23-
_animConfig params ["_animation", "_animationSpeed", "_animLooping", "_animationSteps", "_animationLabels", "_animStart", "_animEnd"];
24+
hct_interaction_currentButton = _interactionConfig;
2425

25-
private _stepIndex = _animationLabels find _animationTargetLabel;
26-
if (_stepIndex == -1) exitWith {};
27-
private _targetAnimStep = _animationSteps # _stepIndex;
28-
[_vehicle, _animation, _targetAnimStep, _animationTargetLabel, _animationSpeed, _animStart, _animEnd, _interactionConfig] call hct_interaction_fnc_leverAnimate;
26+
if (_animConfig isNotEqualTo []) exitWith {
27+
_animConfig params ["_animation", "_animationSpeed", "_animLooping", "_animationSteps", "_animationLabels", "_animStart", "_animEnd"];
28+
29+
private _stepIndex = _animationLabels find _animationTargetLabel;
30+
if (_stepIndex == -1) exitWith {};
31+
private _targetAnimStep = _animationSteps # _stepIndex;
32+
[_vehicle, _animation, _targetAnimStep, _animationTargetLabel, _animationSpeed, _animStart, _animEnd, _interactionConfig] call hct_interaction_fnc_leverAnimate;
33+
};
34+
35+
[_vehicle, _animationTargetLabel, _knobConfig] call hct_interaction_fnc_knobAnimate;

addons/main/script_version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#define MAJOR 0
22
#define MINOR 3
33
#define PATCH 2
4-
#define BUILD 1
4+
#define BUILD 2

0 commit comments

Comments
 (0)