2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-05-09 02:47:15 +00:00
|
|
|
/*
|
2017-06-02 21:50:53 +00:00
|
|
|
* Author: commy2, Phyma
|
|
|
|
* Get door animations.
|
2015-05-09 02:47:15 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: House <OBJECT>
|
|
|
|
* 1: Door <STRING>
|
|
|
|
*
|
2015-09-28 15:11:53 +00:00
|
|
|
* Return Value:
|
2015-05-09 02:47:15 +00:00
|
|
|
* Animation and Locked variable <ARRAY>
|
|
|
|
* 0: Animation <STRING>
|
|
|
|
* 1: Locked variable <STRING>
|
|
|
|
*
|
|
|
|
* Example:
|
2015-05-14 17:53:18 +00:00
|
|
|
* array = [target, "door"] call ace_interaction_fnc_getDoorAnimations
|
2015-05-09 02:47:15 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-09-28 15:11:53 +00:00
|
|
|
params ["_house", "_door"];
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2017-06-02 21:50:53 +00:00
|
|
|
private _animate = animationNames _house;
|
|
|
|
private _animations = [];
|
|
|
|
private _lockedVariable = [];
|
2020-11-02 18:22:53 +00:00
|
|
|
private _numberStrings = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
2017-06-02 21:50:53 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
private _animName = toLower _x;
|
2020-11-02 18:22:53 +00:00
|
|
|
private _index = _animName find toLower _door;
|
|
|
|
|
|
|
|
if (_index != -1 && {!(_animName select [_index + count _door, 1] in _numberStrings)}) then {
|
2017-06-02 21:50:53 +00:00
|
|
|
if (((_animName find "disabled") != -1) || ((_animName find "locked") != -1)) then {
|
|
|
|
_lockedVariable pushBack _animName;
|
|
|
|
} else {
|
|
|
|
_animations pushBack _animName;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} forEach _animate;
|
2015-01-11 19:32:51 +00:00
|
|
|
|
|
|
|
[_animations, _lockedVariable]
|