Used QPATHTOF. Reverted config names.

Optimised fnc_getUnitFlashlights.
This commit is contained in:
voiper 2016-06-15 14:58:07 -07:00
parent 01c335d13a
commit 2158d39e8a
5 changed files with 25 additions and 33 deletions

View File

@ -11,11 +11,11 @@ class CfgWeapons {
scope = 2; scope = 2;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 1; mass = 1;
class ACE_Map_Flashlight { class Flashlight {
ACE_Map_Flashlight_Color = "red"; ACE_Flashlight_Colour = "red";
ACE_Map_Flashlight_Beam = QUOTE(PATHTOF(UI\Flashlight_beam_red_ca.paa)); ACE_Flashlight_Beam = QPATHTOF(UI\Flashlight_beam_red_ca.paa);
ACE_Map_Flashlight_Size = 1.75; ACE_Flashlight_Size = 1.75;
ACE_Map_Flashlight_Sound = 1; ACE_Flashlight_Sound = 1;
}; };
}; };
}; };
@ -28,10 +28,10 @@ class CfgWeapons {
scope = 2; scope = 2;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 1; mass = 1;
class ACE_Map_Flashlight { class Flashlight {
ACE_Map_Flashlight_Color = "red"; ACE_Flashlight_Colour = "red";
ACE_Map_Flashlight_Beam = QUOTE(PATHTOF(UI\Flashlight_beam_red_ca.paa)); ACE_Flashlight_Beam = QPATHTOF(UI\Flashlight_beam_red_ca.paa);
ACE_Map_Flashlight_Size = 1.5; ACE_Flashlight_Size = 1.5;
ACE_Map_Flashlight_Sound = 1; ACE_Map_Flashlight_Sound = 1;
}; };
}; };
@ -45,11 +45,11 @@ class CfgWeapons {
scope = 2; scope = 2;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 1; mass = 1;
class ACE_Map_Flashlight { class Flashlight {
ACE_Map_Flashlight_Color = "white"; ACE_Flashlight_Colour = "white";
ACE_Map_Flashlight_Beam = QUOTE(PATHTOF(UI\Flashlight_beam_white_ca.paa)); ACE_Flashlight_Beam = QPATHTOF(UI\Flashlight_beam_white_ca.paa);
ACE_Map_Flashlight_Size = 2.15; ACE_Flashlight_Size = 2.15;
ACE_Map_Flashlight_Sound = 1; ACE_Flashlight_Sound = 1;
}; };
}; };
}; };

View File

@ -5,11 +5,11 @@ class CfgWeapons {
class acc_flashlight: ItemCore { class acc_flashlight: ItemCore {
class ItemInfo: InventoryFlashlightItem_Base_F { class ItemInfo: InventoryFlashlightItem_Base_F {
class ACE_Map_Flashlight { class Flashlight {
ACE_Map_Flashlight_Color = "white"; ACE_Flashlight_Colour = "white";
ACE_Map_Flashlight_Beam = QUOTE(PATHTOF(UI\Flashlight_beam_white_ca.paa)); ACE_Flashlight_Beam = QPATHTOF(UI\Flashlight_beam_white_ca.paa);
ACE_Map_Flashlight_Size = 2.75; ACE_Flashlight_Size = 2.75;
ACE_Map_Flashlight_Sound = 1; ACE_Flashlight_Sound = 1;
}; };
}; };
}; };

View File

@ -26,8 +26,8 @@ if (!isNull _light) then {
}; };
if (_flashlight != "") then { if (_flashlight != "") then {
_color = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> QGVAR(Flashlight) >> QGVAR(Flashlight_Color)); _color = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "Flashlight" >> "ACE_Flashlight_Colour");
if !(_color in ["white", "red", "green", "blue", "yellow"]) then {_color = "white"}; if !(_color in ["white", "red", "green", "blue", "yellow", "orange"]) then {_color = "white"};
_class = format["ACE_FlashlightProxy_%1", _color]; _class = format["ACE_FlashlightProxy_%1", _color];
_light = _class createVehicle [0,0,0]; _light = _class createVehicle [0,0,0];

View File

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

View File

@ -56,9 +56,9 @@ if (_flashlight == "") then {
_mousePos = GVAR(mousePos); _mousePos = GVAR(mousePos);
//flashlight settings //flashlight settings
_cfg = (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> QGVAR(Flashlight)); _cfg = (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "Flashlight");
_size = getNumber (_cfg >> QGVAR(Flashlight_Size)); _size = getNumber (_cfg >> "ACE_Flashlight_Size");
_flashTex = getText (_cfg >> QGVAR(Flashlight_Beam)); _flashTex = getText (_cfg >> "ACE_Flashlight_Beam");
_beamSize = (safeZoneW/safeZoneWAbs) * _screenSize / _size; _beamSize = (safeZoneW/safeZoneWAbs) * _screenSize / _size;
//after 5x zoom, it's simulated to be fixed (it actually gets bigger relative to zoom) //after 5x zoom, it's simulated to be fixed (it actually gets bigger relative to zoom)