mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
81e02a7336
* Everything * Fixed missing ; * Fix missing ; and double private * Fixed cannot isNull on number * Turn _temparture back to isNil * Fix error from merge
48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
/*
|
|
* Author: Rocko, Ruthberg
|
|
* Handles lengthening and tilting of the ladder
|
|
*
|
|
* Arguments:
|
|
* Amount scrolled <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* Handled <BOOL>
|
|
*
|
|
* Example:
|
|
* [1] call ace_tacticalladder_fnc_handleScrollWheel;
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_scroll"];
|
|
|
|
if (isNull GVAR(ladder)) exitWith { false };
|
|
|
|
if (ACE_Modifier == 0) then {
|
|
// Lengthening
|
|
if (_scroll > 0) then {
|
|
private _currentStep = GVAR(currentStep);
|
|
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 {
|
|
private _currentStep = GVAR(currentStep);
|
|
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;
|
|
};
|
|
};
|
|
};// else {
|
|
// 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)];
|
|
//};
|
|
|
|
true
|