ACE3/addons/common/functions/fnc_moduleLSDVehicles.sqf

60 lines
1.5 KiB
Plaintext
Raw Normal View History

/*
2015-09-18 23:12:03 +00:00
* Author: KoffeinFlummi, joko // Jonas
* Nothing to see here, move along.
*
* Arguments:
* Whatever the module provides. (I dunno.)
*
* Return Value:
* None
2015-09-18 19:46:21 +00:00
*
* Public: No
*/
2015-01-13 19:56:02 +00:00
#include "script_component.hpp"
2015-09-18 23:12:03 +00:00
params ["", "_units", "_activated"];
2015-05-14 22:12:40 +00:00
if !(_activated) exitWith {};
2015-09-18 23:12:03 +00:00
if (isNil QGVAR(LSD_Vehicles)) then {
GVAR(LSD_Vehicles) = [];
};
2015-09-18 19:46:21 +00:00
2015-09-18 23:12:03 +00:00
{
_hSCount = count (getArray (configFile >> "CfgVehicles" >> typeOf _x >> "hiddenSelections"));
if (_hSCount > 0) then {
GVAR(LSD_Vehicles) pushBack [_x, _hSCount];
};
2015-09-18 23:12:03 +00:00
nil
} count _units;
if (isNil QGVAR(LSD_Colors)) then {
GVAR(LSD_Colors) = [
"#(argb,8,8,3)color(1,0,0,1,co)",
"#(argb,8,8,3)color(1,0.5,0,1,co)",
"#(argb,8,8,3)color(1,1,0,1,co)",
"#(argb,8,8,3)color(0,1,0,1,co)",
"#(argb,8,8,3)color(0,0,1,1,co)",
"#(argb,8,8,3)color(0.2,0,0.5,1,co)",
"#(argb,8,8,3)color(0.5,0,1,1,co)"
];
};
2015-09-18 23:12:03 +00:00
if (isNil QGVAR(LSD_PFH)) then {
GVAR(LSD_PFH) = [{
(_this select 0) params ["_index"];
2015-09-18 23:12:03 +00:00
{
2015-09-19 00:44:02 +00:00
_x params ["_vehicle", "_hSCount"];
2015-09-18 23:12:03 +00:00
for "_i" from 0 to (_hSCount - 1) do {
_vehicle setObjectTexture [_i, GVAR(LSD_Colors) select _index];
2015-09-18 23:12:03 +00:00
};
nil
} count GVAR(LSD_Vehicles);
_index = ((_index + 1) % 7) mod count GVAR(LSD_Colors);
(_this select 0) set [0, _index];
}, 0.02, [0]] call CBA_fnc_addPerFrameHandler;
2015-09-18 23:12:03 +00:00
};
ACE_LOGINFO("WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEED.");