Laserpointer - Block switching to unsupported visible lasers (#9416)

This commit is contained in:
PabstMirror 2023-09-22 11:09:46 -05:00 committed by GitHub
parent 51e6134b71
commit 0b695be841
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 3 deletions

View File

@ -30,8 +30,6 @@ if (_lightSource isKindOf "CAManBase") then {
private _flashlight = (_lightSource weaponAccessories _weapon) select 1; private _flashlight = (_lightSource weaponAccessories _weapon) select 1;
if (getNumber (configFile >> "CfgWeapons" >> _flashlight >> "ACE_laserpointer") > 0) exitWith {}; // Red = 1, Green = 2
private _properties = [[_flashlight], FUNC(getLightPropertiesWeapon), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getLightPropertiesWeapon)), _flashlight], 1E11] call FUNC(cachedCall); private _properties = [[_flashlight], FUNC(getLightPropertiesWeapon), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getLightPropertiesWeapon)), _flashlight], 1E11] call FUNC(cachedCall);
//_properties = [_flashlight] call FUNC(getLightPropertiesWeapon); //_properties = [_flashlight] call FUNC(getLightPropertiesWeapon);

View File

@ -1,3 +1,8 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));

View File

@ -1,3 +1,8 @@
#include "script_component.hpp" #include "script_component.hpp"
{
TRACE_1("blocking switching to unsupported laser mode",_x);
[_x, { false }] call CBA_fnc_addAttachmentCondition;
} forEach (keys (uiNamespace getVariable QGVAR(oldLasers)));
ADDON = true; ADDON = true;

View File

@ -0,0 +1,5 @@
#include "script_component.hpp"
private _lasers = ((toString {(getNumber (_x >> "ACE_laserpointer")) > 0}) configClasses (configFile >> "CfgWeapons")) apply {configName _x};
if (_lasers isNotEqualTo []) then { WARNING_1("%1 attachements still using unsupported ACE_laserpointer config",count _lasers) };
uiNamespace setVariable [QGVAR(oldLasers), compileFinal (_lasers createHashMapFromArray [])];

View File

@ -76,7 +76,6 @@ ace_detonator
ace_barrelTwist ace_barrelTwist
ace_twistDirection ace_twistDirection
ace_barrelLength ace_barrelLength
ace_laserpointer
ace_nextmodeclass ace_nextmodeclass
ace_modedescription ace_modedescription
ace_hearing_protection ace_hearing_protection