2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-06-12 21:54:51 +00:00
|
|
|
/*
|
|
|
|
* Author: Rocko, Ruthberg
|
|
|
|
* Handles lengthening and tilting of the ladder
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* Amount scrolled <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Handled <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
2015-08-07 06:19:15 +00:00
|
|
|
* [1] call ace_tacticalladder_fnc_handleScrollWheel;
|
2015-06-12 21:54:51 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-07 06:19:15 +00:00
|
|
|
params ["_scroll"];
|
2015-06-12 21:54:51 +00:00
|
|
|
|
|
|
|
if (isNull GVAR(ladder)) exitWith { false };
|
|
|
|
|
2016-03-06 15:54:27 +00:00
|
|
|
if (ACE_Modifier == 0) then {
|
2015-06-12 21:54:51 +00:00
|
|
|
// Lengthening
|
|
|
|
if (_scroll > 0) then {
|
2017-10-10 14:39:59 +00:00
|
|
|
private _currentStep = GVAR(currentStep);
|
2015-06-12 21:54:51 +00:00
|
|
|
if (_currentStep == 11) exitWith {};
|
|
|
|
_currentStep = _currentStep + 1;
|
|
|
|
if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 0) then {
|
|
|
|
GVAR(ladder) animate [format["extract_%1", _currentStep], 1];
|
|
|
|
GVAR(currentStep) = _currentStep;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (_scroll < 0) then {
|
2017-10-10 14:39:59 +00:00
|
|
|
private _currentStep = GVAR(currentStep);
|
2015-06-12 21:54:51 +00:00
|
|
|
if (_currentStep == 3) exitWith {};
|
|
|
|
if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 1) then {
|
|
|
|
GVAR(ladder) animate [format["extract_%1", _currentStep], 0];
|
|
|
|
GVAR(currentStep) = _currentStep - 1;
|
2015-08-07 06:19:15 +00:00
|
|
|
};
|
2015-06-12 21:54:51 +00:00
|
|
|
};
|
2017-10-10 14:39:59 +00:00
|
|
|
};// else {
|
2015-12-27 18:28:29 +00:00
|
|
|
// Tilting (disabled due to sinking, interaction point offset and unsuitable animation)
|
|
|
|
//GVAR(currentAngle) = 0 max (GVAR(currentAngle) + _scroll) min 30;
|
|
|
|
//GVAR(ladder) animate ["rotate", GVAR(currentAngle)];
|
2017-10-10 14:39:59 +00:00
|
|
|
//};
|
2015-06-12 21:54:51 +00:00
|
|
|
|
2015-08-07 06:19:15 +00:00
|
|
|
true
|