diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf
index bf699ab83c..6535b79257 100644
--- a/addons/common/XEH_postInit.sqf
+++ b/addons/common/XEH_postInit.sqf
@@ -111,6 +111,7 @@ if(!isServer) then {
if (isServer) then {
[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler;
};
+
call FUNC(checkFiles);
@@ -203,10 +204,11 @@ GVAR(OldCameraView) = cameraView;
GVAR(OldPlayerVehicle) = vehicle ACE_player;
GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
+GVAR(OldVisibleMap) = false;
// PFH to raise varios events
[{
- private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen"];
+ private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen", "_newVisibleMap"];
// "playerInventoryChanged" event
_newPlayerInventory = [ACE_player] call FUNC(getAllGear);
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then {
@@ -270,7 +272,15 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
GVAR(OldPlayerWeapon) = _newPlayerWeapon;
["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent);
};
-
+
+ // "visibleMapChanged" event
+ _newVisibleMap = visibleMap;
+ if (!_newVisibleMap isEqualTo GVAR(OldVisibleMap)) then {
+ // Raise ACE event locally
+ GVAR(OldVisibleMap) = _newVisibleMap;
+ ["visibleMapChanged", [ACE_player, _newVisibleMap]] call FUNC(localEvent);
+ };
+
}, 0, []] call CBA_fnc_addPerFrameHandler;
diff --git a/addons/flashlights/$PBOPREFIX$ b/addons/flashlights/$PBOPREFIX$
new file mode 100644
index 0000000000..674d0d255c
--- /dev/null
+++ b/addons/flashlights/$PBOPREFIX$
@@ -0,0 +1 @@
+z\ace\addons\flashlights
\ No newline at end of file
diff --git a/addons/flashlights/CfgEventHandlers.hpp b/addons/flashlights/CfgEventHandlers.hpp
new file mode 100644
index 0000000000..d5f49bd5c3
--- /dev/null
+++ b/addons/flashlights/CfgEventHandlers.hpp
@@ -0,0 +1,5 @@
+class Extended_PostInit_EventHandlers {
+ class ADDON {
+ clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) );
+ };
+};
diff --git a/addons/flashlights/CfgSounds.hpp b/addons/flashlights/CfgSounds.hpp
new file mode 100644
index 0000000000..f0fabe3a39
--- /dev/null
+++ b/addons/flashlights/CfgSounds.hpp
@@ -0,0 +1,7 @@
+class CfgSounds {
+ class ACE_flashlights_flashlightClick {
+ name = "ACE_flashlights_flashlightClick";
+ sound[] = {"\a3\sounds_f\weapons\Other\dry4.wss", 0.2, 2};
+ titles[] = {};
+ };
+};
\ No newline at end of file
diff --git a/addons/flashlights/CfgVehicles.hpp b/addons/flashlights/CfgVehicles.hpp
new file mode 100644
index 0000000000..fa766ad87b
--- /dev/null
+++ b/addons/flashlights/CfgVehicles.hpp
@@ -0,0 +1,89 @@
+class CfgVehicles {
+ class Man;
+ class CAManBase: Man {
+ class ACE_SelfActions {
+ //todo: add flashlight attach actions
+ };
+ };
+
+ class Item_Base_F;
+
+ class ACE_Flashlight_MX991Item: Item_Base_F {
+ scope = 2;
+ scopeCurator = 2;
+ displayName = CSTRING(MX991_DisplayName);
+ author = ECSTRING(common,ACETeam);
+ vehicleClass = "WeaponAccessories";
+ class TransportItems {
+ class ACE_Flashlight_MX991 {
+ name = "ACE_Flashlight_MX991";
+ count = 1;
+ };
+ };
+ };
+
+ class ACE_Flashlight_KSF1Item: Item_Base_F {
+ scope = 2;
+ scopeCurator = 2;
+ displayName = CSTRING(KSF1_DisplayName);
+ author = ECSTRING(common,ACETeam);
+ vehicleClass = "WeaponAccessories";
+ class TransportItems {
+ class ACE_Flashlight_KSF1 {
+ name = "ACE_Flashlight_KSF1";
+ count = 1;
+ };
+ };
+ };
+
+ class ACE_Flashlight_XL50Item: Item_Base_F {
+ scope = 2;
+ scopeCurator = 2;
+ displayName = CSTRING(XL50_DisplayName);
+ author = ECSTRING(common,ACETeam);
+ vehicleClass = "WeaponAccessories";
+ class TransportItems {
+ class ACE_Flashlight_XL50 {
+ name = "ACE_Flashlight_XL50";
+ count = 1;
+ };
+ };
+ };
+
+ class NATO_Box_Base;
+ class EAST_Box_Base;
+ class IND_Box_Base;
+ class FIA_Box_Base_F;
+
+ class Box_NATO_Support_F: NATO_Box_Base {
+ class TransportItems {
+ MACRO_ADDITEM(ACE_Flashlight_MX991,12);
+ };
+ };
+
+ class Box_East_Support_F: EAST_Box_Base {
+ class TransportItems {
+ MACRO_ADDITEM(ACE_Flashlight_KSF1,12);
+ };
+ };
+
+ class Box_IND_Support_F: IND_Box_Base {
+ class TransportItems {
+ MACRO_ADDITEM(ACE_Flashlight_XL50,12);
+ };
+ };
+
+ class Box_FIA_Support_F: FIA_Box_Base_F {
+ class TransportItems {
+ MACRO_ADDITEM(ACE_Flashlight_MX991,12);
+ };
+ };
+
+ class ACE_Box_Misc: Box_NATO_Support_F {
+ class TransportItems {
+ MACRO_ADDITEM(ACE_Flashlight_MX991,12);
+ MACRO_ADDITEM(ACE_Flashlight_KSF1,12);
+ MACRO_ADDITEM(ACE_Flashlight_XL50,12);
+ };
+ };
+};
\ No newline at end of file
diff --git a/addons/flashlights/CfgWeapons.hpp b/addons/flashlights/CfgWeapons.hpp
new file mode 100644
index 0000000000..09fe70d764
--- /dev/null
+++ b/addons/flashlights/CfgWeapons.hpp
@@ -0,0 +1,61 @@
+class CfgWeapons {
+
+ class ItemCore;
+ class ACE_ItemCore;
+ class InventoryItem_Base_F;
+ class InventoryFlashlightItem_Base_F;
+
+ class acc_flashlight: ItemCore {
+ class ItemInfo: InventoryFlashlightItem_Base_F {
+ class Flashlight {
+ ACE_Flashlight_Colour = "white";
+ ACE_Flashlight_Size = 2.75;
+ };
+ };
+ };
+
+ class ACE_Flashlight_MX991: ACE_ItemCore {
+ displayName = CSTRING(MX991_DisplayName);
+ descriptionShort = CSTRING(MX991_Description);
+ model = QUOTE(PATHTOF(data\MX_991.p3d));
+ picture = PATHTOF(UI\mx991_ca.paa);
+ scope = 2;
+ class ItemInfo: InventoryItem_Base_F {
+ mass = 1;
+ class FlashLight {
+ ACE_Flashlight_Colour = "red";
+ ACE_Flashlight_Size = 1.75;
+ };
+ };
+ };
+
+ class ACE_Flashlight_KSF1: ACE_ItemCore {
+ displayName = CSTRING(KSF1_DisplayName);
+ descriptionShort = CSTRING(KSF1_Description);
+ model = QUOTE(PATHTOF(data\KSF_1.p3d));
+ picture = PATHTOF(UI\ksf1_ca.paa);
+ scope = 2;
+ class ItemInfo: InventoryItem_Base_F {
+ mass = 1;
+ class FlashLight {
+ ACE_Flashlight_Colour = "red";
+ ACE_Flashlight_Size = 1.5;
+ };
+ };
+ };
+
+ class ACE_Flashlight_XL50: ACE_ItemCore {
+ displayName = CSTRING(XL50_DisplayName);
+ descriptionShort = CSTRING(XL50_Description);
+ model = QUOTE(PATHTOF(data\Maglight.p3d));
+ picture = PATHTOF(UI\xl50_ca.paa);
+ scope = 2;
+ class ItemInfo: InventoryItem_Base_F {
+ mass = 1;
+ class FlashLight {
+ ACE_Flashlight_Colour = "white";
+ ACE_Flashlight_Size = 2.15;
+ };
+ };
+ };
+};
\ No newline at end of file
diff --git a/addons/flashlights/README.md b/addons/flashlights/README.md
new file mode 100644
index 0000000000..6a04b78091
--- /dev/null
+++ b/addons/flashlights/README.md
@@ -0,0 +1,11 @@
+ace_flashlights
+=======
+
+Flashlights for use on map and to attach to player.
+
+
+## Maintainers
+
+The people responsible for merging changes to this component or answering potential questions.
+
+- [voiper](https://github.com/voiperr)
diff --git a/addons/flashlights/UI/Flashlight_Beam_blue_ca.paa b/addons/flashlights/UI/Flashlight_Beam_blue_ca.paa
new file mode 100644
index 0000000000..737780d1c8
Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_blue_ca.paa differ
diff --git a/addons/flashlights/UI/Flashlight_Beam_green_ca.paa b/addons/flashlights/UI/Flashlight_Beam_green_ca.paa
new file mode 100644
index 0000000000..b075990ba6
Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_green_ca.paa differ
diff --git a/addons/flashlights/UI/Flashlight_Beam_red_ca.paa b/addons/flashlights/UI/Flashlight_Beam_red_ca.paa
new file mode 100644
index 0000000000..5afd4e66d5
Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_red_ca.paa differ
diff --git a/addons/flashlights/UI/Flashlight_Beam_white_ca.paa b/addons/flashlights/UI/Flashlight_Beam_white_ca.paa
new file mode 100644
index 0000000000..08460e9a9c
Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_white_ca.paa differ
diff --git a/addons/flashlights/UI/Flashlight_Beam_yellow_ca.paa b/addons/flashlights/UI/Flashlight_Beam_yellow_ca.paa
new file mode 100644
index 0000000000..8593ac8706
Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_yellow_ca.paa differ
diff --git a/addons/flashlights/UI/KSF1_ca.paa b/addons/flashlights/UI/KSF1_ca.paa
new file mode 100644
index 0000000000..5a89051c05
Binary files /dev/null and b/addons/flashlights/UI/KSF1_ca.paa differ
diff --git a/addons/flashlights/UI/mx991_ca.paa b/addons/flashlights/UI/mx991_ca.paa
new file mode 100644
index 0000000000..9385ec675a
Binary files /dev/null and b/addons/flashlights/UI/mx991_ca.paa differ
diff --git a/addons/flashlights/UI/xl50_ca.paa b/addons/flashlights/UI/xl50_ca.paa
new file mode 100644
index 0000000000..55aaa0cbcd
Binary files /dev/null and b/addons/flashlights/UI/xl50_ca.paa differ
diff --git a/addons/flashlights/XEH_postInitClient.sqf b/addons/flashlights/XEH_postInitClient.sqf
new file mode 100644
index 0000000000..09cdcdd1f2
--- /dev/null
+++ b/addons/flashlights/XEH_postInitClient.sqf
@@ -0,0 +1,8 @@
+#include "script_component.hpp"
+
+// Exit on Headless as well
+if !(hasInterface) exitWith {};
+
+LOG(MSG_INIT);
+
+//todo: make flashlights attachable to players
\ No newline at end of file
diff --git a/addons/flashlights/config.cpp b/addons/flashlights/config.cpp
new file mode 100644
index 0000000000..b34c4b8000
--- /dev/null
+++ b/addons/flashlights/config.cpp
@@ -0,0 +1,18 @@
+#include "script_component.hpp"
+
+class CfgPatches {
+ class ADDON {
+ units[] = {};
+ weapons[] = {"ACE_Flashlight_MX991", "ACE_Flashlight_KSF1", "ACE_Flashlight_XL50"};
+ requiredVersion = REQUIRED_VERSION;
+ requiredAddons[] = {"ace_interaction"};
+ author[] = {"voiper"};
+ authorUrl = "https://github.com/voiperr/";
+ VERSION_CONFIG;
+ };
+};
+
+#include "CfgEventHandlers.hpp"
+#include "CfgVehicles.hpp"
+#include "CfgWeapons.hpp"
+#include "CfgSounds.hpp"
diff --git a/addons/flashlights/data/KSF_1.p3d b/addons/flashlights/data/KSF_1.p3d
new file mode 100644
index 0000000000..0ec2fd23c6
Binary files /dev/null and b/addons/flashlights/data/KSF_1.p3d differ
diff --git a/addons/flashlights/data/KSF_1.rvmat b/addons/flashlights/data/KSF_1.rvmat
new file mode 100644
index 0000000000..113fe0cc14
--- /dev/null
+++ b/addons/flashlights/data/KSF_1.rvmat
@@ -0,0 +1,79 @@
+ambient[]={1,1,1,1};
+diffuse[]={1,1,1,1};
+forcedDiffuse[]={0,0,0,0};
+emmisive[]={0,0,0,1};
+specular[]={0.6,0.6,0.6,1}; //amount of glossiness - the higher the number, the higher the glossiness
+specularPower=700; //area of glossiness - the higher the number, the smaller the area
+PixelShaderID="Super";
+VertexShaderID="Super";
+
+class Stage1 {
+ texture="z\ace\addons\flashlights\data\KSF_1_nohq.paa";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage2 {
+ texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage3 {
+ texture="#(argb,8,8,3)color(0,0,0,0,mc)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage4 {
+ texture="#(argb,8,8,3)color(1,1,1,1,as)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,1};
+ pos[]={0,0,1};
+ };
+};
+class Stage5 {
+ texture="z\ace\addons\flashlights\data\KSF_1_smdi.paa";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage6 {
+ texture="#(ai,64,64,1)fresnel(4.7,1.2)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,1};
+ pos[]={0,0,0};
+ };
+};
+class Stage7 {
+ texture="a3\data_f\env_land_ca.paa";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,1};
+ pos[]={0,0,0};
+ };
+};
diff --git a/addons/flashlights/data/KSF_1_co.paa b/addons/flashlights/data/KSF_1_co.paa
new file mode 100644
index 0000000000..bb31888863
Binary files /dev/null and b/addons/flashlights/data/KSF_1_co.paa differ
diff --git a/addons/flashlights/data/KSF_1_nohq.paa b/addons/flashlights/data/KSF_1_nohq.paa
new file mode 100644
index 0000000000..8c5ada23c8
Binary files /dev/null and b/addons/flashlights/data/KSF_1_nohq.paa differ
diff --git a/addons/flashlights/data/KSF_1_smdi.paa b/addons/flashlights/data/KSF_1_smdi.paa
new file mode 100644
index 0000000000..b12f26e5f4
Binary files /dev/null and b/addons/flashlights/data/KSF_1_smdi.paa differ
diff --git a/addons/flashlights/data/MX_991.p3d b/addons/flashlights/data/MX_991.p3d
new file mode 100644
index 0000000000..c79c330ea3
Binary files /dev/null and b/addons/flashlights/data/MX_991.p3d differ
diff --git a/addons/flashlights/data/MX_991.rvmat b/addons/flashlights/data/MX_991.rvmat
new file mode 100644
index 0000000000..0268d4903c
--- /dev/null
+++ b/addons/flashlights/data/MX_991.rvmat
@@ -0,0 +1,79 @@
+ambient[]={1,1,1,1};
+diffuse[]={1,1,1,1};
+forcedDiffuse[]={0,0,0,0};
+emmisive[]={0,0,0,1};
+specular[]={0.6,0.6,0.6,1}; //amount of glossiness - the higher the number, the higher the glossiness
+specularPower=700; //area of glossiness - the higher the number, the smaller the area
+PixelShaderID="Super";
+VertexShaderID="Super";
+
+class Stage1 {
+ texture="z\ace\addons\flashlights\data\MX_991_nohq.paa";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage2 {
+ texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage3 {
+ texture="#(argb,8,8,3)color(0,0,0,0,mc)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage4 {
+ texture="#(argb,8,8,3)color(1,1,1,1,as)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,1};
+ pos[]={0,0,1};
+ };
+};
+class Stage5 {
+ texture="#(rgb,1,1,1)color(0.2,0.2,1,1)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage6 {
+ texture="#(ai,64,64,1)fresnel(4.7,1.2)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,1};
+ pos[]={0,0,0};
+ };
+};
+class Stage7 {
+ texture="a3\data_f\env_land_ca.paa";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,1};
+ pos[]={0,0,0};
+ };
+};
diff --git a/addons/flashlights/data/MX_991_co.paa b/addons/flashlights/data/MX_991_co.paa
new file mode 100644
index 0000000000..598dda174b
Binary files /dev/null and b/addons/flashlights/data/MX_991_co.paa differ
diff --git a/addons/flashlights/data/MX_991_nohq.paa b/addons/flashlights/data/MX_991_nohq.paa
new file mode 100644
index 0000000000..565df542e1
Binary files /dev/null and b/addons/flashlights/data/MX_991_nohq.paa differ
diff --git a/addons/flashlights/data/Maglight.p3d b/addons/flashlights/data/Maglight.p3d
new file mode 100644
index 0000000000..6ce3b9fcd4
Binary files /dev/null and b/addons/flashlights/data/Maglight.p3d differ
diff --git a/addons/flashlights/data/Maglite.rvmat b/addons/flashlights/data/Maglite.rvmat
new file mode 100644
index 0000000000..960599813b
--- /dev/null
+++ b/addons/flashlights/data/Maglite.rvmat
@@ -0,0 +1,79 @@
+ambient[]={1,1,1,1};
+diffuse[]={1,1,1,1};
+forcedDiffuse[]={0,0,0,0};
+emmisive[]={0,0,0,1};
+specular[]={0.6,0.6,0.6,1}; //amount of glossiness - the higher the number, the higher the glossiness
+specularPower=700; //area of glossiness - the higher the number, the smaller the area
+PixelShaderID="Super";
+VertexShaderID="Super";
+
+class Stage1 {
+ texture="z\ace\addons\flashlights\data\Maglite_nohq.paa";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage2 {
+ texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage3 {
+ texture="#(argb,8,8,3)color(0,0,0,0,mc)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage4 {
+ texture="#(argb,8,8,3)color(1,1,1,1,as)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,1};
+ pos[]={0,0,1};
+ };
+};
+class Stage5 {
+ texture="z\ace\addons\flashlights\data\Maglite_smdi.paa";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,0};
+ pos[]={0,0,0};
+ };
+};
+class Stage6 {
+ texture="#(ai,64,64,1)fresnel(4.7,1.2)";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,1};
+ pos[]={0,0,0};
+ };
+};
+class Stage7 {
+ texture="a3\data_f\env_land_ca.paa";
+ uvSource="tex";
+ class uvTransform {
+ aside[]={1,0,0};
+ up[]={0,1,0};
+ dir[]={0,0,1};
+ pos[]={0,0,0};
+ };
+};
diff --git a/addons/flashlights/data/Maglite_co.paa b/addons/flashlights/data/Maglite_co.paa
new file mode 100644
index 0000000000..8a399b25cc
Binary files /dev/null and b/addons/flashlights/data/Maglite_co.paa differ
diff --git a/addons/flashlights/data/Maglite_nohq.paa b/addons/flashlights/data/Maglite_nohq.paa
new file mode 100644
index 0000000000..43282a963b
Binary files /dev/null and b/addons/flashlights/data/Maglite_nohq.paa differ
diff --git a/addons/flashlights/data/Maglite_smdi.paa b/addons/flashlights/data/Maglite_smdi.paa
new file mode 100644
index 0000000000..093d83e145
Binary files /dev/null and b/addons/flashlights/data/Maglite_smdi.paa differ
diff --git a/addons/flashlights/script_component.hpp b/addons/flashlights/script_component.hpp
new file mode 100644
index 0000000000..ba740c22fc
--- /dev/null
+++ b/addons/flashlights/script_component.hpp
@@ -0,0 +1,12 @@
+#define COMPONENT flashlights
+#include "\z\ace\addons\main\script_mod.hpp"
+
+#ifdef DEBUG_ENABLED_FLASHLIGHTS
+ #define DEBUG_MODE_FULL
+#endif
+
+#ifdef DEBUG_SETTINGS_FLASHLIGHTS
+ #define DEBUG_SETTINGS DEBUG_SETTINGS_FLASHLIGHTS
+#endif
+
+#include "\z\ace\addons\main\script_macros.hpp"
\ No newline at end of file
diff --git a/addons/flashlights/stringtable.xml b/addons/flashlights/stringtable.xml
new file mode 100644
index 0000000000..e871360bf3
--- /dev/null
+++ b/addons/flashlights/stringtable.xml
@@ -0,0 +1,29 @@
+
+
+
+
+ Fulton MX-991
+ Fulton MX-991
+
+
+ Flashlight with red filter. For use on map.
+ Latarka z czerwonym filtrem. Używana do podświetlania mapy.
+
+
+ Maglite XL50
+ Maglite XL50
+
+
+ White mini flashlight. For use on map.
+ Mini latarka. Światło białe. Używana do podświetlania mapy.
+
+
+ KSF-1
+ KSF-1
+
+
+ Flashlight with red filter. For use on map.
+ Latarka z czerwonym filtrem. Używana do podświetlania mapy.
+
+
+
\ No newline at end of file
diff --git a/addons/map/ACE_Settings.hpp b/addons/map/ACE_Settings.hpp
index 15e2a174e4..4e2a5d5706 100644
--- a/addons/map/ACE_Settings.hpp
+++ b/addons/map/ACE_Settings.hpp
@@ -15,6 +15,10 @@ class ACE_Settings {
value = 1;
typeName = "BOOL";
};
+ class GVAR(mapGlow) {
+ value = 1;
+ typeName = "BOOL";
+ };
class GVAR(mapShake) {
value = 1;
typeName = "BOOL";
diff --git a/addons/map/CfgAmmo.hpp b/addons/map/CfgAmmo.hpp
new file mode 100644
index 0000000000..805e7b3627
--- /dev/null
+++ b/addons/map/CfgAmmo.hpp
@@ -0,0 +1,48 @@
+class CfgAmmo {
+
+ class FlareCore;
+
+ class FlareBase: FlareCore {};
+ class F_20mm_White: FlareBase {};
+
+ class ACE_FlashlightProxy_White: F_20mm_White {
+ model = "";
+ effectFlare = "FlareShell";
+
+ triggerTime = 0;
+ intensity = 0.5;
+ flareSize = 1;
+ timeToLive = 10e10;
+
+ lightColor[] = {1,1,1,1};
+
+ grenadeBurningSound[] = {};
+ grenadeFireSound[] = {};
+ soundTrigger[] = {};
+ SmokeShellSoundHit1[] = {};
+ SmokeShellSoundHit2[] = {};
+ SmokeShellSoundHit3[] = {};
+ SmokeShellSoundLoop1[] = {};
+ SmokeShellSoundLoop2[] = {};
+ };
+
+ class ACE_FlashlightProxy_Red: ACE_FlashlightProxy_White {
+ intensity = 1;
+ lightColor[] = {1,0,0,1};
+ };
+
+ class ACE_FlashlightProxy_Green: ACE_FlashlightProxy_White {
+ intensity = 1;
+ lightColor[] = {0,1,0,1};
+ };
+
+ class ACE_FlashlightProxy_Blue: ACE_FlashlightProxy_White {
+ intensity = 1.5;
+ lightColor[] = {0.25,0.25,1,1};
+ };
+
+ class ACE_FlashlightProxy_Yellow: ACE_FlashlightProxy_White {
+ intensity = 1;
+ lightColor[] = {1,1,0.5,1};
+ };
+};
\ No newline at end of file
diff --git a/addons/map/CfgSounds.hpp b/addons/map/CfgSounds.hpp
new file mode 100644
index 0000000000..ede59914a7
--- /dev/null
+++ b/addons/map/CfgSounds.hpp
@@ -0,0 +1,7 @@
+class CfgSounds {
+ class ACE_map_flashlightClick {
+ name = "ACE_map_flashlightClick";
+ sound[] = {"\a3\sounds_f\weapons\Other\dry4.wss", 0.2, 2};
+ titles[] = {};
+ };
+};
\ No newline at end of file
diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp
index 30cae96ef6..3b203c1f62 100644
--- a/addons/map/CfgVehicles.hpp
+++ b/addons/map/CfgVehicles.hpp
@@ -1,4 +1,20 @@
class CfgVehicles {
+ class Man;
+ class CAManBase: Man {
+ class ACE_SelfActions {
+ class ACE_MapFlashlight {
+ displayName = CSTRING(Action_Flashlights);
+ icon = QUOTE(\a3\ui_f\data\IGUI\Cfg\VehicleToggles\lightsiconon_ca.paa);
+ condition = QUOTE(GVAR(mapIllumination) && visibleMap && (count ([ACE_player] call FUNC(getUnitFlashlights)) > 0));
+ statement = "true";
+ exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
+ insertChildren = QUOTE(_this call DFUNC(compileFlashlightMenu));
+ showDisabled = 0;
+ priority = 99;
+ };
+ };
+ };
+
class ACE_Module;
class ACE_ModuleMap: ACE_Module {
author = ECSTRING(common,ACETeam);
@@ -15,6 +31,12 @@ class CfgVehicles {
typeName = "BOOL";
defaultValue = 1;
};
+ class MapGlow {
+ displayName = CSTRING(MapGlow_DisplayName);
+ description = CSTRING(MapGlow_Description);
+ typeName = "BOOL";
+ defaultValue = 1;
+ };
class MapShake {
displayName = CSTRING(MapShake_DisplayName);
description = CSTRING(MapShake_Description);
@@ -45,7 +67,7 @@ class CfgVehicles {
displayName = CSTRING(BFT_Module_DisplayName);
function = QFUNC(blueForceTrackingModule);
scope = 2;
- isGlobal = 0;
+ isGlobal = 1;
icon = PATHTOF(UI\Icon_Module_BFTracking_ca.paa);
class Arguments {
class Enabled {
@@ -71,4 +93,4 @@ class CfgVehicles {
description = CSTRING(BFT_Module_Description);
};
};
-};
+};
\ No newline at end of file
diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf
index 95f42db431..ef528d5233 100644
--- a/addons/map/XEH_postInitClient.sqf
+++ b/addons/map/XEH_postInitClient.sqf
@@ -1,23 +1,24 @@
#include "script_component.hpp"
// Exit on Headless as well
-if !(hasInterface) exitWith {};
+if (!hasInterface) exitWith {};
LOG(MSG_INIT);
// Calculate the maximum zoom allowed for this map
call FUNC(determineZoom);
-// This spawn is probably worth keeping, as pfh don't work natively on the briefing screen and IDK how reliable the hack we implemented for them is.
-// The thread dies as soon as the mission start, so it's not really compiting for scheduler space.
-[] spawn {
- // Wait until the map display is detected
- waitUntil {(!isNull findDisplay 12)};
+[{
+ if (isNull findDisplay 12) exitWith {};
GVAR(lastStillPosition) = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5];
GVAR(lastStillTime) = ACE_time;
GVAR(isShaking) = false;
+ //map sizes are multiples of 1280
+ GVAR(worldSize) = worldSize / 1280;
+ GVAR(mousePos) = [0.5,0.5];
+
//Allow panning the lastStillPosition while mapShake is active
GVAR(rightMouseButtonLastPos) = [];
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapEffects);}];
@@ -42,13 +43,59 @@ call FUNC(determineZoom);
GVAR(rightMouseButtonLastPos) = [];
};
}];
-};
+
+ //get mouse position on map
+ ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseMoving", {
+ GVAR(mousePos) = (_this select 0) ctrlMapScreenToWorld [_this select 1, _this select 2];
+ }];
+ ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseHolding", {
+ GVAR(mousePos) = (_this select 0) ctrlMapScreenToWorld [_this select 1, _this select 2];
+ }];
+
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+}, 0] call CBA_fnc_addPerFrameHandler;
["SettingsInitialized", {
// Start Blue Force Tracking if Enabled
if (GVAR(BFT_Enabled)) then {
- diag_log text "[ACE] Blue Force Tracking Enabled (client)";
GVAR(BFT_markers) = [];
[FUNC(blueForceTrackingUpdate), GVAR(BFT_Interval), []] call CBA_fnc_addPerFrameHandler;
};
-}] call EFUNC(common,addEventHandler);
+
+ //illumination settings
+ if (GVAR(mapIllumination)) then {
+ GVAR(flashlightInUse) = "";
+ GVAR(glow) = objNull;
+
+ ["playerInventoryChanged", {
+ _flashlights = [ACE_player] call FUNC(getUnitFlashlights);
+ if ((GVAR(flashlightInUse) != "") && !(GVAR(flashlightInUse) in _flashlights)) then {
+ GVAR(flashlightInUse) = "";
+ };
+ }] call EFUNC(common,addEventHandler);
+
+ if (GVAR(mapGlow)) then {
+ ["visibleMapChanged", {
+ params ["_player", "_mapOn"];
+ if (_mapOn) then {
+ if (!alive _player && !isNull GVAR(glow)) then {
+ GVAR(flashlightInUse) = "";
+ };
+ if (GVAR(flashlightInUse) != "") then {
+ if (isNull GVAR(glow)) then {
+ [GVAR(flashlightInUse)] call FUNC(flashlightGlow);
+ };
+ } else {
+ if (!isNull GVAR(glow)) then {
+ [""] call FUNC(flashlightGlow);
+ };
+ };
+ } else {
+ if (!isNull GVAR(glow)) then {
+ [""] call FUNC(flashlightGlow);
+ };
+ };
+ }] call EFUNC(common,addEventHandler);
+ };
+ };
+}] call EFUNC(common,addEventHandler);
\ No newline at end of file
diff --git a/addons/map/XEH_preInit.sqf b/addons/map/XEH_preInit.sqf
index c5645a52e7..9e123a3877 100644
--- a/addons/map/XEH_preInit.sqf
+++ b/addons/map/XEH_preInit.sqf
@@ -5,10 +5,15 @@ LOG(MSG_INIT);
PREP(blueForceTrackingModule);
PREP(blueForceTrackingUpdate);
+PREP(compileFlashlightMenu);
PREP(determineMapLight);
PREP(determineZoom);
+PREP(flashlightGlow);
+PREP(getUnitFlashlights);
PREP(moduleMap);
PREP(onDrawMap);
+PREP(simulateMapLight);
+PREP(switchFlashlight);
PREP(updateMapEffects);
ADDON = true;
diff --git a/addons/map/config.cpp b/addons/map/config.cpp
index 16cfd2bc31..6d6b4030ec 100644
--- a/addons/map/config.cpp
+++ b/addons/map/config.cpp
@@ -27,6 +27,8 @@ class RscEdit;
#include "CfgEventHandlers.hpp"
#include "CfgMarkers.hpp"
#include "CfgVehicles.hpp"
+#include "CfgAmmo.hpp"
+#include "CfgSounds.hpp"
class RscMapControl {
maxSatelliteAlpha = 0.5;
diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf
index 33049c38ca..bab776c9ab 100644
--- a/addons/map/functions/fnc_blueForceTrackingModule.sqf
+++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf
@@ -12,12 +12,15 @@
#include "script_component.hpp"
-if (!isServer) exitWith {};
+if !(hasInterface) exitWith {};
-PARAMS_1(_logic);
+PARAMS_3(_logic,_units,_activated);
+
+if !(_activated) exitWith {};
[_logic, QGVAR(BFT_Enabled), "Enabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(BFT_Interval), "Interval"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule);
-diag_log text "[ACE]: Blue Force Tracking Module initialized. (server)";
+diag_log text "[ACE]: Blue Force Tracking Module initialized.";
+TRACE_2("[ACE]: Blue Force Tracking Module initialized.", GVAR(BFT_Interval), GVAR(BFT_HideAiGroups));
diff --git a/addons/map/functions/fnc_compileFlashlightMenu.sqf b/addons/map/functions/fnc_compileFlashlightMenu.sqf
new file mode 100644
index 0000000000..0d081bb57c
--- /dev/null
+++ b/addons/map/functions/fnc_compileFlashlightMenu.sqf
@@ -0,0 +1,65 @@
+/*
+ * Author: voiper
+ * Compile list of flashlight classnames and add to the "Flashlight" parent menu.
+ *
+ * Arguments:
+ * 0: Vehicle