Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/spike/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ class CfgAmmo {
alwaysDesignate = 0; // always designate
canStopDesignating = 0;

enabledThermalTypes[] = { "white_hot_black_cold", "black_hot_white_cold" };
initialThermalType = "white_hot_black_cold";
enabledThermalTypes[] = { "normal", "white_hot_black_cold", "black_hot_white_cold" };
initialThermalType = "normal";

class reticle {
titleRsc = "ACE_guidance_spike";
Expand Down
19 changes: 19 additions & 0 deletions addons/spike/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,23 @@ if (hasInterface) then {
GVAR(activeCamera) = objNull;
GVAR(projectileHashMap) = createHashMap; // used in the seeker to get the namespace for the associated projectile
GVAR(launcherWeapons) = createHashMap; // Used to quickly determine whether the current weapon is a Spike launcher

// Define the B&W ppEffect for the visual seeker view mode
GVAR(ppEffectBW) = ppEffectCreate ["ColorCorrections", 1500];
GVAR(ppEffectBW) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 0], [0.33, 0.33, 0.33, 0]];
GVAR(ppEffectBW) ppEffectCommit 0;
GVAR(ppEffectBW) ppEffectEnable false;

// Stores launcher view mode, to auto-set the missile's post-launch
GVAR(visionMode) = "normal";
ace_player addEventHandler ["VisionModeChanged", {
params ["", "_visionMode", "_TIindex"];

if (cameraView isNotEqualTo "GUNNER") exitWith {};

if (_visionMode == 2) then { // If thermal, add specific thermal submode to index
_visionMode = _TIindex + 1;
};
GVAR(visionMode) = ["normal", "white_hot_black_cold", "black_hot_white_cold"] select _visionMode;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this hard coded. Pull array from here and store into a static array somewhere

}];
};
2 changes: 1 addition & 1 deletion addons/spike/functions/fnc_camera_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if (_designating) then {
_activeCameraNamespace setVariable [QGVAR(reticleData), _reticleData];
_shooter setVariable [QGVAR(missileCamera), _activeCameraNamespace];
_activeCameraNamespace setVariable [QGVAR(shooter), _shooter];
[_activeCameraNamespace, _initialThermalType] call FUNC(camera_setViewMode);
[_activeCameraNamespace, GVAR(visionMode)] call FUNC(camera_setViewMode);

private _pos = getPosASL _projectile;

Expand Down
15 changes: 11 additions & 4 deletions addons/spike/functions/fnc_camera_setViewMode.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ params ["_cameraNamespace", "_viewMode"];
private _userInCamera = [] call FUNC(camera_userInCamera);

if (_userInCamera) then {
GVAR(ppEffectBW) ppEffectEnable false;
camUseNVG false;
false setCamUseTI (_cameraNamespace getVariable [QGVAR(tiMode), 0]);
};
Expand All @@ -29,11 +30,17 @@ if (_thermalMode > 1) then {
if (_userInCamera) then {
true setCamUseTI (_thermalMode - 2);
};
};
if (_thermalMode == 1) then {
if (_userInCamera) then {
camUseNVG true;
} else {
if (_thermalMode == 1) then {
if (_userInCamera) then {
camUseNVG true;
};
} else {
GVAR(ppEffectBW) ppEffectEnable true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new mode called b&w. this camera script is meant to be pulled out at somepoint to allow for MITL seekers of different types. No hardcoding for spike allowed

};
};
_cameraNamespace setVariable [QGVAR(tiMode), _thermalMode - 2];
_cameraNamespace setVariable [QGVAR(tiModeString), _viewMode];

private _thermalIndex = (_cameraNamespace getVariable [QGVAR(thermalTypes), []]) findIf { _viewMode isEqualTo _x };
_cameraNamespace setVariable [QGVAR(currentTIModeIndex), _thermalIndex];
12 changes: 12 additions & 0 deletions addons/spike/functions/fnc_mapHelperDraw.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ if (isNil QGVAR(arguments)) then {
if (cameraView isEqualTo "GUNNER") then {
GVAR(arguments) set [0, diag_frameNo];

private _visionMode = currentVisionMode ace_player;
// If the current mode is normal, but thermal was cached, recover to normal. This happens when selecting a thermal mode, dropping and picking the launcher back up.
if (GVAR(visionMode) != "normal" && _visionMode == 0) then { GVAR(visionMode) = "normal"; };

// Toggle Black&White effect depending on vision mode
if (_visionMode == 0) then {
GVAR(ppEffectBW) ppEffectEnable true;
} else {
GVAR(ppEffectBW) ppEffectEnable false;
};

__SPIKE_RETICLE ctrlShow true;
GVAR(arguments) params ["", "_targetPosition"];

Expand Down Expand Up @@ -94,6 +105,7 @@ if (cameraView isEqualTo "GUNNER") then {

__SPIKE_RETICLE ctrlCommit 0;
} else {
GVAR(ppEffectBW) ppEffectEnable false;
__SPIKE_RETICLE ctrlShow false;
(__SPIKE_DISPLAY displayCtrl 241000) ctrlShow false;
};