mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Converted Goggles to use ACE/CBA macros.
This commit is contained in:
parent
0f04d0dfb1
commit
fc18cb443f
1
addons/goggles/$PBOPREFIX$
Normal file
1
addons/goggles/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\goggles
|
10
addons/goggles/CfgEventHandlers.hpp
Normal file
10
addons/goggles/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,10 @@
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
@ -1,25 +0,0 @@
|
||||
class CfgFunctions{
|
||||
class ACE_Goggles{
|
||||
class ACE_Goggles{
|
||||
file="ACE_Goggles\functions";
|
||||
class Init{postInit = 1;};
|
||||
class ApplyGlassesEffect;
|
||||
class RemoveGlassesEffect;
|
||||
class ApplyDirtEffect;
|
||||
class RemoveDirtEffect;
|
||||
class isGogglesVisible;
|
||||
class isDivingGoggles;
|
||||
class ClearGlasses;
|
||||
class CheckGoggles;
|
||||
class GetExplosionIndex;
|
||||
class RainEffect;
|
||||
class RemoveRainEffect;
|
||||
class DustHandler;
|
||||
class ExternalCamera;
|
||||
class isInRotorWash;
|
||||
class OnEachFrame;
|
||||
class ApplyDust;
|
||||
class RemoveDustEffect;
|
||||
};
|
||||
};
|
||||
};
|
108
addons/goggles/XEH_postInit.sqf
Normal file
108
addons/goggles/XEH_postInit.sqf
Normal file
@ -0,0 +1,108 @@
|
||||
/*
|
||||
Name: XEH_postInit.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Sets up the glasses mod for usage. Initialises variables and event handlers.
|
||||
Shouldn't be called by a user/modder ever. Done by the engine.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
if isNil(QGAR(UsePP)) then {
|
||||
GVAR(UsePP) = true;
|
||||
};
|
||||
|
||||
GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995];
|
||||
GVAR(PostProcessEyes) = ppEffectCreate ["ColorCorrections", 1992];
|
||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
|
||||
GVAR(PostProcessEyes) ppEffectCommit 0;
|
||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||
GVAR(EffectsActive) = false;
|
||||
GVAR(Effects) = GLASSESDEFAULT;
|
||||
GVAR(Current) = "None";
|
||||
GVAR(EyesDamageScript) = 0 spawn {};
|
||||
GVAR(FrameEvent) = [false, [false,20]];
|
||||
GVAR(PostProcessEyes_Enabled) = false;
|
||||
GVAR(DustHandler) = 0 spawn {};
|
||||
GVAR(RainDrops) = objNull;
|
||||
|
||||
FUNC(CheckGlasses) = {
|
||||
if (GVAR(Current) != (goggles ace_player)) then {
|
||||
GVAR(Current) = (goggles ace_player);
|
||||
["GlassesChanged",[GVAR(Current)]] call CBA_fnc_localEvent;
|
||||
};
|
||||
};
|
||||
|
||||
ace_player addEventHandler ["Explosion", {
|
||||
if (alive ace_player) then {
|
||||
call FUNC(ApplyDirtEffect);
|
||||
if (GETBROKEN) exitWith {};
|
||||
if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {};
|
||||
if !(ace_player call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call CBA_fnc_localEvent;};
|
||||
GVAR(Effects) set [BROKEN, true];
|
||||
if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then {
|
||||
if (call FUNC(ExternalCamera)) exitWith {};
|
||||
if (isNull(GLASSDISPLAY)) then {
|
||||
150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
|
||||
};
|
||||
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked");
|
||||
};
|
||||
["GlassesCracked",[ace_player]] call CBA_fnc_localEvent;
|
||||
};
|
||||
}];
|
||||
ace_player addEventHandler ["Killed",{
|
||||
[] spawn {
|
||||
sleep 2;
|
||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||
GVAR(Effects) = GLASSESDEFAULT;
|
||||
call FUNC(removeGlassesEffect);
|
||||
GVAR(EffectsActive)=false;
|
||||
ace_player setVariable ["ACE_EyesDamaged", false];
|
||||
terminate GVAR(EyesDamageScript);
|
||||
terminate GVAR(MainLoop);
|
||||
terminate GVAR(DustHandler);
|
||||
GVAR(MainLoop) = [] spawn FUNC(checkGoggles);
|
||||
};
|
||||
}];
|
||||
ace_player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}];
|
||||
ace_player AddEventHandler ["Take",{call FUNC(checkGlasses);}];
|
||||
ace_player AddEventHandler ["Put", {call FUNC(checkGlasses);}];
|
||||
|
||||
["GlassesChanged",{
|
||||
GVAR(Effects) = GLASSESDEFAULT;
|
||||
|
||||
if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
|
||||
|
||||
if (ace_player call FUNC(isGogglesVisible)) then {
|
||||
(_this select 0) call FUNC(applyGlassesEffect);
|
||||
} else {
|
||||
call FUNC(removeGlassesEffect);
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
["GlassesCracked",{
|
||||
if (_this select 0 != ace_player) exitWith {};
|
||||
ace_player setVariable ["ACE_EyesDamaged", true];
|
||||
if !(scriptDone GVAR(EyesDamageScript)) then {
|
||||
terminate GVAR(EyesDamageScript);
|
||||
};
|
||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
|
||||
GVAR(PostProcessEyes) ppEffectCommit 0;
|
||||
GVAR(PostProcessEyes) ppEffectEnable true;
|
||||
GVAR(EyesDamageScript) = [] spawn {
|
||||
sleep 25;
|
||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
|
||||
GVAR(PostProcessEyes) ppEffectCommit 5;
|
||||
sleep 5;
|
||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||
ace_player setVariable ["ACE_EyesDamaged", false];
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
GVAR(MainLoop) = [] spawn FUNC(CheckGoggles);
|
23
addons/goggles/XEH_preInit.sqf
Normal file
23
addons/goggles/XEH_preInit.sqf
Normal file
@ -0,0 +1,23 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
PREP(applyDirtEffect);
|
||||
PREP(applyDust);
|
||||
PREP(applyGlassesEffect);
|
||||
|
||||
PREP(checkGoggles);
|
||||
PREP(clearGlasses);
|
||||
PREP(dustHandler);
|
||||
PREP(externalCamera);
|
||||
PREP(getExplosionIndex);
|
||||
|
||||
PREP(isDivingGoggles);
|
||||
PREP(isGogglesVisible);
|
||||
PREP(isInRotorWash);
|
||||
|
||||
PREP(onEachFrame);
|
||||
PREP(rainEffect);
|
||||
|
||||
PREP(removeDirtEffect);
|
||||
PREP(removeDustEffect);
|
||||
PREP(removeGlassesEffect);
|
||||
PREP(removeRainEffect);
|
@ -1,21 +1,22 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define COLOUR 8.0
|
||||
class CfgPatches {
|
||||
class ACE_Goggles {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {ACE_Core};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"Garth 'L-H' de Wet"};
|
||||
authorUrl = "https://github.com/CorruptedHeart";
|
||||
authorUrl = "http://garth.snakebiteink.co.za/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgFunctions.hpp"
|
||||
#define COMBAT_GOGGLES ACE_Overlay="ACE_Goggles\textures\HUD\CombatGoggles.paa"; \
|
||||
ACE_OverlayCracked = "ACE_Goggles\textures\HUD\CombatGogglesCracked.paa"; \
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
#define COMBAT_GOGGLES ACE_Overlay = QUOTE(PATHTOF(textures\HUD\CombatGoggles.paa)); \
|
||||
ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\CombatGogglesCracked.paa)); \
|
||||
ACE_Resistance = 2; \
|
||||
ACE_Protection = 1;
|
||||
|
||||
@ -25,10 +26,10 @@ class CfgGlasses {
|
||||
ACE_TintAmount=0;
|
||||
ACE_Overlay = "";
|
||||
ACE_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa";
|
||||
ACE_OverlayCracked = "ACE_Goggles\textures\HUD\Cracked.paa";
|
||||
ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\Cracked.paa));
|
||||
ACE_Resistance = 0;
|
||||
ACE_Protection = 0;
|
||||
ACE_DustPath = "ACE_Goggles\textures\fx\dust\%1.paa";
|
||||
ACE_DustPath = QUOTE(PATHTOF(textures\fx\dust\%1.paa));
|
||||
};
|
||||
|
||||
class G_Combat:None {
|
||||
@ -36,8 +37,8 @@ class CfgGlasses {
|
||||
};
|
||||
|
||||
class G_Diving {
|
||||
ACE_Overlay="ACE_Goggles\textures\HUD\DivingGoggles.paa";
|
||||
ACE_OverlayCracked = "ACE_Goggles\textures\HUD\DivingGogglesCracked.paa";
|
||||
ACE_Overlay = QUOTE(PATHTOF(textures\HUD\DivingGoggles.paa));
|
||||
ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\DivingGogglesCracked.paa));
|
||||
ACE_Resistance = 2;
|
||||
ACE_Protection = 1;
|
||||
};
|
||||
@ -167,19 +168,19 @@ class CfgGlasses {
|
||||
class AV_ESS_blk:None{
|
||||
COMBAT_GOGGLES
|
||||
};
|
||||
|
||||
|
||||
class G_Balaclava_blk;
|
||||
|
||||
|
||||
class G_Balaclava_combat:G_Balaclava_blk {
|
||||
COMBAT_GOGGLES
|
||||
};
|
||||
|
||||
|
||||
class G_Balaclava_lowprofile:G_Balaclava_blk {
|
||||
ACE_TintAmount=COLOUR*2;
|
||||
ACE_Resistance = 2;
|
||||
ACE_Protection = 1;
|
||||
};
|
||||
|
||||
|
||||
class G_Bandanna_blk;
|
||||
class G_Bandanna_shades:G_Bandanna_blk {
|
||||
ACE_TintAmount=COLOUR*2;
|
||||
@ -202,28 +203,23 @@ class CfgGlasses {
|
||||
|
||||
#include "RscTitles.hpp"
|
||||
|
||||
class CfgMovesBasic
|
||||
{
|
||||
class ManActions
|
||||
{
|
||||
class CfgMovesBasic {
|
||||
class ManActions {
|
||||
GestureWipeFace[] = {"GestureWipeFace", "gesture"};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgGesturesMale
|
||||
{
|
||||
class States
|
||||
{
|
||||
class CfgGesturesMale {
|
||||
class States {
|
||||
class GestureFreezeStand;
|
||||
class GestureWipeFace: GestureFreezeStand
|
||||
{
|
||||
file = "\ACE_Goggles\anim\WipeGlasses.rtm";
|
||||
class GestureWipeFace: GestureFreezeStand {
|
||||
file = QUOTE(PATHTOF(anim\WipeGlasses.rtm));
|
||||
canPullTrigger = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgWeapons{
|
||||
class CfgWeapons {
|
||||
class H_HelmetB;
|
||||
|
||||
class H_CrewHelmetHeli_B:H_HelmetB {
|
||||
@ -247,11 +243,12 @@ class SniperCloud {
|
||||
ACE_Goggles_BulletCount = 1;
|
||||
};
|
||||
|
||||
class ACE_Core_Default_Keys {
|
||||
class ACE_Default_Keys {
|
||||
class wipeGlasses {
|
||||
displayName = $STR_ACE_Goggles_WipeGlasses;
|
||||
condition = "!(player getVariable['ACE_isUnconscious', false])";
|
||||
statement = "call ACE_Goggles_fnc_ClearGlasses;";
|
||||
//condition = QUOTE(!(GETVAR(ace_player,isUnconscious,false)));
|
||||
condition = "true";
|
||||
statement = QUOTE(call FUNC(clearGlasses););
|
||||
key = 20; // T
|
||||
shift = 1;
|
||||
control = 1;
|
||||
@ -259,7 +256,7 @@ class ACE_Core_Default_Keys {
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Core_Options {
|
||||
class ACE_Options {
|
||||
class showInThirdPerson {
|
||||
displayName = $STR_ACE_Goggles_ShowInThirdPerson;
|
||||
default = 0;
|
||||
|
@ -6,22 +6,21 @@
|
||||
//Base Classes//
|
||||
////////////////
|
||||
|
||||
class RscPicture
|
||||
{
|
||||
access = 0;
|
||||
idc = -1;
|
||||
type = CT_STATIC;
|
||||
style = ST_PICTURE;
|
||||
colorBackground[] = {0,0,0,0};
|
||||
colorText[] = {1,1,1,1};
|
||||
font = "puristaMedium";
|
||||
sizeEx = 0;
|
||||
lineSpacing = 0;
|
||||
fixedWidth = 0;
|
||||
shadow = 0;
|
||||
text = "";
|
||||
x = safezoneX;
|
||||
y = safezoneY;
|
||||
w = safezoneW;
|
||||
h = safezoneH;
|
||||
class RscPicture {
|
||||
access = 0;
|
||||
idc = -1;
|
||||
type = CT_STATIC;
|
||||
style = ST_PICTURE;
|
||||
colorBackground[] = {0,0,0,0};
|
||||
colorText[] = {1,1,1,1};
|
||||
font = "puristaMedium";
|
||||
sizeEx = 0;
|
||||
lineSpacing = 0;
|
||||
fixedWidth = 0;
|
||||
shadow = 0;
|
||||
text = "";
|
||||
x = safezoneX;
|
||||
y = safezoneY;
|
||||
w = safezoneW;
|
||||
h = safezoneH;
|
||||
};
|
||||
|
@ -1,32 +0,0 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_ApplyDirtEffect
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Adds dirt effect to the glasses.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
BOOLEAN - True if succeeded false if not
|
||||
|
||||
Example:
|
||||
call ACE_Goggles_fnc_ApplyDirtEffect;
|
||||
*/
|
||||
#include "\ACE_Goggles\script.sqf"
|
||||
|
||||
if (cameraOn != player || call ACE_Goggles_fnc_ExternalCamera) exitWith{false};
|
||||
private "_dirtImage";
|
||||
ACE_Goggles_Effects set [DIRT, true];
|
||||
|
||||
if (player call ACE_Goggles_fnc_isGogglesVisible) then{
|
||||
_dirtImage = getText(ConfigFile >> "CfgGlasses" >> goggles player >> "ACE_OverlayDirt");
|
||||
if (_dirtImage != "") then {
|
||||
100 cutRsc["RscACE_GogglesEffects", "PLAIN",0.1, false];
|
||||
(uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10660) ctrlSetText _dirtImage;
|
||||
};
|
||||
};
|
||||
|
||||
true
|
@ -1,52 +0,0 @@
|
||||
/*
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Performs rain checks and checks to see whether glasses effects have been applied or not.
|
||||
Checks for external camera and removes effects.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
[] execVM "ACE_Goggles\functions\fn_CheckGoggles.sqf";
|
||||
*/
|
||||
#include "\ACE_Goggles\script.sqf"
|
||||
waitUntil {sleep 0.46;alive player};
|
||||
call ACE_Goggles_fnc_CheckGlasses;
|
||||
["ACE_Goggles_RotorWash", "OnEachFrame", {call ACE_Goggles_fnc_OnEachFrame;}] call BIS_fnc_addStackedEventHandler;
|
||||
[] spawn ACE_Goggles_fnc_RainEffect;
|
||||
while {alive player} do {
|
||||
sleep 1;
|
||||
if (true) then {
|
||||
// Detect if curator interface is open and disable effects
|
||||
if (!isNull(findDisplay 312)) exitWith {
|
||||
if (ACE_Goggles_EffectsActive) then {
|
||||
call ACE_Goggles_fnc_RemoveGlassesEffect;
|
||||
};
|
||||
};
|
||||
call ACE_Goggles_fnc_CheckGlasses;
|
||||
if !(player call ACE_Goggles_fnc_isGogglesVisible) exitWith {
|
||||
if (ACE_Goggles_EffectsActive) then {
|
||||
call ACE_Goggles_fnc_RemoveGlassesEffect;
|
||||
};
|
||||
};
|
||||
if (call ACE_Goggles_fnc_ExternalCamera) exitWith {
|
||||
if (ACE_Goggles_EffectsActive) then {
|
||||
call ACE_Goggles_fnc_RemoveGlassesEffect;
|
||||
};
|
||||
};
|
||||
if !(ACE_Goggles_EffectsActive) then {
|
||||
(goggles player) call ACE_Goggles_fnc_ApplyGlassesEffect;
|
||||
} else {
|
||||
if ((goggles player) call ACE_Goggles_fnc_isDivingGoggles && {underwater player}) then {
|
||||
call ACE_Goggles_fnc_RemoveRainEffect;
|
||||
call ACE_Goggles_fnc_RemoveDirtEffect;
|
||||
call ACE_Goggles_fnc_RemoveDustEffect;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_ClearGlasses
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Clears all dirt, rain, dust from glasses.
|
||||
Removes glasses effect (PP, overlay) and then puts it back.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call ACE_Goggles_fnc_ClearGlasses;
|
||||
*/
|
||||
#include "\ACE_Goggles\script.sqf"
|
||||
|
||||
private "_broken";
|
||||
_broken = GETBROKEN;
|
||||
ACE_Goggles_Effects = GLASSESDEFAULT;
|
||||
ACE_Goggles_Effects set [BROKEN, _broken];
|
||||
|
||||
if ((stance player) != "PRONE") then {
|
||||
player playActionNow "gestureWipeFace";
|
||||
};
|
||||
|
||||
null = [] spawn {
|
||||
sleep 0.3;
|
||||
if (cameraView == "INTERNAL") then {
|
||||
addCamShake [5, 1.75, 2];
|
||||
};
|
||||
};
|
||||
|
||||
call ACE_Goggles_fnc_RemoveDirtEffect;
|
||||
call ACE_Goggles_fnc_RemoveRainEffect;
|
||||
call ACE_Goggles_fnc_RemoveDustEffect;
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_GetExplosionIndex
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Turns 0-1 damage into a rating system of 0-3
|
||||
|
||||
Parameters:
|
||||
0: NUMBER - The amount of damage
|
||||
|
||||
Returns:
|
||||
NUMBER (the rating) [0-3]
|
||||
|
||||
Example:
|
||||
_rating = 0.05 call ACE_Goggles_fnc_GetExplosionIndex
|
||||
*/
|
||||
private ["_effect", "_effectIndex"];
|
||||
_effect = _this;
|
||||
|
||||
_effectIndex = switch true do {
|
||||
case (_effect <= 0.04): {0};
|
||||
case (_effect <= 0.06): {1};
|
||||
case (_effect <= 0.09): {2};
|
||||
default {3};
|
||||
};
|
||||
|
||||
_effectIndex
|
@ -1,111 +0,0 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_Init
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Sets up the glasses mod for usage. Initialises variables and event handlers.
|
||||
Shouldn't be called by a user/modder ever. Done by the engine.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call ACE_Goggles_fnc_Init;
|
||||
*/
|
||||
if (!hasInterface) exitWith {};
|
||||
#include "\ACE_Goggles\script.sqf"
|
||||
|
||||
if isNil("ACE_Goggles_UsePP") then {
|
||||
ACE_Goggles_UsePP = true;
|
||||
};
|
||||
|
||||
ACE_Goggles_PostProcess = ppEffectCreate ["ColorCorrections", 1995];
|
||||
ACE_Goggles_PostProcessEyes = ppEffectCreate ["ColorCorrections", 1992];
|
||||
ACE_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
|
||||
ACE_Goggles_PostProcessEyes ppEffectCommit 0;
|
||||
ACE_Goggles_PostProcessEyes ppEffectEnable false;
|
||||
ACE_Goggles_EffectsActive = false;
|
||||
ACE_Goggles_Effects = GLASSESDEFAULT;
|
||||
ACE_Goggles_Current = "None";
|
||||
ACE_Goggles_EyesDamageScript = 0 spawn {};
|
||||
ACE_Goggles_FrameEvent = [false, [false,20]];
|
||||
ACE_Goggles_PostProcessEyes_Enabled = false;
|
||||
ACE_Goggles_DustHandler = 0 spawn {};
|
||||
ACE_Goggles_RainDrops = objNull;
|
||||
|
||||
ACE_Goggles_fnc_CheckGlasses = {
|
||||
if (ACE_Goggles_Current != (goggles player)) then {
|
||||
ACE_Goggles_Current = (goggles player);
|
||||
["GlassesChanged",[ACE_Goggles_Current]] call CBA_fnc_localEvent;
|
||||
};
|
||||
};
|
||||
|
||||
player addEventHandler ["Explosion", {
|
||||
if (alive player) then {
|
||||
call ACE_Goggles_fnc_ApplyDirtEffect;
|
||||
if (GETBROKEN) exitWith {};
|
||||
if (((_this select 1) call ACE_Goggles_fnc_GetExplosionIndex) < getNumber(ConfigFile >> "CfgGlasses" >> ACE_Goggles_Current >> "ACE_Resistance")) exitWith {};
|
||||
if !(player call ACE_Goggles_fnc_isGogglesVisible) exitWith {["GlassesCracked",[player]] call CBA_fnc_localEvent;};
|
||||
ACE_Goggles_Effects set [BROKEN, true];
|
||||
if (getText(ConfigFile >> "CfgGlasses" >> ACE_Goggles_Current >> "ACE_OverlayCracked") != "" && {cameraOn == player}) then {
|
||||
if (call ACE_Goggles_fnc_ExternalCamera) exitWith {};
|
||||
if (isNull(GLASSDISPLAY)) then {
|
||||
150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
|
||||
};
|
||||
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> ACE_Goggles_Current >> "ACE_OverlayCracked");
|
||||
};
|
||||
["GlassesCracked",[player]] call CBA_fnc_localEvent;
|
||||
};
|
||||
}];
|
||||
player addEventHandler ["Killed",{
|
||||
[] spawn {
|
||||
sleep 2;
|
||||
ACE_Goggles_PostProcessEyes ppEffectEnable false;
|
||||
ACE_Goggles_Effects = GLASSESDEFAULT;
|
||||
call ACE_Goggles_fnc_RemoveGlassesEffect;
|
||||
ACE_Goggles_EffectsActive=false;
|
||||
player setVariable ["ACE_EyesDamaged", false];
|
||||
terminate ACE_Goggles_EyesDamageScript;
|
||||
terminate ACE_Goggles_MainLoop;
|
||||
terminate ACE_Goggles_DustHandler;
|
||||
ACE_Goggles_MainLoop = [] spawn ACE_Goggles_fnc_CheckGoggles;
|
||||
};
|
||||
}];
|
||||
player addEventHandler ["Fired",{[_this select 0, _this select 1] call ACE_Goggles_fnc_DustHandler;}];
|
||||
player AddEventHandler ["Take",{call ACE_Goggles_fnc_CheckGlasses;}];
|
||||
player AddEventHandler ["Put", {call ACE_Goggles_fnc_CheckGlasses;}];
|
||||
|
||||
["GlassesChanged",{
|
||||
ACE_Goggles_Effects = GLASSESDEFAULT;
|
||||
|
||||
if (call ACE_Goggles_fnc_ExternalCamera) exitWith {call ACE_Goggles_fnc_RemoveGlassesEffect};
|
||||
|
||||
if (player call ACE_Goggles_fnc_isGogglesVisible) then {
|
||||
(_this select 0) call ACE_Goggles_fnc_ApplyGlassesEffect;
|
||||
} else {
|
||||
call ACE_Goggles_fnc_RemoveGlassesEffect;
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
["GlassesCracked",{
|
||||
if (_this select 0 != player) exitWith {};
|
||||
player setVariable ["ACE_EyesDamaged", true];
|
||||
if !(scriptDone ACE_Goggles_EyesDamageScript) then {
|
||||
terminate ACE_Goggles_EyesDamageScript;
|
||||
};
|
||||
ACE_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
|
||||
ACE_Goggles_PostProcessEyes ppEffectCommit 0;
|
||||
ACE_Goggles_PostProcessEyes ppEffectEnable true;
|
||||
ACE_Goggles_EyesDamageScript = [] spawn {
|
||||
sleep 25;
|
||||
ACE_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
|
||||
ACE_Goggles_PostProcessEyes ppEffectCommit 5;
|
||||
sleep 5;
|
||||
ACE_Goggles_PostProcessEyes ppEffectEnable false;
|
||||
player setVariable ["ACE_EyesDamaged", false];
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
ACE_Goggles_MainLoop = [] spawn ACE_Goggles_fnc_CheckGoggles;
|
@ -1,80 +0,0 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_OnEachFrame
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Runs every frame checking for helicopters.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
["ACE_Goggles_RotorWash", "OnEachFrame", "call ACE_Goggles_fnc_OnEachFrame;"] call BIS_fnc_addStackedEventHandler;
|
||||
*/
|
||||
#include "\ACE_Goggles\script.sqf"
|
||||
if (isNull(player)) then {
|
||||
["ACE_Goggles_RotorWash", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
|
||||
};
|
||||
ACE_Goggles_FrameEvent set [0, !(ACE_Goggles_FrameEvent select 0)];
|
||||
if (ACE_Goggles_FrameEvent select 0) exitWith {
|
||||
if (vehicle player != player && {!([player] call ACE_Core_fnc_isTurnedOut)}) exitWith {(ACE_Goggles_FrameEvent select 1) set [0, false]; };
|
||||
ACE_Goggles_FrameEvent set [1, ([player] call ACE_Goggles_fnc_isInRotorWash)];
|
||||
};
|
||||
private ["_rotorWash","_safe"];
|
||||
_rotorWash = ACE_Goggles_FrameEvent select 1;
|
||||
_safe = false;
|
||||
if !(_rotorWash select 0) exitWith {
|
||||
if (ACE_Goggles_PostProcessEyes_Enabled) then {
|
||||
ACE_Goggles_PostProcessEyes_Enabled = false;
|
||||
if (!scriptDone (ACE_Goggles_DustHandler)) then {
|
||||
terminate ACE_Goggles_DustHandler;
|
||||
};
|
||||
ACE_Goggles_DustHandler = [] spawn {
|
||||
ACE_Goggles_PostProcessEyes ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
|
||||
ACE_Goggles_PostProcessEyes ppEffectCommit 2;
|
||||
sleep 2;
|
||||
ACE_Goggles_PostProcessEyes ppEffectEnable false;
|
||||
};
|
||||
};
|
||||
};
|
||||
if ((headgear player) != "") then {
|
||||
_safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear player) >> "ACE_Protection") == 1);
|
||||
};
|
||||
if !(_safe) then {
|
||||
if !(player call ACE_Goggles_fnc_isGogglesVisible) exitWith{};
|
||||
if (GETDUSTT(DAMOUNT) < 2) then {
|
||||
if (!GETDUSTT(DACTIVE)) then {
|
||||
SETDUST(DACTIVE,true);
|
||||
call ACE_Goggles_fnc_ApplyDust;
|
||||
} else {
|
||||
if ((_rotorWash select 1) > 0.5) then {
|
||||
call ACE_Goggles_fnc_ApplyDust;
|
||||
};
|
||||
};
|
||||
};
|
||||
_safe = (getNumber (ConfigFile >> "CfgGlasses" >> ACE_Goggles_Current >> "ACE_Protection") == 1);
|
||||
};
|
||||
if (_safe) exitWith {};
|
||||
if ((_rotorWash select 1) <= 15) then {
|
||||
private "_scale";
|
||||
_scale = 0.7;
|
||||
if ((_rotorWash select 1) != 0) then {
|
||||
_scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3);
|
||||
} else {
|
||||
_scale = 0.1;
|
||||
};
|
||||
_scale = 1 - _scale;
|
||||
if (!scriptDone (ACE_Goggles_DustHandler)) then {
|
||||
terminate ACE_Goggles_DustHandler;
|
||||
};
|
||||
if !(player getVariable ["ACE_EyesDamaged", false]) then {
|
||||
ACE_Goggles_PostProcessEyes_Enabled = true;
|
||||
ACE_Goggles_PostProcessEyes ppEffectAdjust [1, 1, 0, [0,0,0,0], [_scale,_scale,_scale,_scale],[1,1,1,0]];
|
||||
ACE_Goggles_PostProcessEyes ppEffectCommit 0.5;
|
||||
ACE_Goggles_PostProcessEyes ppEffectEnable true;
|
||||
};
|
||||
};
|
@ -1,61 +0,0 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_RainEffect
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
[] spawn ACE_Goggles_fnc_RainEffect;
|
||||
*/
|
||||
#include "\ACE_Goggles\script.sqf"
|
||||
ACE_Goggles_RainDrops = objNull;
|
||||
ACE_Goggles_Rain_Active = false;
|
||||
_fnc_underCover = {
|
||||
private ["_pos", "_unit"];
|
||||
_unit = (_this select 0);
|
||||
if (vehicle _unit != _unit && {!([_unit] call ACE_Core_fnc_isTurnedOut)}) exitWith {true};
|
||||
_pos = eyePos _unit;
|
||||
((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])}
|
||||
};
|
||||
private ["_lastRain"];
|
||||
_lastRain = 0;
|
||||
while {alive player} do {
|
||||
sleep 0.5;
|
||||
if (isNull(findDisplay 312)) then {
|
||||
// Ignore if player is under water
|
||||
if (!ACE_Goggles_EffectsActive || {underwater player}) exitWith{call ACE_Goggles_fnc_RemoveRainEffect;};
|
||||
if (_lastRain != rain) then {
|
||||
call ACE_Goggles_fnc_RemoveRainEffect;
|
||||
_lastRain = rain;
|
||||
// Rain is happening
|
||||
if (_lastRain > 0.05 && {!([player] call _fnc_underCover)}) then {
|
||||
ACE_Goggles_Rain_Active = true;
|
||||
ACE_Goggles_RainDrops = "#particlesource" createVehicleLocal GetPos player;
|
||||
ACE_Goggles_RainDrops setParticleClass "ACERainEffect";
|
||||
ACE_Goggles_RainDrops setDropInterval (0.07 * (1.1 - _lastRain));
|
||||
ACE_Goggles_RainDrops attachTo [vehicle player,[0,0,0]];
|
||||
};
|
||||
}else{
|
||||
if (_lastRain > 0.05) then {
|
||||
if (ACE_Goggles_Rain_Active && {[player] call _fnc_underCover}) exitWith {
|
||||
call ACE_Goggles_fnc_RemoveRainEffect;
|
||||
};
|
||||
if (!ACE_Goggles_Rain_Active) then {
|
||||
_lastRain = -1;
|
||||
};
|
||||
};
|
||||
};
|
||||
}else{
|
||||
if (ACE_Goggles_Rain_Active) then {
|
||||
call ACE_Goggles_fnc_RemoveRainEffect;
|
||||
};
|
||||
};
|
||||
};
|
@ -1,20 +0,0 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_RemoveDirtEffect
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Removes dirt from the glasses.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call ACE_Goggles_fnc_RemoveDirtEffect;
|
||||
*/
|
||||
if (!isNull(uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull])) then {
|
||||
(uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10660) ctrlSetText "";
|
||||
};
|
@ -1,20 +0,0 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_RemoveDustEffect
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Removes dust from the glasses.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call ACE_Goggles_fnc_RemoveDustEffect;
|
||||
*/
|
||||
if (!isNull(uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull])) then {
|
||||
(uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText "";
|
||||
};
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_RemoveGlassesEffect
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Removes the glasses effect from the screen, removes dirt effect, removes rain effect,
|
||||
removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.)
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call ACE_Goggles_fnc_RemoveGlassesEffect;
|
||||
*/
|
||||
#include "\ACE_Goggles\script.sqf"
|
||||
ACE_Goggles_EffectsActive = false;
|
||||
ACE_Goggles_PostProcess ppEffectEnable false;
|
||||
|
||||
if (!isNull(GLASSDISPLAY)) then {
|
||||
GLASSDISPLAY closeDisplay 0;
|
||||
};
|
||||
|
||||
call ACE_Goggles_fnc_RemoveDirtEffect;
|
||||
call ACE_Goggles_fnc_RemoveRainEffect;
|
||||
call ACE_Goggles_fnc_RemoveDustEffect;
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_RemoveRainEffect
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Removes rain effects from the screen. Resets the rain array.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call ACE_Goggles_fnc_RemoveRainEffect;
|
||||
*/
|
||||
if (!isNull (ACE_Goggles_RainDrops)) then {
|
||||
deleteVehicle (ACE_Goggles_RainDrops);
|
||||
};
|
||||
ACE_Goggles_Rain_Active = false;
|
33
addons/goggles/functions/fnc_applyDirtEffect.sqf
Normal file
33
addons/goggles/functions/fnc_applyDirtEffect.sqf
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
ApplyDirtEffect
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Adds dirt effect to the glasses.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
BOOLEAN - True if succeeded false if not
|
||||
|
||||
Example:
|
||||
call FUNC(ApplyDirtEffect);
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (cameraOn != ace_player || {call FUNC(externalCamera)}) exitWith{false};
|
||||
private "_dirtImage";
|
||||
GVAR(Effects) set [DIRT, true];
|
||||
|
||||
if (ace_player call FUNC(isGogglesVisible)) then{
|
||||
_dirtImage = getText(ConfigFile >> "CfgGlasses" >> goggles ace_player >> "ACE_OverlayDirt");
|
||||
if (_dirtImage != "") then {
|
||||
100 cutRsc["RscACE_GogglesEffects", "PLAIN",0.1, false];
|
||||
|
||||
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage;
|
||||
};
|
||||
};
|
||||
|
||||
true
|
@ -1,63 +1,63 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_ApplyDust
|
||||
|
||||
Name: fnc_applyDust.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
|
||||
Description:
|
||||
Applies dust to screen.
|
||||
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
|
||||
Example 1:
|
||||
call ACE_Goggles_fnc_ApplyDust;
|
||||
call FUNC(ApplyDust);
|
||||
*/
|
||||
#include "\ACE_Goggles\script.sqf"
|
||||
if (call ACE_Goggles_fnc_ExternalCamera) exitWith {};
|
||||
if (player call ACE_Goggles_fnc_isGogglesVisible) exitWith {
|
||||
#include "script_component.hpp"
|
||||
if (call FUNC(ExternalCamera)) exitWith {};
|
||||
if (ace_player call FUNC(isGogglesVisible)) exitWith {
|
||||
100 cutRsc["RscACE_GogglesEffects", "PLAIN",2,false];
|
||||
(uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> ACE_Goggles_Current >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1];
|
||||
(uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1];
|
||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1));
|
||||
SETDUST(DBULLETS,0);
|
||||
};
|
||||
|
||||
if (player getVariable ["ACE_EyesDamaged", false]) exitWith {SETDUST(DACTIVE,false);SETDUST(DBULLETS,0);SETDUST(DAMOUNT,0);};
|
||||
if (GETVAR(ace_player,ACE_EyesDamaged,false)) exitWith {SETDUST(DACTIVE,false);SETDUST(DBULLETS,0);SETDUST(DAMOUNT,0);};
|
||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,2));
|
||||
|
||||
private "_amount";
|
||||
_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
||||
|
||||
ACE_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
|
||||
ACE_Goggles_PostProcessEyes ppEffectCommit 1;
|
||||
ACE_Goggles_PostProcessEyes ppEffectEnable true;
|
||||
if !(scriptDone ACE_Goggles_DustHandler) then {
|
||||
terminate ACE_Goggles_DustHandler;
|
||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
|
||||
GVAR(PostProcessEyes) ppEffectCommit 1;
|
||||
GVAR(PostProcessEyes) ppEffectEnable true;
|
||||
if !(scriptDone GVAR(DustHandler)) then {
|
||||
terminate GVAR(DustHandler);
|
||||
};
|
||||
SETDUST(DBULLETS,0);
|
||||
ACE_Goggles_DustHandler = [3] spawn {
|
||||
GVAR(DustHandler) = [3] spawn {
|
||||
private ["_loop", "_timeToSleep"];
|
||||
_timeToSleep = _this select 0;
|
||||
_loop = true;
|
||||
while {_loop} do {
|
||||
sleep _timeToSleep;
|
||||
_timeToSleep = GETDUSTT(DTIME);
|
||||
|
||||
|
||||
if(_timeToSleep >= (time - 2.5)) then {
|
||||
_timeToSleep = time - _timeToSleep;
|
||||
} else {
|
||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
||||
private "_amount";
|
||||
_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
||||
if !(player getVariable ["ACE_EyesDamaged", false]) then {
|
||||
ACE_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
|
||||
ACE_Goggles_PostProcessEyes ppEffectCommit 1;
|
||||
if !(ace_player getVariable ["ACE_EyesDamaged", false]) then {
|
||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
|
||||
GVAR(PostProcessEyes) ppEffectCommit 1;
|
||||
sleep 1;
|
||||
};
|
||||
if (GETDUSTT(DAMOUNT) <= 0) then {
|
||||
ACE_Goggles_PostProcessEyes ppEffectEnable false;
|
||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||
SETDUST(DACTIVE,false);
|
||||
SETDUST(DBULLETS,0);
|
||||
_loop = false;
|
||||
@ -66,4 +66,4 @@ ACE_Goggles_DustHandler = [3] spawn {
|
||||
_timeToSleep = 3;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -1,37 +1,37 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_ApplyGlassesEffect
|
||||
|
||||
Name: fnc_ApplyGlassesEffect.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
|
||||
Description:
|
||||
Sets screen tint for glasses.
|
||||
Sets screen overlay for glasses. (broken/fixed)
|
||||
Sets dirt/rain overlay for glasses.
|
||||
|
||||
Parameters:
|
||||
|
||||
Parameters:
|
||||
0: STRING - Glasses class name to be applied.
|
||||
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
|
||||
Example:
|
||||
(goggles player) call ACE_Goggles_fnc_ApplyGlassesEffect;
|
||||
(goggles ace_player) call FUNC(ApplyGlassesEffect);
|
||||
*/
|
||||
#include "\ACE_Goggles\script.sqf"
|
||||
#include "script_component.hpp"
|
||||
private["_postProcessColour", "_postProcessTintAmount", "_glassesClassname", "_glassImagePath"];
|
||||
|
||||
_glassesClassname = _this;
|
||||
_postProcessColour = getArray(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Color");
|
||||
_postProcessTintAmount = getNumber(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_TintAmount");
|
||||
|
||||
call ACE_Goggles_fnc_RemoveGlassesEffect;
|
||||
ACE_Goggles_EffectsActive = true;
|
||||
call FUNC(removeGlassesEffect);
|
||||
GVAR(EffectsActive) = true;
|
||||
|
||||
if (_postProcessTintAmount != 0 && {ACE_Goggles_UsePP}) then {
|
||||
if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then {
|
||||
_postProcessColour set [3, _postProcessTintAmount/100];
|
||||
ACE_Goggles_PostProcess ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]];
|
||||
ACE_Goggles_PostProcess ppEffectCommit 0;
|
||||
ACE_Goggles_PostProcess ppEffectEnable true;
|
||||
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;
|
||||
};
|
||||
|
||||
_glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Overlay");
|
||||
@ -44,10 +44,10 @@ if (_glassImagePath != "") then {
|
||||
};
|
||||
|
||||
if GETDIRT then {
|
||||
call ACE_Goggles_fnc_ApplyDirtEffect;
|
||||
call FUNC(applyDirtEffect);
|
||||
};
|
||||
|
||||
if GETDUSTT(DACTIVE) then {
|
||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
||||
call ACE_Goggles_fnc_ApplyDust;
|
||||
call FUNC(applyDust);
|
||||
};
|
51
addons/goggles/functions/fnc_checkGoggles.sqf
Normal file
51
addons/goggles/functions/fnc_checkGoggles.sqf
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Performs rain checks and checks to see whether glasses effects have been applied or not.
|
||||
Checks for external camera and removes effects.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
[] execVM "ACE_Goggles\functions\fn_CheckGoggles.sqf";
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
call FUNC(checkGlasses);
|
||||
[QGVAR(RotorWash), "OnEachFrame", {call FUNC(onEachFrame);}] call CALLSTACK(BIS_fnc_addStackedEventHandler);
|
||||
[] spawn FUNC(rainEffect);
|
||||
while {alive ace_player} do {
|
||||
sleep 1;
|
||||
if (true) then {
|
||||
// Detect if curator interface is open and disable effects
|
||||
if (!isNull(findDisplay 312)) exitWith {
|
||||
if (GVAR(EffectsActive)) then {
|
||||
call FUNC(removeGlassesEffect);
|
||||
};
|
||||
};
|
||||
call FUNC(checkGlasses);
|
||||
if !(ace_player call FUNC(isGogglesVisible)) exitWith {
|
||||
if (GVAR(EffectsActive)) then {
|
||||
call FUNC(removeGlassesEffect);
|
||||
};
|
||||
};
|
||||
if (call FUNC(externalCamera)) exitWith {
|
||||
if (GVAR(EffectsActive)) then {
|
||||
call FUNC(removeGlassesEffect);
|
||||
};
|
||||
};
|
||||
if !(GVAR(EffectsActive)) then {
|
||||
(goggles ace_player) call FUNC(applyGlassesEffect);
|
||||
} else {
|
||||
if ((goggles ace_player) call FUNC(isDivingGoggles) && {underwater ace_player}) then {
|
||||
call FUNC(removeRainEffect);
|
||||
call FUNC(removeDirtEffect);
|
||||
call FUNC(removeDustEffect);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
39
addons/goggles/functions/fnc_clearGlasses.sqf
Normal file
39
addons/goggles/functions/fnc_clearGlasses.sqf
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
Name: fnc_clearGlasses.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Clears all dirt, rain, dust from glasses.
|
||||
Removes glasses effect (PP, overlay) and then puts it back.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call FUNC(ClearGlasses);
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_broken";
|
||||
_broken = GETBROKEN;
|
||||
GVAR(Effects) = GLASSESDEFAULT;
|
||||
GVAR(Effects) set [BROKEN, _broken];
|
||||
|
||||
if ((stance ace_player) != "PRONE") then {
|
||||
ace_player playActionNow "gestureWipeFace";
|
||||
};
|
||||
|
||||
null = [] spawn {
|
||||
sleep 0.3;
|
||||
if (cameraView == "INTERNAL") then {
|
||||
addCamShake [5, 1.75, 2];
|
||||
};
|
||||
};
|
||||
|
||||
call FUNC(removeDirtEffect);
|
||||
call FUNC(removeRainEffect);
|
||||
call FUNC(removeDustEffect);
|
@ -1,29 +1,29 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_DustHandler
|
||||
|
||||
fnc_DustHandler.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
|
||||
Description:
|
||||
Determines whether to place dust on the goggles, based on calibre of weapon fired and other requirements.
|
||||
|
||||
Parameters:
|
||||
|
||||
Parameters:
|
||||
0: Object - unit - eventhandler was attached to. (Used)
|
||||
1: String - weapon - Weapon fired (Used)
|
||||
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
|
||||
Example:
|
||||
player addEventHandler ["Fired", {[_this select 0, _this select 1] call ACE_Goggles_fnc_DustHandler;}];
|
||||
ace_player addEventHandler ["Fired", {[_this select 0, _this select 1] call FUNC(DustHandler;}];
|
||||
See http://community.bistudio.com/wiki/ArmA_3:_Event_Handlers#Fired
|
||||
*/
|
||||
#include "\ACE_Goggles\script.sqf"
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_bullets", "_position", "_surface", "_found", "_weapon", "_cloudType"];
|
||||
_weapon = _this select 1;
|
||||
_cloudType = "";
|
||||
|
||||
if ((_this select 0) != player) exitWith {true};
|
||||
if ((_this select 0) != ace_player) exitWith {true};
|
||||
|
||||
if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect")) then {
|
||||
_cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName");
|
||||
@ -35,9 +35,9 @@ if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEff
|
||||
|
||||
if (_cloudType == "") exitWith {true};
|
||||
if (rain > 0.1) exitWith {true};
|
||||
if ((stance player) != "PRONE") exitWith {true};
|
||||
if ((stance ace_player) != "PRONE") exitWith {true};
|
||||
|
||||
_position = getPosATL player;
|
||||
_position = getPosATL ace_player;
|
||||
|
||||
if (surfaceIsWater _position) exitWith {};
|
||||
if ((_position select 2) > 0.2) exitWith {};
|
||||
@ -69,7 +69,7 @@ if (GETDUSTT(DAMOUNT) < 2) then {
|
||||
|
||||
if (_bulletsRequired <= _bullets) then {
|
||||
SETDUST(DACTIVE,true);
|
||||
call ACE_Goggles_fnc_ApplyDust;
|
||||
call FUNC(applyDust);
|
||||
};
|
||||
};
|
||||
true
|
@ -1,19 +1,20 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_ExternalCamera
|
||||
|
||||
fnc_ExternalCamera.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
|
||||
Description:
|
||||
Returns if the camera is external or not.
|
||||
|
||||
Parameters:
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
|
||||
Returns:
|
||||
Boolean - whether the camera is in external view or not.
|
||||
|
||||
|
||||
Example:
|
||||
call ACE_Goggles_fnc_ExternalCamera;
|
||||
call FUNC(ExternalCamera);
|
||||
*/
|
||||
if (profileNamespace getVariable ["ACE_showInThirdPerson", false]) exitWith { false };
|
||||
#include "script_component.hpp"
|
||||
if (GETVAR(profileNamespace,ACE_showInThirdPerson,false)) exitWith { false };
|
||||
(cameraView == "External")
|
27
addons/goggles/functions/fnc_getExplosionIndex.sqf
Normal file
27
addons/goggles/functions/fnc_getExplosionIndex.sqf
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
fnc_getExplosionIndex.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Turns 0-1 damage into a rating system of 0-3
|
||||
|
||||
Parameters:
|
||||
0: NUMBER - The amount of damage
|
||||
|
||||
Returns:
|
||||
NUMBER (the rating) [0-3]
|
||||
|
||||
Example:
|
||||
_rating = 0.05 call FUNC(GetExplosionIndex);
|
||||
*/
|
||||
private ["_effectIndex"];
|
||||
|
||||
_effectIndex = switch true do {
|
||||
case (_this <= 0.04): {0};
|
||||
case (_this <= 0.06): {1};
|
||||
case (_this <= 0.09): {2};
|
||||
default {3};
|
||||
};
|
||||
|
||||
_effectIndex
|
@ -1,20 +1,21 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_isDivingGoggles
|
||||
|
||||
fnc_isDivingGoggles.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
|
||||
Description:
|
||||
Determines whether current goggles worn by passed unit is diving goggles or a variant of them.
|
||||
|
||||
Parameters:
|
||||
|
||||
Parameters:
|
||||
0: String - Glasses classname
|
||||
|
||||
|
||||
Returns:
|
||||
Boolean - whether diving goggles are worn
|
||||
|
||||
|
||||
Example:
|
||||
(goggles player) call ACE_Goggles_fnc_isDivingGoggles;
|
||||
(goggles ace_player) call FUNC(isDivingGoggles);
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_result", "_glasses"];
|
||||
_glasses = _this;
|
||||
_result = _glasses == "G_Diving";
|
@ -1,20 +1,21 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_isGogglesVisible
|
||||
|
||||
fnc_isGogglesVisible.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
|
||||
Description:
|
||||
Determines if goggles are visible on passed unit (Also checks if unit is in vehicle and cameraView is set to GUNNER)
|
||||
|
||||
Parameters:
|
||||
|
||||
Parameters:
|
||||
0: Object - unit to check for visible goggles
|
||||
|
||||
|
||||
Returns:
|
||||
BOOL - Whether the goggles are visible or not.
|
||||
|
||||
|
||||
Example:
|
||||
_visible = player call ACE_Goggles_fnc_isGogglesVisible;
|
||||
_visible = ace_player call FUNC(isGogglesVisible);
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_currentGlasses", "_result", "_unit"];
|
||||
_unit = _this;
|
||||
|
||||
@ -26,12 +27,12 @@ if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")};
|
||||
if (_currentGlasses != "") then {
|
||||
_position =(getPosASLW _unit);
|
||||
if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith {
|
||||
_result = (_currentGlasses call ACE_Goggles_fnc_isDivingGoggles);
|
||||
_result = (_currentGlasses call FUNC(isDivingGoggles));
|
||||
};
|
||||
if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith {
|
||||
_result = false;
|
||||
};
|
||||
_result = !(_currentGlasses call ACE_Goggles_fnc_isDivingGoggles);
|
||||
_result = !(_currentGlasses call FUNC(isDivingGoggles));
|
||||
};
|
||||
|
||||
_result
|
||||
_result
|
@ -1,24 +1,25 @@
|
||||
/*
|
||||
Name: ACE_Goggles_fnc_isInRotorWash
|
||||
|
||||
fnc_isInRotorWash.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
|
||||
Description:
|
||||
Checks for nearby helicopters (within 15m)
|
||||
|
||||
|
||||
Parameters:
|
||||
0: Object - Unit
|
||||
1: NUMBER - (optional) Radius to check for helicopter Default: 15
|
||||
|
||||
|
||||
Returns:
|
||||
Array:
|
||||
0 - boolean - If in rotorwash
|
||||
1 - number - Amount of rotor wash.
|
||||
|
||||
|
||||
Example:
|
||||
if (([player, 10] call ACE_Goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; };
|
||||
if (([player] call ACE_Goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; };
|
||||
if (([ace_player, 10] call FUNC(isInRotorWash)) select 0) then { hint "Rotor wash"; };
|
||||
if (([ace_player] call FUNC(isInRotorWash)) select 0) then { hint "Rotor wash"; };
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_heli", "_unit", "_result", "_radius"];
|
||||
_unit = _this select 0;
|
||||
_radius = 15;
|
||||
@ -41,6 +42,7 @@ _heli = (getPosATL _unit) nearEntities [["Helicopter"], _radius];
|
||||
};
|
||||
};
|
||||
};
|
||||
false
|
||||
} count _heli;
|
||||
|
||||
_result
|
80
addons/goggles/functions/fnc_onEachFrame.sqf
Normal file
80
addons/goggles/functions/fnc_onEachFrame.sqf
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
fnc_onEachFrame.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Runs every frame checking for helicopters.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
["ACE_Goggles_RotorWash", "OnEachFrame", "call FUNC(OnEachFrame);"] call BIS_fnc_addStackedEventHandler;
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
if (isNull(ace_player)) then {
|
||||
[QGVAR(RotorWash), "OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler);
|
||||
};
|
||||
GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)];
|
||||
if (GVAR(FrameEvent) select 0) exitWith {
|
||||
if (vehicle ace_player != ace_player && {!([ace_player] call EFUNC(common,isTurnedOut))}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; };
|
||||
GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))];
|
||||
};
|
||||
private ["_rotorWash","_safe"];
|
||||
_rotorWash = GVAR(FrameEvent) select 1;
|
||||
_safe = false;
|
||||
if !(_rotorWash select 0) exitWith {
|
||||
if (GVAR(PostProcessEyes_Enabled)) then {
|
||||
GVAR(PostProcessEyes_Enabled) = false;
|
||||
if (!scriptDone (GVAR(DustHandler))) then {
|
||||
terminate GVAR(DustHandler);
|
||||
};
|
||||
GVAR(DustHandler) = [] spawn {
|
||||
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
|
||||
GVAR(PostProcessEyes) ppEffectCommit 2;
|
||||
sleep 2;
|
||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||
};
|
||||
};
|
||||
};
|
||||
if ((headgear ace_player) != "") then {
|
||||
_safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear ace_player) >> "ACE_Protection") == 1);
|
||||
};
|
||||
if !(_safe) then {
|
||||
if !(ace_player call FUNC(isGogglesVisible)) exitWith{};
|
||||
if (GETDUSTT(DAMOUNT) < 2) then {
|
||||
if (!GETDUSTT(DACTIVE)) then {
|
||||
SETDUST(DACTIVE,true);
|
||||
call FUNC(ApplyDust);
|
||||
} else {
|
||||
if ((_rotorWash select 1) > 0.5) then {
|
||||
call FUNC(ApplyDust);
|
||||
};
|
||||
};
|
||||
};
|
||||
_safe = (getNumber (ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Protection") == 1);
|
||||
};
|
||||
if (_safe) exitWith {};
|
||||
if ((_rotorWash select 1) <= 15) then {
|
||||
private "_scale";
|
||||
_scale = 0.7;
|
||||
if ((_rotorWash select 1) != 0) then {
|
||||
_scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3);
|
||||
} else {
|
||||
_scale = 0.1;
|
||||
};
|
||||
_scale = 1 - _scale;
|
||||
if (!scriptDone (GVAR(DustHandler))) then {
|
||||
terminate GVAR(DustHandler);
|
||||
};
|
||||
if !(ace_player getVariable ["ACE_EyesDamaged", false]) then {
|
||||
GVAR(PostProcessEyes_Enabled) = true;
|
||||
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [_scale,_scale,_scale,_scale],[1,1,1,0]];
|
||||
GVAR(PostProcessEyes) ppEffectCommit 0.5;
|
||||
GVAR(PostProcessEyes) ppEffectEnable true;
|
||||
};
|
||||
};
|
61
addons/goggles/functions/fnc_rainEffect.sqf
Normal file
61
addons/goggles/functions/fnc_rainEffect.sqf
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
fnc_rainEffect.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
[] spawn FUNC(RainEffect);
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
GVAR(RainDrops) = objNull;
|
||||
GVAR(RainActive) = false;
|
||||
_fnc_underCover = {
|
||||
private ["_pos", "_unit"];
|
||||
_unit = (_this select 0);
|
||||
if (vehicle _unit != _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {true};
|
||||
_pos = eyePos _unit;
|
||||
((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])}
|
||||
};
|
||||
private ["_lastRain"];
|
||||
_lastRain = 0;
|
||||
while {alive ace_player} do {
|
||||
sleep 0.5;
|
||||
if (isNull(findDisplay 312)) then {
|
||||
// Ignore if ace_player is under water
|
||||
if (!GVAR(EffectsActive) || {underwater ace_player}) exitWith{call FUNC(RemoveRainEffect);};
|
||||
if (_lastRain != rain) then {
|
||||
call FUNC(RemoveRainEffect);
|
||||
_lastRain = rain;
|
||||
// Rain is happening
|
||||
if (_lastRain > 0.05 && {!([ace_player] call _fnc_underCover)}) then {
|
||||
GVAR(RainActive) = true;
|
||||
GVAR(RainDrops) = "#particlesource" createVehicleLocal GetPos ace_player;
|
||||
GVAR(RainDrops) setParticleClass "ACERainEffect";
|
||||
GVAR(RainDrops) setDropInterval (0.07 * (1.1 - _lastRain));
|
||||
GVAR(RainDrops) attachTo [vehicle ace_player,[0,0,0]];
|
||||
};
|
||||
}else{
|
||||
if (_lastRain > 0.05) then {
|
||||
if (GVAR(RainActive) && {[ace_player] call _fnc_underCover}) exitWith {
|
||||
call FUNC(RemoveRainEffect);
|
||||
};
|
||||
if (!GVAR(RainActive)) then {
|
||||
_lastRain = -1;
|
||||
};
|
||||
};
|
||||
};
|
||||
}else{
|
||||
if (GVAR(RainActive)) then {
|
||||
call FUNC(RemoveRainEffect);
|
||||
};
|
||||
};
|
||||
};
|
21
addons/goggles/functions/fnc_removeDirtEffect.sqf
Normal file
21
addons/goggles/functions/fnc_removeDirtEffect.sqf
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
fnc_removeDirtEffect.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Removes dirt from the glasses.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call FUNC(RemoveDirtEffect);
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then {
|
||||
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText "";
|
||||
};
|
21
addons/goggles/functions/fnc_removeDustEffect.sqf
Normal file
21
addons/goggles/functions/fnc_removeDustEffect.sqf
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
fnc_removeDustEffect.sqf
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Removes dust from the glasses.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call FUNC(RemoveDustEffect);
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then {
|
||||
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText "";
|
||||
};
|
29
addons/goggles/functions/fnc_removeGlassesEffect.sqf
Normal file
29
addons/goggles/functions/fnc_removeGlassesEffect.sqf
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
RemoveGlassesEffect
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Removes the glasses effect from the screen, removes dirt effect, removes rain effect,
|
||||
removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.)
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call FUNC(RemoveGlassesEffect);
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
GVAR(EffectsActive) = false;
|
||||
GVAR(PostProcess) ppEffectEnable false;
|
||||
|
||||
if (!isNull(GLASSDISPLAY)) then {
|
||||
GLASSDISPLAY closeDisplay 0;
|
||||
};
|
||||
|
||||
call FUNC(removeDirtEffect);
|
||||
call FUNC(removeRainEffect);
|
||||
call FUNC(removeDustEffect);
|
22
addons/goggles/functions/fnc_removeRainEffect.sqf
Normal file
22
addons/goggles/functions/fnc_removeRainEffect.sqf
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
RemoveRainEffect
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Removes rain effects from the screen. Resets the rain array.
|
||||
|
||||
Parameters:
|
||||
Nothing
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call FUNC(RemoveRainEffect);
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
if (!isNull (GVAR(RainDrops))) then {
|
||||
deleteVehicle (GVAR(RainDrops));
|
||||
};
|
||||
GVAR(RainActive) = false;
|
1
addons/goggles/functions/script_component.hpp
Normal file
1
addons/goggles/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\goggles\script_component.hpp"
|
@ -1,21 +0,0 @@
|
||||
#define GLASSESDEFAULT [false,[false,0,0,0],false]
|
||||
|
||||
#define DIRT 0
|
||||
#define DUST 1
|
||||
#define BROKEN 2
|
||||
|
||||
#define GETDIRT (ACE_Goggles_Effects select DIRT)
|
||||
#define GETDUST (ACE_Goggles_Effects select DUST)
|
||||
#define GETBROKEN (ACE_Goggles_Effects select BROKEN)
|
||||
#define GETDUSTT(type) ((ACE_Goggles_Effects select DUST) select type)
|
||||
|
||||
#define SETDUST(type,value) (ACE_Goggles_Effects select DUST) set [type, value]
|
||||
|
||||
#define DACTIVE 0
|
||||
#define DTIME 1
|
||||
#define DBULLETS 2
|
||||
#define DAMOUNT 3
|
||||
|
||||
#define GLASSDISPLAY (uiNamespace getVariable ["ACE_Goggles_Display", displayNull])
|
||||
|
||||
#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}})
|
34
addons/goggles/script_component.hpp
Normal file
34
addons/goggles/script_component.hpp
Normal file
@ -0,0 +1,34 @@
|
||||
#define COMPONENT goggles
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_GOGGLES
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_GOGGLES
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_GOGGLES
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
// MACROS
|
||||
#define GLASSESDEFAULT [false,[false,0,0,0],false]
|
||||
#define DIRT 0
|
||||
#define DUST 1
|
||||
#define BROKEN 2
|
||||
|
||||
#define GETDIRT (GVAR(Effects) select DIRT)
|
||||
#define GETDUST (GVAR(Effects) select DUST)
|
||||
#define GETBROKEN (GVAR(Effects) select BROKEN)
|
||||
#define GETDUSTT(type) ((GVAR(Effects) select DUST) select type)
|
||||
|
||||
#define SETDUST(type,value) (GVAR(Effects) select DUST) set [type,value]
|
||||
|
||||
#define DACTIVE 0
|
||||
#define DTIME 1
|
||||
#define DBULLETS 2
|
||||
#define DAMOUNT 3
|
||||
|
||||
#define GLASSDISPLAY (GETUVAR(GVAR(Display),displayNull))
|
||||
|
||||
#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}})
|
Loading…
Reference in New Issue
Block a user