Further cleanup. Checked some privates.

This commit is contained in:
voiper 2016-06-15 16:27:46 -07:00
parent 2158d39e8a
commit a20629066a
5 changed files with 16 additions and 9 deletions

View File

@ -5,7 +5,7 @@ class CfgWeapons {
class acc_flashlight: ItemCore { class acc_flashlight: ItemCore {
class ItemInfo: InventoryFlashlightItem_Base_F { class ItemInfo: InventoryFlashlightItem_Base_F {
class Flashlight { class FlashLight {
ACE_Flashlight_Colour = "white"; ACE_Flashlight_Colour = "white";
ACE_Flashlight_Beam = QPATHTOF(UI\Flashlight_beam_white_ca.paa); ACE_Flashlight_Beam = QPATHTOF(UI\Flashlight_beam_white_ca.paa);
ACE_Flashlight_Size = 2.75; ACE_Flashlight_Size = 2.75;

View File

@ -16,19 +16,18 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_light", "_color", "_class"];
params ["_flashlight"]; params ["_flashlight"];
_light = GVAR(glow); private _light = GVAR(glow);
if (!isNull _light) then { if (!isNull _light) then {
detach _light; detach _light;
deleteVehicle _light; deleteVehicle _light;
}; };
if (_flashlight != "") then { if (_flashlight != "") then {
_color = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "Flashlight" >> "ACE_Flashlight_Colour"); private _color = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour");
if !(_color in ["white", "red", "green", "blue", "yellow", "orange"]) then {_color = "white"}; if !(_color in ["white", "red", "green", "blue", "yellow", "orange"]) then {_color = "white"};
_class = format["ACE_FlashlightProxy_%1", _color]; private _class = format["ACE_FlashlightProxy_%1", _color];
_light = _class createVehicle [0,0,0]; _light = _class createVehicle [0,0,0];
_light attachTo [ACE_player, [0,0.1,-0.05], "neck"]; _light attachTo [ACE_player, [0,0.1,-0.05], "neck"];

View File

@ -18,4 +18,12 @@
params ["_unit"]; params ["_unit"];
(items _unit) select {isText (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "Flashlight" >> "ACE_Flashlight_Colour")} private _flashlights = [];
{
if (isText (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour")) then {
_flashlights pushBackUnique _x;
};
} forEach (items _unit);
_flashlights

View File

@ -56,7 +56,7 @@ if (_flashlight == "") then {
_mousePos = GVAR(mousePos); _mousePos = GVAR(mousePos);
//flashlight settings //flashlight settings
_cfg = (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "Flashlight"); _cfg = (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight");
_size = getNumber (_cfg >> "ACE_Flashlight_Size"); _size = getNumber (_cfg >> "ACE_Flashlight_Size");
_flashTex = getText (_cfg >> "ACE_Flashlight_Beam"); _flashTex = getText (_cfg >> "ACE_Flashlight_Beam");
_beamSize = (safeZoneW/safeZoneWAbs) * _screenSize / _size; _beamSize = (safeZoneW/safeZoneWAbs) * _screenSize / _size;

View File

@ -24,8 +24,8 @@ if (GVAR(mapGlow)) then {
}; };
if ( if (
(getNumber (configFile >> "CfgWeapons" >> _newFlashlight >> "ItemInfo" >> QGVAR(Flashlight) >> QGVAR(Flashlight_Sound)) > 0) || (getNumber (configFile >> "CfgWeapons" >> _newFlashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Sound") > 0) ||
{getNumber (configFile >> "CfgWeapons" >> _oldFlashlight >> "ItemInfo" >> QGVAR(Flashlight) >> QGVAR(Flashlight_Sound)) > 0} {getNumber (configFile >> "CfgWeapons" >> _oldFlashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Sound") > 0}
) then { ) then {
playSound QGVAR(flashlightClick); playSound QGVAR(flashlightClick);
}; };