-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d397efe
commit 9d87533
Showing
12 changed files
with
80 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
PREP(findTurret); | ||
PREP(getPilotCamVector); | ||
PREP(getTurretVector); | ||
PREP(onAircraftInit); | ||
PREP(onLaserOff); | ||
PREP(onLaserOn); | ||
PREP(renderPFH); | ||
PREP(updatePFH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,39 @@ | ||
#include "script_component.hpp" | ||
#include "\a3\ui_f\hpp\defineDIKCodes.inc" | ||
|
||
// Events | ||
[QGVAR(laserOn), LINKFUNC(onLaserOn)] call CBA_fnc_addEventHandler; | ||
[QGVAR(laserOff), LINKFUNC(onLaserOff)] call CBA_fnc_addEventHandler; | ||
if (!hasInterface) exitWith {}; | ||
|
||
// Keybinds | ||
["ACE3 Vehicles", QGVAR(toggleLaser), LLSTRING(ToggleLaser), { | ||
// Ignore when in Zeus | ||
if (!isNull curatorCamera) exitWith {}; | ||
if (!isNull curatorCamera) exitWith {false}; | ||
|
||
private _vehicle = cameraOn; | ||
if !(_vehicle getVariable [QGVAR(enabled), false]) exitWith {false}; | ||
|
||
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), []]; | ||
_controlledUnit == _vehicle turretUnit _turretInfo # 0 | ||
} else { | ||
_controlledUnit == driver _vehicle | ||
}; | ||
|
||
if (_canTurnOn) then { | ||
if (_vehicle getVariable [QGVAR(laserOn), false]) then { | ||
[QGVAR(laserOff), [_vehicle]] call CBA_fnc_globalEvent; | ||
} else { | ||
[QGVAR(laserOn), [_vehicle]] call CBA_fnc_globalEvent; | ||
}; | ||
|
||
true | ||
} else { | ||
false | ||
}; | ||
}, "", [DIK_L, [false, false, true]]] call CBA_fnc_addKeybind; | ||
|
||
// JIP init | ||
if (didJIP) then { | ||
{ | ||
if (_x getVariable [QGVAR(laserOn), false]) then { | ||
[_x] call FUNC(onLaserOn); | ||
}; | ||
} forEach (allMissionObjects "Air"); | ||
}; | ||
private _turretInfo = _vehicle getVariable [QGVAR(turretInfo), []]; | ||
private _canTurnOn = _controlledUnit == _vehicle turretUnit _turretInfo; | ||
if (!_canTurnOn) exitWith { false }; | ||
|
||
playSound "ACE_Sound_Click"; | ||
private _current = _vehicle getVariable [QGVAR(laserOn), false]; | ||
_vehicle setVariable [QGVAR(laserOn), !_current, true]; | ||
true | ||
}, "", [DIK_L, [false, false, true]]] call CBA_fnc_addKeybind; // ALT-L | ||
|
||
["CBA_settingsInitialized", { | ||
TRACE_1("settingsInitialized",1); | ||
|
||
GVAR(pfEH) = -1; | ||
["visionMode", LINKFUNC(onLaserOn), true] call CBA_fnc_addPlayerEventHandler; | ||
["ace_laserOn", { | ||
params ["", "_args"]; | ||
_args params ["_object"]; | ||
if !(_object getVariable [QGVAR(enabled), false]) exitWith {}; | ||
_object setVariable [QGVAR(smoothing), []]; | ||
|
||
[] call LINKFUNC(onLaserOn); | ||
}] call CBA_fnc_addEventHandler; | ||
}] call CBA_fnc_addEventHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.