Merge pull request #2047 from MikeMatrix/codeCleanupTacticalladder

Code cleanup in Tacticalladder module
This commit is contained in:
Glowbal 2015-08-08 10:57:13 +02:00
commit 02bffce4c4
6 changed files with 24 additions and 24 deletions

View File

@ -9,7 +9,7 @@
* None
*
* Example:
* [_ladder] call ace_tacticalladder_fnc_cancelTLdeploy;
* [_ladder] call ace_tacticalladder_fnc_cancelTLdeploy
*
* Public: No
*/
@ -17,16 +17,16 @@
#define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"]
PARAMS_1(_ladder);
params ["_ladder"];
detach _ladder;
_ladder animate ["rotate", 0];
{
_ladder animate [_x, 0];
} forEach __ANIMS;
} count __ANIMS;
call EFUNC(interaction,hideMouseHint);
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
GVAR(ladder) = objNull;

View File

@ -6,16 +6,16 @@
* 0: ladder <OBJECT>
*
* Return Value:
* Success?
* Success <BOOL>
*
* Example:
* [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy;
* [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_ladder);
params ["_ladder"];
private ["_pos1", "_pos2"];
_pos1 = getPosASL GVAR(ladder);
@ -23,8 +23,8 @@ _pos2 = (GVAR(ladder) modelToWorld (GVAR(ladder) selectionPosition "check2")) ca
if (lineIntersects [_pos1, _pos2, GVAR(ladder)]) exitWith { false };
call EFUNC(interaction,hideMouseHint);
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
detach _ladder;
GVAR(ladder) = objNull;

View File

@ -3,13 +3,13 @@
* Deploy tactical ladder
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* call ace_tacticalladder_fnc_deployTL;
* [] call ace_tacticalladder_fnc_deployTL
*
* Public: No
*/

View File

@ -9,13 +9,13 @@
* Handled <BOOL>
*
* Example:
* 1 call ace_tacticalladder_fnc_handleScrollWheel;
* [1] call ace_tacticalladder_fnc_handleScrollWheel;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_scroll);
params ["_scroll"];
if (isNull GVAR(ladder)) exitWith { false };
@ -37,7 +37,7 @@ if (GETMVAR(ACE_Modifier,0) == 0) then {
if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 1) then {
GVAR(ladder) animate [format["extract_%1", _currentStep], 0];
GVAR(currentStep) = _currentStep - 1;
};
};
};
} else {
// Tilting
@ -45,4 +45,4 @@ if (GETMVAR(ACE_Modifier,0) == 0) then {
GVAR(ladder) animate ["rotate", GVAR(currentAngle)];
};
true
true

View File

@ -7,10 +7,10 @@
* 1: unit <OBJECT>
*
* Return Value:
* Success?
* Success <BOOL>
*
* Example:
* [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL;
* [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL
*
* Public: No
*/
@ -18,7 +18,7 @@
if ((backpack ACE_player) != "") exitWith { false };
PARAMS_2(_ladder,_unit);
params ["_ladder", "_unit"];
deleteVehicle _ladder;
_unit addBackpack "ACE_TacticalLadder_Pack";

View File

@ -10,7 +10,7 @@
* None
*
* Example:
* [_ladder, _unit] call ace_tacticalladder_fnc_positionTL;
* [_ladder, _unit] call ace_tacticalladder_fnc_positionTL
*
* Public: No
*/
@ -18,11 +18,11 @@
#define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"]
PARAMS_2(_ladder,_unit);
params ["_ladder", "_unit"];
{
_ladder animate [_x, 0];
} forEach __ANIMS;
} count __ANIMS;
_unit switchMove "amovpercmstpslowwrfldnon_player_idlesteady03";
_ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of player
@ -30,7 +30,7 @@ _ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of playe
_ladder animate ["rotate", 0];
{
_ladder animate [_x, 1];
} forEach ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3)
} count ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3)
GVAR(ladder) = _ladder;
GVAR(cancelTime) = ACE_time + 1; // Workaround to prevent accidental canceling