This commit is contained in:
johnb432 2024-07-20 21:51:11 +02:00
parent 4f726d6bc0
commit 1321c03a6e
14 changed files with 30 additions and 30 deletions

View File

@ -1,4 +1,4 @@
class CfgIRLaserSettings {
laserMaxRange = 3000; // 4000 is max range of the laser in engine
laserMaxRange = LASER_MAX; // 4000 is max range of the laser in engine
maxViewDistance = 6000;
};

View File

@ -1,5 +1,3 @@
class CBA_Extended_EventHandlers_base;
class CfgVehicles {
class AllVehicles;
class Air: AllVehicles {
@ -10,8 +8,8 @@ class CfgVehicles {
property = QGVAR(enabled);
control = "Checkbox";
typeName = "BOOL";
expression = QUOTE(_this setVariable [ARR_3('GVAR(enabled)',_value,true)]);
defaultValue = "(true)";
expression = QUOTE(_this setVariable [ARR_3(QQGVAR(enabled),_value,true)]);
defaultValue = "true";
condition = "objectVehicle";
};
};

View File

@ -2,15 +2,18 @@
#include "\a3\ui_f\hpp\defineDIKCodes.inc"
// Events
[QGVAR(laserOn), FUNC(onLaserOn)] call CBA_fnc_addEventHandler;
[QGVAR(laserOff), FUNC(onLaserOff)] call CBA_fnc_addEventHandler;
[QGVAR(laserOn), LINKFUNC(onLaserOn)] call CBA_fnc_addEventHandler;
[QGVAR(laserOff), LINKFUNC(onLaserOff)] call CBA_fnc_addEventHandler;
// Keybinds
["ACE3 Vehicles", QGVAR(toggleLaser), localize LSTRING(ToggleLaser), {
["ACE3 Vehicles", QGVAR(toggleLaser), LLSTRING(ToggleLaser), {
// Ignore when in Zeus
if (!isNull curatorCamera) exitWith {};
private _vehicle = cameraOn;
if !(_vehicle getVariable [QGVAR(enabled), false]) exitWith {false};
private _controlledUnit = [ACE_player, ACE_controlledUAV#1] select unitIsUAV _vehicle;
private _controlledUnit = [ACE_player, ACE_controlledUAV # 1] select (unitIsUAV _vehicle);
private _canTurnOn = if (_vehicle getVariable [QGVAR(useTurret), false]) then {
private _turretInfo = _vehicle getVariable [QGVAR(turretInfo), []];

View File

@ -6,7 +6,7 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.sqf"
#include "initSettings.inc.sqf"
GVAR(lasers) = [];
GVAR(localLasers) = [];

View File

@ -1,4 +1,4 @@
#include "script_component.hpp"
#include "..\script_component.hpp"
/*
* Author: BaerMitUmlaut
* Finds the turret that has control over the marking laser.
@ -34,7 +34,7 @@ private _walkTurrets = {
// Check if turret has a optics with night or thermal vision
private _visionModes = flatten (("true" configClasses (_x >> "OpticsIn")) apply {
(getArray (_x >> "visionMode")) apply {toLower _x}
(getArray (_x >> "visionMode")) apply {toLowerANSI _x}
});
if !("nvg" in _visionModes || {"ti" in _visionModes}) then {

View File

@ -1,4 +1,4 @@
#include "script_component.hpp"
#include "..\script_component.hpp"
/*
* Author: BaerMitUmlaut
* Calculates the directional vector of a pilot camera mounted marking laser.

View File

@ -1,4 +1,4 @@
#include "script_component.hpp"
#include "..\script_component.hpp"
/*
* Author: BaerMitUmlaut
* Calculates the directional vector of a turret mounted marking laser.

View File

@ -1,4 +1,4 @@
#include "script_component.hpp"
#include "..\script_component.hpp"
/*
* Author: BaerMitUmlaut
* Equips an aircraft with a marking laser.

View File

@ -1,4 +1,4 @@
#include "script_component.hpp"
#include "..\script_component.hpp"
/*
* Author: BaerMitUmlaut
* Handles a plane turning its marking laser on.

View File

@ -1,4 +1,4 @@
#include "script_component.hpp"
#include "..\script_component.hpp"
/*
* Author: BaerMitUmlaut
* Handles a plane turning its marking laser off.
@ -19,14 +19,14 @@ params ["_aircraft"];
// Start PFHs if this is the first laser
if (local _aircraft && {GVAR(updatePFH) == -1}) then {
GVAR(updatePFH) = [FUNC(updatePFH), 1, []] call CBA_fnc_addPerFrameHandler;
GVAR(updatePFH) = [LINKFUNC(updatePFH), 1, []] call CBA_fnc_addPerFrameHandler;
// Make sure update is called before first render
[] call FUNC(updatePFH);
};
if (hasInterface && {GVAR(renderPFH) == -1}) then {
GVAR(renderPFH) = [FUNC(renderPFH), 0, []] call CBA_fnc_addPerFrameHandler;
GVAR(renderPFH) = [LINKFUNC(renderPFH), 0, []] call CBA_fnc_addPerFrameHandler;
};
GVAR(lasers) pushBack _aircraft;

View File

@ -1,4 +1,4 @@
#include "script_component.hpp"
#include "..\script_component.hpp"
/*
* Author: BaerMitUmlaut
* Renders all marking lasers.
@ -18,7 +18,7 @@
if (GVAR(lasers) isEqualTo []) exitWith {};
#ifndef DEBUG_MODE_FULL
private _controlledUnit = [ACE_player, ACE_controlledUAV#1] select unitIsUAV cameraOn;
private _controlledUnit = [ACE_player, ACE_controlledUAV # 1] select (unitIsUAV cameraOn);
if (currentVisionMode _controlledUnit != 1 && {
(!isNull curatorCamera) && {
(_curator getVariable ["BIS_fnc_curatorVisionModes_current", 0]) != 0

View File

@ -1,4 +1,4 @@
#include "script_component.hpp"
#include "..\script_component.hpp"
/*
* Author: BaerMitUmlaut
* Sends network updates for all local marking lasers.

View File

@ -1 +0,0 @@
#include "\z\ace\addons\markinglaser\script_component.hpp"

View File

@ -4,5 +4,5 @@
[LSTRING(Setting_Enabled_DisplayName), LSTRING(Setting_Enabled_Description)],
ELSTRING(common,ACEKeybindCategoryVehicles),
true,
true
1
] call CBA_fnc_addSetting;