2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-02-02 09:04:53 +00:00
|
|
|
* Author: Garth 'L-H' de Wet
|
|
|
|
* Sets screen tint for glasses.
|
|
|
|
* Sets screen overlay for glasses. (broken/fixed)
|
|
|
|
* Sets dirt/rain overlay for glasses.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2017-04-11 15:06:29 +00:00
|
|
|
* 0: Player <OBJECT>
|
|
|
|
* 1: Glasses classname to be applied <STRING>
|
2015-02-02 09:04:53 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2017-04-11 15:06:29 +00:00
|
|
|
* [ace_player, goggles ace_player] call ace_goggles_fnc_applyGlassesEffect
|
2015-02-02 09:04:53 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-09-09 15:05:48 +00:00
|
|
|
|
2017-04-11 15:06:29 +00:00
|
|
|
params ["_player", "_glasses"];
|
|
|
|
TRACE_2("applyGlassesEffect",_player,_glasses);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-09-29 17:51:41 +00:00
|
|
|
// remove old effect
|
2015-01-18 21:50:45 +00:00
|
|
|
call FUNC(removeGlassesEffect);
|
2015-09-29 17:51:41 +00:00
|
|
|
|
2017-04-11 15:06:29 +00:00
|
|
|
if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _player) >> "isPlayableLogic")) == 1) exitWith {
|
|
|
|
TRACE_1("skipping playable logic",typeOf _player); // VirtualMan_F (placeable logic zeus / spectator)
|
|
|
|
};
|
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _config = configFile >> "CfgGlasses" >> _glasses;
|
2015-09-29 17:51:41 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _postProcessColour = getArray (_config >> "ACE_Color");
|
|
|
|
private _postProcessTintAmount = getNumber (_config >> "ACE_TintAmount");
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2020-07-22 15:24:43 +00:00
|
|
|
if (_postProcessTintAmount != 0 && {GVAR(UsePP)} && GVAR(effects) in [1, 2]) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
_postProcessColour set [3, _postProcessTintAmount/100];
|
|
|
|
GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]];
|
|
|
|
GVAR(PostProcess) ppEffectCommit 0;
|
|
|
|
GVAR(PostProcess) ppEffectEnable true;
|
|
|
|
_postProcessColour set [3, _postProcessTintAmount/250];
|
|
|
|
GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]];
|
|
|
|
GVAR(PostProcess) ppEffectCommit 30;
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _imagePath = getText (_config >> ["ACE_Overlay", "ACE_OverlayCracked"] select GETBROKEN);
|
2015-09-29 17:51:41 +00:00
|
|
|
|
|
|
|
if (_imagePath != "") then {
|
2015-09-29 20:24:25 +00:00
|
|
|
GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false];
|
2015-09-29 17:51:41 +00:00
|
|
|
(GLASSDISPLAY displayCtrl 10650) ctrlSetText _imagePath;
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
2020-07-22 15:24:43 +00:00
|
|
|
if (GVAR(effects) in [2, 3]) then {
|
2016-06-26 00:16:26 +00:00
|
|
|
if (GETDIRT) then {
|
|
|
|
call FUNC(applyDirtEffect);
|
|
|
|
};
|
|
|
|
|
|
|
|
if (GETDUSTT(DACTIVE)) then {
|
|
|
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
|
|
|
call FUNC(applyDustEffect);
|
|
|
|
};
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
2015-09-29 17:51:41 +00:00
|
|
|
|
|
|
|
GVAR(EffectsActive) = true;
|