mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Further cleanup. Checked some privates.
This commit is contained in:
parent
2158d39e8a
commit
a20629066a
@ -5,7 +5,7 @@ class CfgWeapons {
|
||||
|
||||
class acc_flashlight: ItemCore {
|
||||
class ItemInfo: InventoryFlashlightItem_Base_F {
|
||||
class Flashlight {
|
||||
class FlashLight {
|
||||
ACE_Flashlight_Colour = "white";
|
||||
ACE_Flashlight_Beam = QPATHTOF(UI\Flashlight_beam_white_ca.paa);
|
||||
ACE_Flashlight_Size = 2.75;
|
||||
|
@ -16,19 +16,18 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_light", "_color", "_class"];
|
||||
params ["_flashlight"];
|
||||
|
||||
_light = GVAR(glow);
|
||||
private _light = GVAR(glow);
|
||||
if (!isNull _light) then {
|
||||
detach _light;
|
||||
deleteVehicle _light;
|
||||
};
|
||||
|
||||
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"};
|
||||
_class = format["ACE_FlashlightProxy_%1", _color];
|
||||
private _class = format["ACE_FlashlightProxy_%1", _color];
|
||||
|
||||
_light = _class createVehicle [0,0,0];
|
||||
_light attachTo [ACE_player, [0,0.1,-0.05], "neck"];
|
||||
|
@ -18,4 +18,12 @@
|
||||
|
||||
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
|
||||
|
@ -56,7 +56,7 @@ if (_flashlight == "") then {
|
||||
_mousePos = GVAR(mousePos);
|
||||
|
||||
//flashlight settings
|
||||
_cfg = (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "Flashlight");
|
||||
_cfg = (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight");
|
||||
_size = getNumber (_cfg >> "ACE_Flashlight_Size");
|
||||
_flashTex = getText (_cfg >> "ACE_Flashlight_Beam");
|
||||
_beamSize = (safeZoneW/safeZoneWAbs) * _screenSize / _size;
|
||||
|
@ -24,8 +24,8 @@ if (GVAR(mapGlow)) then {
|
||||
};
|
||||
|
||||
if (
|
||||
(getNumber (configFile >> "CfgWeapons" >> _newFlashlight >> "ItemInfo" >> QGVAR(Flashlight) >> QGVAR(Flashlight_Sound)) > 0) ||
|
||||
{getNumber (configFile >> "CfgWeapons" >> _oldFlashlight >> "ItemInfo" >> QGVAR(Flashlight) >> QGVAR(Flashlight_Sound)) > 0}
|
||||
(getNumber (configFile >> "CfgWeapons" >> _newFlashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Sound") > 0) ||
|
||||
{getNumber (configFile >> "CfgWeapons" >> _oldFlashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Sound") > 0}
|
||||
) then {
|
||||
playSound QGVAR(flashlightClick);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user