2015-08-11 17:49:39 +00:00
|
|
|
/*
|
|
|
|
* Author: voiper
|
|
|
|
* Add or remove global flashlight glow for when player is looking at map.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Flashlight classname ("" for off) <STRING>
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* ["ACE_Flashlight_MX991"] call ace_map_fnc_flashlightGlow;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
params ["_flashlight"];
|
|
|
|
|
|
|
|
_light = GVAR(glow);
|
|
|
|
if (!isNull _light) then {deleteVehicle _light};
|
|
|
|
|
|
|
|
if (_flashlight != "") then {
|
|
|
|
_colour = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour");
|
|
|
|
|
2015-08-24 20:59:35 +00:00
|
|
|
_class = switch (toLower _colour) do {
|
2015-08-11 17:49:39 +00:00
|
|
|
case "white": {"ACE_FlashlightProxy_White"};
|
|
|
|
case "red": {"ACE_FlashlightProxy_Red"};
|
|
|
|
case "green": {"ACE_FlashlightProxy_Green"};
|
|
|
|
case "blue": {"ACE_FlashlightProxy_Blue"};
|
|
|
|
case "yellow": {"ACE_FlashlightProxy_Yellow"};
|
2015-08-24 20:59:35 +00:00
|
|
|
default {"ACE_FlashlightProxy_White"};
|
2015-08-11 17:49:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
_light = _class createVehicle [0,0,0];
|
|
|
|
_light attachTo [ACE_player, [0,0.5,-0.1], "head"];
|
|
|
|
} else {
|
|
|
|
_light = objNull;
|
|
|
|
};
|
|
|
|
|
|
|
|
GVAR(glow) = _light;
|