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:
|
|
|
|
* 0: Glasses classname to be applied <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [goggles ace_player] call ace_goggles_fnc_ApplyGlassesEffect;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-18 21:50:45 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
private["_postProcessColour", "_postProcessTintAmount", "_glassesClassname", "_glassImagePath"];
|
|
|
|
|
2015-02-02 09:04:53 +00:00
|
|
|
_glassesClassname = _this select 0;
|
2015-01-18 19:43:51 +00:00
|
|
|
_postProcessColour = getArray(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Color");
|
|
|
|
_postProcessTintAmount = getNumber(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_TintAmount");
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-18 21:50:45 +00:00
|
|
|
call FUNC(removeGlassesEffect);
|
|
|
|
GVAR(EffectsActive) = true;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-18 21:50:45 +00:00
|
|
|
if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then {
|
2015-01-11 16:42:31 +00:00
|
|
|
_postProcessColour set [3, _postProcessTintAmount/100];
|
2015-01-18 21:50:45 +00:00
|
|
|
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;
|
2015-01-18 23:04:32 +00:00
|
|
|
_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
|
|
|
};
|
|
|
|
|
2015-01-18 19:43:51 +00:00
|
|
|
_glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Overlay");
|
2015-01-11 16:42:31 +00:00
|
|
|
if GETBROKEN then {
|
2015-01-18 19:43:51 +00:00
|
|
|
_glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_OverlayCracked");
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
if (_glassImagePath != "") then {
|
2015-01-18 19:43:51 +00:00
|
|
|
150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
|
2015-01-11 16:42:31 +00:00
|
|
|
(GLASSDISPLAY displayCtrl 10650) ctrlSetText _glassImagePath;
|
|
|
|
};
|
|
|
|
|
|
|
|
if GETDIRT then {
|
2015-01-18 21:50:45 +00:00
|
|
|
call FUNC(applyDirtEffect);
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if GETDUSTT(DACTIVE) then {
|
|
|
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
2015-01-18 21:50:45 +00:00
|
|
|
call FUNC(applyDust);
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|