IR Lights - Fix visible pointers for DBAL (#9414)

* fix dbal visible pointer

* fix dbal visible pointer

* remove unused macro

* tweak numbers, move define to single file

* change max range
This commit is contained in:
Grim 2023-09-19 16:55:15 -04:00 committed by GitHub
parent b84a84c0ff
commit bd4d1a7a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 61 additions and 49 deletions

View File

@ -1,30 +1,7 @@
// Only a dependency when building
#include "\z\ace\addons\laserpointer\script_macros_config.hpp"
// Attenuation and Flashlight seem to not work with inheritance
#define VISIBLE_POINTER_FLASHLIGHT \
class Flashlight { \
color[] = {0, 0, 0}; \
ambient[] = {0, 0, 0}; \
size = 0; \
innerAngle = 0; \
outerAngle = 0; \
position = "laser pos"; \
direction = "laser dir"; \
useFlare = 0; \
flareSize = 0; \
flareMaxDistance = 0; \
coneFadeCoef = 0; \
intensity = 0; \
irLight = 0; \
volumeShape = ""; \
scale[] = {0, 0, 0}; \
class Attenuation { \
constant = 0; \
linear = 0; \
quadratic = 0; \
start = 0; \
hardLimitStart = 0; \
hardLimitEnd = 0; \
}; \
}
#define DBAL_A3_FLASHLIGHT \
class Flashlight { \
color[] = {1, 1, 1}; \
@ -115,19 +92,21 @@
hardLimitStart = hardLimitStart; \
hardLimitEnd = hardLimitEnd; \
}
#define POINTER \
#define POINTER_IR \
class Pointer { \
irLaserPos = "laser pos"; \
irLaserEnd = "laser dir"; \
irDistance = 5; \
}
class CfgWeapons {
class acc_pointer_IR;
class acc_flashlight;
class InventoryFlashlightItem_Base_F;
// DBAL-A3 (red pointer)
// IR Pointer + Illuminator
class ACE_DBAL_A3_Red: acc_pointer_IR {
author = ECSTRING(common,ACETeam);
displayName = CSTRING(DBAL_A3_Red);
@ -140,10 +119,11 @@ class CfgWeapons {
class ItemInfo: InventoryFlashLightItem_Base_F {
DBAL_A3_FLASHLIGHT;
POINTER;
POINTER_IR;
};
};
// IR Pointer only
class ACE_DBAL_A3_Red_IP: ACE_DBAL_A3_Red {
scope = 1;
MRT_SwitchItemNextClass = "ACE_DBAL_A3_Red_II";
@ -152,10 +132,11 @@ class CfgWeapons {
class ItemInfo: InventoryFlashLightItem_Base_F {
class Flashlight {};
POINTER;
POINTER_IR;
};
};
// Illuminator only
class ACE_DBAL_A3_Red_II: ACE_DBAL_A3_Red {
scope = 1;
MRT_SwitchItemNextClass = "ACE_DBAL_A3_Red_VP";
@ -167,16 +148,16 @@ class CfgWeapons {
};
};
// Visible Pointer only
class ACE_DBAL_A3_Red_VP: ACE_DBAL_A3_Red {
scope = 1;
ACE_laserpointer = 1;
MRT_SwitchItemNextClass = "ACE_DBAL_A3_Red";
MRT_SwitchItemPrevClass = "ACE_DBAL_A3_Red_II";
MRT_SwitchItemHintText = CSTRING(Mode_VisiblePointer);
class ItemInfo: InventoryFlashLightItem_Base_F {
VISIBLE_POINTER_FLASHLIGHT;
POINTER;
class Flashlight {};
POINTER_VISIBLE_RED;
};
};
@ -189,7 +170,7 @@ class CfgWeapons {
class ItemInfo: InventoryFlashLightItem_Base_F {
DBAL_A3_FLASHLIGHT_LR;
POINTER;
POINTER_IR;
};
};
@ -240,10 +221,12 @@ class CfgWeapons {
class ACE_DBAL_A3_Green_VP: ACE_DBAL_A3_Red_VP {
displayName = CSTRING(DBAL_A3_Green);
ACE_laserpointer = 2;
MRT_SwitchItemNextClass = "ACE_DBAL_A3_Green";
MRT_SwitchItemPrevClass = "ACE_DBAL_A3_Green_II";
baseWeapon = "ACE_DBAL_A3_Green";
class ItemInfo: ItemInfo {
POINTER_VISIBLE_GREEN;
};
};
// DBAL-A3 (green pointer, long range)
@ -255,7 +238,7 @@ class CfgWeapons {
class ItemInfo: InventoryFlashLightItem_Base_F {
DBAL_A3_FLASHLIGHT;
POINTER;
POINTER_IR;
};
};

View File

@ -6,7 +6,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common", "ace_laserpointer"};
requiredAddons[] = {"ace_common"};
author = ECSTRING(common,ACETeam);
authors[] = {"BaerMitUmlaut", "OmniMan"};
url = ECSTRING(main,URL);

View File

@ -38,13 +38,7 @@ class CfgWeapons {
baseWeapon = "acc_pointer_IR";
class ItemInfo: ItemInfo {
class Pointer: Pointer {
isIR = 0; // visible laser
irDotSize = QUOTE(0.1/4); // default size / 4
beamThickness = 0; // no visible beam
dotColor[] = {8192, 0, 0}; // 5mW/low-vis
beamColor[] = {0, 0, 0};
};
POINTER_VISIBLE_RED;
};
};
@ -58,12 +52,7 @@ class CfgWeapons {
baseWeapon = "ACE_acc_pointer_green";
class ItemInfo: ItemInfo {
class Pointer: Pointer { // properties can't be inherited
isIR = 0;
beamThickness = 0;
dotColor[] = {0, 16384, 0}; // high-vis
beamColor[] = {0, 0, 0};
};
POINTER_VISIBLE_GREEN;
};
};
};

View File

@ -15,3 +15,4 @@
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#include "\z\ace\addons\laserpointer\script_macros_config.hpp"

View File

@ -0,0 +1,39 @@
/*
Usage:
#include "\z\ace\addons\laserpointer\script_macros_config.hpp"
class CfgWeapons {
class My_AwesomePointer_base;
class My_AwesomePointer: My_AwesomePointer_base {
class ItemInfo {
POINTER_VISIBLE_GREEN;
};
};
};
*/
#define POINTER_VISIBLE_RED \
class Pointer { \
irLaserPos = "laser pos"; \
irLaserEnd = "laser dir"; \
irDistance = 5; \
isIR = 0; \
irDotSize = QUOTE(0.1/4); \
beamThickness = 0; \
beamMaxLength = 50; \
dotColor[] = {16384, 0, 0}; \
beamColor[] = {0, 0, 0}; \
}
#define POINTER_VISIBLE_GREEN \
class Pointer { \
irLaserPos = "laser pos"; \
irLaserEnd = "laser dir"; \
irDistance = 5; \
isIR = 0; \
irDotSize = QUOTE(0.1/4); \
beamThickness = 0; \
beamMaxLength = 75; \
dotColor[] = {0, 16384, 0}; \
beamColor[] = {0, 0, 0}; \
}