Skip to content

Commit

Permalink
Re-implement turning work-knob in steps
Browse files Browse the repository at this point in the history
  • Loading branch information
mrschick committed Sep 10, 2023
1 parent 9cd507b commit 7ac6650
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions addons/sys_rack/fnc_rackChildrenActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,18 @@ if (_mountedRadio == "") then { // Empty
_direction = 1;
};

// After a delay, turn the work knob N times towards the desired position
// After a delay, turn the work knob N times towards the desired position in 0.2s intervals
[{
params ["_direction", "_curWorkPos", "_newWorkPos"];
private _i = 0;
private _delay = 0;
while {_i < abs (_curWorkPos - _newWorkPos)} do {
[0, _direction] call EFUNC(sys_intercom,vic3ffcsOnWorkKnobPress);
[{
params ["_direction"];
[0, _direction] call EFUNC(sys_intercom,vic3ffcsOnWorkKnobPress);
}, [_direction], _delay] call CBA_fnc_waitAndExecute;
_i = _i + 1;
_delay = _delay + 0.2;
};
}, [_direction, _curWorkPos, _newWorkPos], 0.5] call CBA_fnc_waitAndExecute;
},
Expand Down

0 comments on commit 7ac6650

Please sign in to comment.