ACE3/addons/common/functions/fnc_moduleLSDVehicles.sqf

63 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
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 19:46:21 +00:00
2015-09-18 23:12:03 +00:00
if (isNil QGVAR(LSD_index)) then {
GVAR(LSD_index) = 0;
};
2015-09-18 19:46:21 +00:00
2015-09-18 23:12:03 +00:00
GVAR(LSD_ColorsCount) = count GVAR(LSD_Colors);
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;
2015-09-18 23:12:03 +00:00
if (isNil QGVAR(LSD_PFH)) then {
GVAR(LSD_PFH) = [{
{
params ["_vehicle", "_hSCount"];
for "_i" from 0 to (_hSCount - 1) do {
_vehicle setObjectTexture [_i, _colors select GVAR(LSD_index)];
};
nil
} count GVAR(LSD_Vehicles);
GVAR(LSD_index) = ((GVAR(LSD_index) + 1) % 7) mod GVAR(LSD_ColorsCount);
}, 0.02, []] call CBA_fnc_addPerFrameHandler;
};
ACE_LOGINFO("WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEED.");