Merge branch 'master' of https://github.com/KoffeinFlummi/ACE3 into agmPortMarkers

This commit is contained in:
commy2 2015-01-19 14:42:25 +01:00
commit 1c37c76cc6
56 changed files with 1038 additions and 1024 deletions

View File

@ -1,25 +0,0 @@
class CfgFunctions{
class AGM_Goggles{
class AGM_Goggles{
file="AGM_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;
};
};
};

View File

@ -1,295 +0,0 @@
#define COLOUR 8.0
class CfgPatches {
class AGM_Goggles {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"Garth 'L-H' de Wet"};
authorUrl = "https://github.com/CorruptedHeart";
};
};
#include "CfgFunctions.hpp"
#define COMBAT_GOGGLES AGM_Overlay="AGM_Goggles\textures\HUD\CombatGoggles.paa"; \
AGM_OverlayCracked = "AGM_Goggles\textures\HUD\CombatGogglesCracked.paa"; \
AGM_Resistance = 2; \
AGM_Protection = 1;
class CfgGlasses {
class None {
AGM_Color[] = {0,0,0};
AGM_TintAmount=0;
AGM_Overlay = "";
AGM_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa";
AGM_OverlayCracked = "AGM_Goggles\textures\HUD\Cracked.paa";
AGM_Resistance = 0;
AGM_Protection = 0;
AGM_DustPath = "AGM_Goggles\textures\fx\dust\%1.paa";
};
class G_Combat:None {
COMBAT_GOGGLES
};
class G_Diving {
AGM_Overlay="AGM_Goggles\textures\HUD\DivingGoggles.paa";
AGM_OverlayCracked = "AGM_Goggles\textures\HUD\DivingGogglesCracked.paa";
AGM_Resistance = 2;
AGM_Protection = 1;
};
class G_Lowprofile:None {
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 2;
AGM_Protection = 1;
};
class G_Shades_Black:None {
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Shades_Blue:None{
AGM_Color[] = {0,0,1};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Shades_Green:None{
AGM_Color[] = {0,1,0};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Shades_Red:None{
AGM_Color[] = {1,0,0};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Spectacles:None{
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Spectacles_Tinted:None{
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Sport_Blackred:None{
AGM_Color[] = {1,0,0};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Sport_BlackWhite:None{
AGM_Color[] = {0,0,1};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Sport_Blackyellow:None{
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Sport_Checkered:None{
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Sport_Greenblack:None{
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Sport_Red:None{
AGM_TintAmount=COLOUR*2;
AGM_Color[] = {0,0,0};
AGM_Resistance = 1;
};
class G_Squares:None{
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Squares_Tinted:None{
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Tactical_Black:None{
AGM_TintAmount=COLOUR;
AGM_Color[] = {0,0,-1.5};
AGM_Resistance = 1;
};
class G_Tactical_Clear:None{
AGM_TintAmount=COLOUR;
AGM_Color[] = {0,0,-1};
AGM_Resistance = 1;
};
class G_Aviator:None{
AGM_Color[] = {0,0,-1};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Lady_Blue:None{
AGM_Color[] = {0,0,1};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Lady_Red:None{
AGM_Color[] = {1,0,0};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Lady_Dark:None{
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Lady_Mirror:None{
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
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 {
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 2;
AGM_Protection = 1;
};
class G_Bandanna_blk;
class G_Bandanna_shades:G_Bandanna_blk {
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
AGM_Protection = 1;
};
class G_Bandanna_sport:G_Bandanna_blk {
AGM_Color[] = {1,0,0};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
AGM_Protection = 1;
};
class G_Bandanna_aviator:G_Bandanna_blk {
AGM_Color[] = {0,0,-1};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
AGM_Protection = 1;
};
};
#include "RscTitles.hpp"
class CfgMovesBasic
{
class ManActions
{
GestureWipeFace[] = {"GestureWipeFace", "gesture"};
};
};
class CfgGesturesMale
{
class States
{
class GestureFreezeStand;
class GestureWipeFace: GestureFreezeStand
{
file = "\AGM_Goggles\anim\WipeGlasses.rtm";
canPullTrigger = 0;
};
};
};
class CfgWeapons{
class H_HelmetB;
class H_CrewHelmetHeli_B:H_HelmetB {
AGM_Protection = 1;
};
class H_PilotHelmetHeli_B:H_HelmetB {
AGM_Protection = 1;
};
class H_PilotHelmetFighter_B:H_HelmetB {
AGM_Protection = 1;
};
};
class RifleAssaultCloud {
AGM_Goggles_BulletCount = 4;
};
class MachineGunCloud {
AGM_Goggles_BulletCount = 3;
};
class SniperCloud {
AGM_Goggles_BulletCount = 1;
};
class AGM_Core_Default_Keys {
class wipeGlasses {
displayName = $STR_AGM_Goggles_WipeGlasses;
condition = "!(player getVariable['AGM_isUnconscious', false])";
statement = "call AGM_Goggles_fnc_ClearGlasses;";
key = 20; // T
shift = 1;
control = 1;
alt = 0;
};
};
class AGM_Core_Options {
class showInThirdPerson {
displayName = $STR_AGM_Goggles_ShowInThirdPerson;
default = 0;
};
};
class CfgCloudlets {
class Default;
class AGMRainEffect:Default {
interval = 0.001;
particleShape = "\A3\data_f\ParticleEffects\Universal\Refract";
particleFSNtieth = 1;
particleFSIndex = 0;
particleFSFrameCount = 1;
particleFSLoop = 1;
particleType = "Billboard";
lifeTime = 0.5;
rotationVelocity = 1;
weight = 100;
volume = 0.000;
rubbing = 1.7;
size[] = {0.1};
color[] = {{1,1,1,1}};
animationSpeed[] = {0,1};
randomDirectionPeriod = 0.2;
randomDirectionIntensity = 1.2;
positionVar[] = {2, 2, 2.5};
sizeVar = 0.01;
colorVar[] = {0, 0, 0, 0.1};
destroyOnWaterSurface = 1;
};
};

View File

@ -1,27 +0,0 @@
// Control types
#define CT_STATIC 0
#define ST_PICTURE 0x30
////////////////
//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;
};

View File

@ -1,32 +0,0 @@
/*
Name: AGM_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 AGM_Goggles_fnc_ApplyDirtEffect;
*/
#include "\AGM_Goggles\script.sqf"
if (cameraOn != player || call AGM_Goggles_fnc_ExternalCamera) exitWith{false};
private "_dirtImage";
AGM_Goggles_Effects set [DIRT, true];
if (player call AGM_Goggles_fnc_isGogglesVisible) then{
_dirtImage = getText(ConfigFile >> "CfgGlasses" >> goggles player >> "AGM_OverlayDirt");
if (_dirtImage != "") then {
100 cutRsc["RscAGM_GogglesEffects", "PLAIN",0.1, false];
(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10660) ctrlSetText _dirtImage;
};
};
true

View File

@ -1,69 +0,0 @@
/*
Name: AGM_Goggles_fnc_ApplyDust
Author: Garth de Wet (LH)
Description:
Applies dust to screen.
Parameters:
Nothing
Returns:
Nothing
Example 1:
call AGM_Goggles_fnc_ApplyDust;
*/
#include "\AGM_Goggles\script.sqf"
if (call AGM_Goggles_fnc_ExternalCamera) exitWith {};
if (player call AGM_Goggles_fnc_isGogglesVisible) exitWith {
100 cutRsc["RscAGM_GogglesEffects", "PLAIN",2,false];
(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_DustPath"), GETDUSTT(DAMOUNT)+1];
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1));
SETDUST(DBULLETS,0);
};
if (player getVariable ["AGM_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);
AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 1;
AGM_Goggles_PostProcessEyes ppEffectEnable true;
if !(scriptDone AGM_Goggles_DustHandler) then {
terminate AGM_Goggles_DustHandler;
};
SETDUST(DBULLETS,0);
AGM_Goggles_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 ["AGM_EyesDamaged", false]) then {
AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 1;
sleep 1;
};
if (GETDUSTT(DAMOUNT) <= 0) then {
AGM_Goggles_PostProcessEyes ppEffectEnable false;
SETDUST(DACTIVE,false);
SETDUST(DBULLETS,0);
_loop = false;
};
SETDUST(DTIME,time);
_timeToSleep = 3;
};
};
};

View File

@ -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 "AGM_Goggles\functions\fn_CheckGoggles.sqf";
*/
#include "\AGM_Goggles\script.sqf"
waitUntil {sleep 0.46;alive player};
call AGM_Goggles_fnc_CheckGlasses;
["AGM_Goggles_RotorWash", "OnEachFrame", {call AGM_Goggles_fnc_OnEachFrame;}] call BIS_fnc_addStackedEventHandler;
[] spawn AGM_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 (AGM_Goggles_EffectsActive) then {
call AGM_Goggles_fnc_RemoveGlassesEffect;
};
};
call AGM_Goggles_fnc_CheckGlasses;
if !(player call AGM_Goggles_fnc_isGogglesVisible) exitWith {
if (AGM_Goggles_EffectsActive) then {
call AGM_Goggles_fnc_RemoveGlassesEffect;
};
};
if (call AGM_Goggles_fnc_ExternalCamera) exitWith {
if (AGM_Goggles_EffectsActive) then {
call AGM_Goggles_fnc_RemoveGlassesEffect;
};
};
if !(AGM_Goggles_EffectsActive) then {
(goggles player) call AGM_Goggles_fnc_ApplyGlassesEffect;
} else {
if ((goggles player) call AGM_Goggles_fnc_isDivingGoggles && {underwater player}) then {
call AGM_Goggles_fnc_RemoveRainEffect;
call AGM_Goggles_fnc_RemoveDirtEffect;
call AGM_Goggles_fnc_RemoveDustEffect;
};
};
};
};

View File

@ -1,39 +0,0 @@
/*
Name: AGM_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 AGM_Goggles_fnc_ClearGlasses;
*/
#include "\AGM_Goggles\script.sqf"
private "_broken";
_broken = GETBROKEN;
AGM_Goggles_Effects = GLASSESDEFAULT;
AGM_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 AGM_Goggles_fnc_RemoveDirtEffect;
call AGM_Goggles_fnc_RemoveRainEffect;
call AGM_Goggles_fnc_RemoveDustEffect;

View File

@ -1,28 +0,0 @@
/*
Name: AGM_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 AGM_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

View File

@ -1,111 +0,0 @@
/*
Name: AGM_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 AGM_Goggles_fnc_Init;
*/
if (!hasInterface) exitWith {};
#include "\AGM_Goggles\script.sqf"
if isNil("AGM_Goggles_UsePP") then {
AGM_Goggles_UsePP = true;
};
AGM_Goggles_PostProcess = ppEffectCreate ["ColorCorrections", 1995];
AGM_Goggles_PostProcessEyes = ppEffectCreate ["ColorCorrections", 1992];
AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 0;
AGM_Goggles_PostProcessEyes ppEffectEnable false;
AGM_Goggles_EffectsActive = false;
AGM_Goggles_Effects = GLASSESDEFAULT;
AGM_Goggles_Current = "None";
AGM_Goggles_EyesDamageScript = 0 spawn {};
AGM_Goggles_FrameEvent = [false, [false,20]];
AGM_Goggles_PostProcessEyes_Enabled = false;
AGM_Goggles_DustHandler = 0 spawn {};
AGM_Goggles_RainDrops = objNull;
AGM_Goggles_fnc_CheckGlasses = {
if (AGM_Goggles_Current != (goggles player)) then {
AGM_Goggles_Current = (goggles player);
["GlassesChanged",[AGM_Goggles_Current]] call CBA_fnc_localEvent;
};
};
player addEventHandler ["Explosion", {
if (alive player) then {
call AGM_Goggles_fnc_ApplyDirtEffect;
if (GETBROKEN) exitWith {};
if (((_this select 1) call AGM_Goggles_fnc_GetExplosionIndex) < getNumber(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_Resistance")) exitWith {};
if !(player call AGM_Goggles_fnc_isGogglesVisible) exitWith {["GlassesCracked",[player]] call CBA_fnc_localEvent;};
AGM_Goggles_Effects set [BROKEN, true];
if (getText(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_OverlayCracked") != "" && {cameraOn == player}) then {
if (call AGM_Goggles_fnc_ExternalCamera) exitWith {};
if (isNull(GLASSDISPLAY)) then {
150 cutRsc["RscAGM_Goggles", "PLAIN",1, false];
};
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_OverlayCracked");
};
["GlassesCracked",[player]] call CBA_fnc_localEvent;
};
}];
player addEventHandler ["Killed",{
[] spawn {
sleep 2;
AGM_Goggles_PostProcessEyes ppEffectEnable false;
AGM_Goggles_Effects = GLASSESDEFAULT;
call AGM_Goggles_fnc_RemoveGlassesEffect;
AGM_Goggles_EffectsActive=false;
player setVariable ["AGM_EyesDamaged", false];
terminate AGM_Goggles_EyesDamageScript;
terminate AGM_Goggles_MainLoop;
terminate AGM_Goggles_DustHandler;
AGM_Goggles_MainLoop = [] spawn AGM_Goggles_fnc_CheckGoggles;
};
}];
player addEventHandler ["Fired",{[_this select 0, _this select 1] call AGM_Goggles_fnc_DustHandler;}];
player AddEventHandler ["Take",{call AGM_Goggles_fnc_CheckGlasses;}];
player AddEventHandler ["Put", {call AGM_Goggles_fnc_CheckGlasses;}];
["GlassesChanged",{
AGM_Goggles_Effects = GLASSESDEFAULT;
if (call AGM_Goggles_fnc_ExternalCamera) exitWith {call AGM_Goggles_fnc_RemoveGlassesEffect};
if (player call AGM_Goggles_fnc_isGogglesVisible) then {
(_this select 0) call AGM_Goggles_fnc_ApplyGlassesEffect;
} else {
call AGM_Goggles_fnc_RemoveGlassesEffect;
};
}] call CBA_fnc_addEventHandler;
["GlassesCracked",{
if (_this select 0 != player) exitWith {};
player setVariable ["AGM_EyesDamaged", true];
if !(scriptDone AGM_Goggles_EyesDamageScript) then {
terminate AGM_Goggles_EyesDamageScript;
};
AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 0;
AGM_Goggles_PostProcessEyes ppEffectEnable true;
AGM_Goggles_EyesDamageScript = [] spawn {
sleep 25;
AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 5;
sleep 5;
AGM_Goggles_PostProcessEyes ppEffectEnable false;
player setVariable ["AGM_EyesDamaged", false];
};
}] call CBA_fnc_addEventHandler;
AGM_Goggles_MainLoop = [] spawn AGM_Goggles_fnc_CheckGoggles;

View File

@ -1,80 +0,0 @@
/*
Name: AGM_Goggles_fnc_OnEachFrame
Author: Garth de Wet (LH)
Description:
Runs every frame checking for helicopters.
Parameters:
Nothing
Returns:
Nothing
Example:
["AGM_Goggles_RotorWash", "OnEachFrame", "call AGM_Goggles_fnc_OnEachFrame;"] call BIS_fnc_addStackedEventHandler;
*/
#include "\AGM_Goggles\script.sqf"
if (isNull(player)) then {
["AGM_Goggles_RotorWash", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
AGM_Goggles_FrameEvent set [0, !(AGM_Goggles_FrameEvent select 0)];
if (AGM_Goggles_FrameEvent select 0) exitWith {
if (vehicle player != player && {!([player] call AGM_Core_fnc_isTurnedOut)}) exitWith {(AGM_Goggles_FrameEvent select 1) set [0, false]; };
AGM_Goggles_FrameEvent set [1, ([player] call AGM_Goggles_fnc_isInRotorWash)];
};
private ["_rotorWash","_safe"];
_rotorWash = AGM_Goggles_FrameEvent select 1;
_safe = false;
if !(_rotorWash select 0) exitWith {
if (AGM_Goggles_PostProcessEyes_Enabled) then {
AGM_Goggles_PostProcessEyes_Enabled = false;
if (!scriptDone (AGM_Goggles_DustHandler)) then {
terminate AGM_Goggles_DustHandler;
};
AGM_Goggles_DustHandler = [] spawn {
AGM_Goggles_PostProcessEyes ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 2;
sleep 2;
AGM_Goggles_PostProcessEyes ppEffectEnable false;
};
};
};
if ((headgear player) != "") then {
_safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear player) >> "AGM_Protection") == 1);
};
if !(_safe) then {
if !(player call AGM_Goggles_fnc_isGogglesVisible) exitWith{};
if (GETDUSTT(DAMOUNT) < 2) then {
if (!GETDUSTT(DACTIVE)) then {
SETDUST(DACTIVE,true);
call AGM_Goggles_fnc_ApplyDust;
} else {
if ((_rotorWash select 1) > 0.5) then {
call AGM_Goggles_fnc_ApplyDust;
};
};
};
_safe = (getNumber (ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_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 (AGM_Goggles_DustHandler)) then {
terminate AGM_Goggles_DustHandler;
};
if !(player getVariable ["AGM_EyesDamaged", false]) then {
AGM_Goggles_PostProcessEyes_Enabled = true;
AGM_Goggles_PostProcessEyes ppEffectAdjust [1, 1, 0, [0,0,0,0], [_scale,_scale,_scale,_scale],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 0.5;
AGM_Goggles_PostProcessEyes ppEffectEnable true;
};
};

View File

@ -1,61 +0,0 @@
/*
Name: AGM_Goggles_fnc_RainEffect
Author: Garth de Wet (LH)
Description:
Parameters:
Nothing
Returns:
Nothing
Example:
[] spawn AGM_Goggles_fnc_RainEffect;
*/
#include "\AGM_Goggles\script.sqf"
AGM_Goggles_RainDrops = objNull;
AGM_Goggles_Rain_Active = false;
_fnc_underCover = {
private ["_pos", "_unit"];
_unit = (_this select 0);
if (vehicle _unit != _unit && {!([_unit] call AGM_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 (!AGM_Goggles_EffectsActive || {underwater player}) exitWith{call AGM_Goggles_fnc_RemoveRainEffect;};
if (_lastRain != rain) then {
call AGM_Goggles_fnc_RemoveRainEffect;
_lastRain = rain;
// Rain is happening
if (_lastRain > 0.05 && {!([player] call _fnc_underCover)}) then {
AGM_Goggles_Rain_Active = true;
AGM_Goggles_RainDrops = "#particlesource" createVehicleLocal GetPos player;
AGM_Goggles_RainDrops setParticleClass "AGMRainEffect";
AGM_Goggles_RainDrops setDropInterval (0.07 * (1.1 - _lastRain));
AGM_Goggles_RainDrops attachTo [vehicle player,[0,0,0]];
};
}else{
if (_lastRain > 0.05) then {
if (AGM_Goggles_Rain_Active && {[player] call _fnc_underCover}) exitWith {
call AGM_Goggles_fnc_RemoveRainEffect;
};
if (!AGM_Goggles_Rain_Active) then {
_lastRain = -1;
};
};
};
}else{
if (AGM_Goggles_Rain_Active) then {
call AGM_Goggles_fnc_RemoveRainEffect;
};
};
};

View File

@ -1,20 +0,0 @@
/*
Name: AGM_Goggles_fnc_RemoveDirtEffect
Author: Garth de Wet (LH)
Description:
Removes dirt from the glasses.
Parameters:
Nothing
Returns:
Nothing
Example:
call AGM_Goggles_fnc_RemoveDirtEffect;
*/
if (!isNull(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull])) then {
(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10660) ctrlSetText "";
};

View File

@ -1,20 +0,0 @@
/*
Name: AGM_Goggles_fnc_RemoveDustEffect
Author: Garth de Wet (LH)
Description:
Removes dust from the glasses.
Parameters:
Nothing
Returns:
Nothing
Example:
call AGM_Goggles_fnc_RemoveDustEffect;
*/
if (!isNull(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull])) then {
(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText "";
};

View File

@ -1,29 +0,0 @@
/*
Name: AGM_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 AGM_Goggles_fnc_RemoveGlassesEffect;
*/
#include "\AGM_Goggles\script.sqf"
AGM_Goggles_EffectsActive = false;
AGM_Goggles_PostProcess ppEffectEnable false;
if (!isNull(GLASSDISPLAY)) then {
GLASSDISPLAY closeDisplay 0;
};
call AGM_Goggles_fnc_RemoveDirtEffect;
call AGM_Goggles_fnc_RemoveRainEffect;
call AGM_Goggles_fnc_RemoveDustEffect;

View File

@ -1,21 +0,0 @@
/*
Name: AGM_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 AGM_Goggles_fnc_RemoveRainEffect;
*/
if (!isNull (AGM_Goggles_RainDrops)) then {
deleteVehicle (AGM_Goggles_RainDrops);
};
AGM_Goggles_Rain_Active = false;

View File

@ -1,21 +0,0 @@
#define GLASSESDEFAULT [false,[false,0,0,0],false]
#define DIRT 0
#define DUST 1
#define BROKEN 2
#define GETDIRT (AGM_Goggles_Effects select DIRT)
#define GETDUST (AGM_Goggles_Effects select DUST)
#define GETBROKEN (AGM_Goggles_Effects select BROKEN)
#define GETDUSTT(type) ((AGM_Goggles_Effects select DUST) select type)
#define SETDUST(type,value) (AGM_Goggles_Effects select DUST) set [type, value]
#define DACTIVE 0
#define DTIME 1
#define DBULLETS 2
#define DAMOUNT 3
#define GLASSDISPLAY (uiNamespace getVariable ["AGM_Goggles_Display", displayNull])
#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}})

View File

@ -1,5 +1,7 @@
#include "script_component.hpp" #include "script_component.hpp"
ADDON = false;
PREP(adjustRange); PREP(adjustRange);
PREP(canResetFCS); PREP(canResetFCS);
PREP(canUseFCS); PREP(canUseFCS);
@ -11,3 +13,5 @@ PREP(keyDown);
PREP(keyUp); PREP(keyUp);
PREP(reset); PREP(reset);
PREP(vehicleInit); PREP(vehicleInit);
ADDON = true;

View File

@ -0,0 +1 @@
z\ace\addons\goggles

View 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));
};
};

View File

@ -1,21 +1,21 @@
class RscTitles{ class RscTitles{
#include "define.hpp" #include "define.hpp"
class RscAGM_Goggles_BaseTitle{ class RscACE_Goggles_BaseTitle{
idd = -1; idd = -1;
onLoad = "uiNamespace setVariable ['AGM_Goggles_Display', _this select 0]"; onLoad = "uiNamespace setVariable ['ACE_Goggles_Display', _this select 0]";
onUnload = "uiNamespace setVariable ['AGM_Goggles_Display', displayNull]"; onUnload = "uiNamespace setVariable ['ACE_Goggles_Display', displayNull]";
fadeIn=0.5; fadeIn=0.5;
fadeOut=0.5; fadeOut=0.5;
movingEnable = false; movingEnable = false;
duration = 10e10; duration = 10e10;
name = "RscAGM_Goggles_BaseTitle"; name = "RscACE_Goggles_BaseTitle";
class controls; class controls;
}; };
class RscAGM_Goggles:RscAGM_Goggles_BaseTitle{ class RscACE_Goggles:RscACE_Goggles_BaseTitle{
idd = 1044; idd = 1044;
name = "RscAGM_Goggles"; name = "RscACE_Goggles";
class controls{ class controls{
class gogglesImage: RscPicture{ class gogglesImage: RscPicture{
idc = 10650; idc = 10650;
@ -23,11 +23,11 @@ class RscTitles{
}; };
}; };
class RscAGM_GogglesEffects:RscAGM_Goggles_BaseTitle{ class RscACE_GogglesEffects:RscACE_Goggles_BaseTitle{
idd = 1045; idd = 1045;
onLoad = "uiNamespace setVariable ['AGM_Goggles_DisplayEffects', _this select 0]"; onLoad = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', _this select 0]";
onUnload = "uiNamespace setVariable ['AGM_Goggles_DisplayEffects', displayNull]"; onUnload = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', displayNull]";
name = "RscAGM_GogglesEffects"; name = "RscACE_GogglesEffects";
fadeIn=0; fadeIn=0;
fadeOut=0.5; fadeOut=0.5;
class controls{ class controls{

View File

@ -0,0 +1,125 @@
/*
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 {};
["ACE3", localize "STR_ACE_Goggles_WipeGlasses",
{
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
call FUNC(clearGlasses);
true
};
false
}, [20, true, true, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind);
if isNil(QGVAR(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;
SETGLASSES(ace_player,GLASSESDEFAULT);
GVAR(Current) = "None";
GVAR(EyesDamageScript) = -1;
GVAR(FrameEvent) = [false, [false,20]];
GVAR(PostProcessEyes_Enabled) = false;
GVAR(DustHandler) = -1;
GVAR(RainDrops) = objNull;
GVAR(RainActive) = false;
GVAR(RainLastLevel) = 0;
FUNC(CheckGlasses) = {
if (GVAR(Current) != (goggles ace_player)) then {
GVAR(Current) = (goggles ace_player);
["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent);
};
};
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 EFUNC(common,localEvent);};
_effects = GETGLASSES(ace_player,GLASSESDEFAULT);
_effects set [BROKEN, true];
SETGLASSES(ace_player,_effects);
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 EFUNC(common,localEvent);
};
}];
player addEventHandler ["Killed",{
GVAR(PostProcessEyes) ppEffectEnable false;
SETGLASSES(ace_player,GLASSESDEFAULT);
call FUNC(removeGlassesEffect);
GVAR(EffectsActive)=false;
ace_player setVariable ["ACE_EyesDamaged", false];
if (GVAR(EyesDamageScript) != -1) then {
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
};
if (GVAR(DustHandler) != -1) then {
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
GVAR(DustHandler) = -1;
};
}];
player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}];
player AddEventHandler ["Take",{call FUNC(checkGlasses);}];
player AddEventHandler ["Put", {call FUNC(checkGlasses);}];
["GlassesChanged",{
SETGLASSES(ace_player,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 EFUNC(common,addEventHandler);
["GlassesCracked",{
if (_this select 0 != ace_player) exitWith {};
ace_player setVariable ["ACE_EyesDamaged", true];
if (GVAR(EyesDamageScript) != -1) then {
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
};
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) = [{
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 5;
GVAR(EyesDamageScript) = [{
GVAR(PostProcessEyes) ppEffectEnable false;
ace_player setVariable ["ACE_EyesDamaged", false];
GVAR(EyesDamageScript) = -1;
}, [], 5, 1] call EFUNC(common,waitAndExecute);
}, [], 25, 5] call EFUNC(common,waitAndExecute);
}] call EFUNC(common,addEventHandler);
call FUNC(checkGlasses);
[FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler;
[FUNC(rainEffect), 0.5, []] call CBA_fnc_addPerFrameHandler;
[FUNC(onEachFrame), 0, []] call CBA_fnc_addPerFrameHandler;

View 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);

279
addons/goggles/config.cpp Normal file
View File

@ -0,0 +1,279 @@
#include "script_component.hpp"
#define COLOUR 8.0
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"Garth 'L-H' de Wet"};
authorUrl = "http://garth.snakebiteink.co.za/";
VERSION_CONFIG;
};
};
#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;
class CfgGlasses {
class None {
ACE_Color[] = {0,0,0};
ACE_TintAmount=0;
ACE_Overlay = "";
ACE_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa";
ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\Cracked.paa));
ACE_Resistance = 0;
ACE_Protection = 0;
ACE_DustPath = QUOTE(PATHTOF(textures\fx\dust\%1.paa));
};
class G_Combat:None {
COMBAT_GOGGLES
};
class G_Diving {
ACE_Overlay = QUOTE(PATHTOF(textures\HUD\DivingGoggles.paa));
ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\DivingGogglesCracked.paa));
ACE_Resistance = 2;
ACE_Protection = 1;
};
class G_Lowprofile:None {
ACE_TintAmount=COLOUR*2;
ACE_Resistance = 2;
ACE_Protection = 1;
};
class G_Shades_Black:None {
ACE_TintAmount=COLOUR*2;
ACE_Resistance = 1;
};
class G_Shades_Blue:None{
ACE_Color[] = {0,0,1};
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Shades_Green:None{
ACE_Color[] = {0,1,0};
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Shades_Red:None{
ACE_Color[] = {1,0,0};
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Spectacles:None{
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Spectacles_Tinted:None{
ACE_TintAmount=COLOUR*2;
ACE_Resistance = 1;
};
class G_Sport_Blackred:None{
ACE_Color[] = {1,0,0};
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Sport_BlackWhite:None{
ACE_Color[] = {0,0,1};
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Sport_Blackyellow:None{
ACE_TintAmount=COLOUR*2;
ACE_Resistance = 1;
};
class G_Sport_Checkered:None{
ACE_TintAmount=COLOUR*2;
ACE_Resistance = 1;
};
class G_Sport_Greenblack:None{
ACE_TintAmount=COLOUR*2;
ACE_Resistance = 1;
};
class G_Sport_Red:None{
ACE_TintAmount=COLOUR*2;
ACE_Color[] = {0,0,0};
ACE_Resistance = 1;
};
class G_Squares:None{
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Squares_Tinted:None{
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Tactical_Black:None{
ACE_TintAmount=COLOUR;
ACE_Color[] = {0,0,-1.5};
ACE_Resistance = 1;
};
class G_Tactical_Clear:None{
ACE_TintAmount=COLOUR;
ACE_Color[] = {0,0,-1};
ACE_Resistance = 1;
};
class G_Aviator:None{
ACE_Color[] = {0,0,-1};
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Lady_Blue:None{
ACE_Color[] = {0,0,1};
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Lady_Red:None{
ACE_Color[] = {1,0,0};
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
class G_Lady_Dark:None{
ACE_TintAmount=COLOUR*2;
ACE_Resistance = 1;
};
class G_Lady_Mirror:None{
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
};
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;
ACE_Resistance = 1;
ACE_Protection = 1;
};
class G_Bandanna_sport:G_Bandanna_blk {
ACE_Color[] = {1,0,0};
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
ACE_Protection = 1;
};
class G_Bandanna_aviator:G_Bandanna_blk {
ACE_Color[] = {0,0,-1};
ACE_TintAmount=COLOUR;
ACE_Resistance = 1;
ACE_Protection = 1;
};
};
#include "RscTitles.hpp"
class CfgMovesBasic {
class ManActions {
GestureWipeFace[] = {"GestureWipeFace", "gesture"};
};
};
class CfgGesturesMale {
class States {
class GestureFreezeStand;
class GestureWipeFace: GestureFreezeStand {
file = QUOTE(PATHTOF(anim\WipeGlasses.rtm));
canPullTrigger = 0;
};
};
};
class CfgWeapons {
class H_HelmetB;
class H_CrewHelmetHeli_B:H_HelmetB {
ACE_Protection = 1;
};
class H_PilotHelmetHeli_B:H_HelmetB {
ACE_Protection = 1;
};
class H_PilotHelmetFighter_B:H_HelmetB {
ACE_Protection = 1;
};
};
class RifleAssaultCloud {
ACE_Goggles_BulletCount = 4;
};
class MachineGunCloud {
ACE_Goggles_BulletCount = 3;
};
class SniperCloud {
ACE_Goggles_BulletCount = 1;
};
class ACE_Options {
class showInThirdPerson {
displayName = $STR_ACE_Goggles_ShowInThirdPerson;
default = 0;
};
};
class CfgCloudlets {
class Default;
class ACERainEffect:Default {
interval = 0.001;
particleShape = "\A3\data_f\ParticleEffects\Universal\Refract";
particleFSNtieth = 1;
particleFSIndex = 0;
particleFSFrameCount = 1;
particleFSLoop = 1;
particleType = "Billboard";
lifeTime = 0.5;
rotationVelocity = 1;
weight = 100;
volume = 0.000;
rubbing = 1.7;
size[] = {0.1};
color[] = {{1,1,1,1}};
animationSpeed[] = {0,1};
randomDirectionPeriod = 0.2;
randomDirectionIntensity = 1.2;
positionVar[] = {2, 2, 2.5};
sizeVar = 0.01;
colorVar[] = {0, 0, 0, 0.1};
destroyOnWaterSurface = 1;
};
};

26
addons/goggles/define.hpp Normal file
View File

@ -0,0 +1,26 @@
// Control types
#define CT_STATIC 0
#define ST_PICTURE 0x30
////////////////
//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;
};

View File

@ -0,0 +1,35 @@
/*
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";
_effects = GETGLASSES(ace_player,GLASSESDEFAULT);
_effects set [DIRT, true];
SETGLASSES(ace_player,_effects);
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

View File

@ -0,0 +1,61 @@
/*
Name: fnc_applyDust.sqf
Author: Garth de Wet (LH)
Description:
Applies dust to screen.
Parameters:
Nothing
Returns:
Nothing
Example 1:
call FUNC(ApplyDust);
*/
#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" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1];
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1));
SETDUST(DBULLETS,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);
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;
SETDUST(DBULLETS,0);
if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
GVAR(DustHandler) = -1;
};
GVAR(DustHandler) = [{
if (diag_tickTime >= GETDUSTT(DTIME) + 3) then {
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
private "_amount";
_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
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 0.5;
};
if (GETDUSTT(DAMOUNT) <= 0) then {
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 2;
[{GVAR(PostProcessEyes) ppEffectEnable false;}, [], 2, 0.5] call EFUNC(common,waitAndExecute);
SETDUST(DACTIVE,false);
SETDUST(DBULLETS,0);
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
GVAR(DustHandler) = -1;
};
};
},0,[]] call CALLSTACK(cba_fnc_addPerFrameHandler);

View File

@ -1,53 +1,56 @@
/* /*
Name: AGM_Goggles_fnc_ApplyGlassesEffect Name: fnc_ApplyGlassesEffect.sqf
Author: Garth de Wet (LH) Author: Garth de Wet (LH)
Description: Description:
Sets screen tint for glasses. Sets screen tint for glasses.
Sets screen overlay for glasses. (broken/fixed) Sets screen overlay for glasses. (broken/fixed)
Sets dirt/rain overlay for glasses. Sets dirt/rain overlay for glasses.
Parameters: Parameters:
0: STRING - Glasses class name to be applied. 0: STRING - Glasses class name to be applied.
Returns: Returns:
Nothing Nothing
Example: Example:
(goggles player) call AGM_Goggles_fnc_ApplyGlassesEffect; (goggles ace_player) call FUNC(ApplyGlassesEffect);
*/ */
#include "\AGM_Goggles\script.sqf" #include "script_component.hpp"
private["_postProcessColour", "_postProcessTintAmount", "_glassesClassname", "_glassImagePath"]; private["_postProcessColour", "_postProcessTintAmount", "_glassesClassname", "_glassImagePath"];
_glassesClassname = _this; _glassesClassname = _this;
_postProcessColour = getArray(configFile >> "CfgGlasses" >> _glassesClassname >> "AGM_Color"); _postProcessColour = getArray(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Color");
_postProcessTintAmount = getNumber(configFile >> "CfgGlasses" >> _glassesClassname >> "AGM_TintAmount"); _postProcessTintAmount = getNumber(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_TintAmount");
call AGM_Goggles_fnc_RemoveGlassesEffect; call FUNC(removeGlassesEffect);
AGM_Goggles_EffectsActive = true; GVAR(EffectsActive) = true;
if (_postProcessTintAmount != 0 && {AGM_Goggles_UsePP}) then { if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then {
_postProcessColour set [3, _postProcessTintAmount/100]; _postProcessColour set [3, _postProcessTintAmount/100];
AGM_Goggles_PostProcess ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]];
AGM_Goggles_PostProcess ppEffectCommit 0; GVAR(PostProcess) ppEffectCommit 0;
AGM_Goggles_PostProcess ppEffectEnable true; 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;
}; };
_glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "AGM_Overlay"); _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Overlay");
if GETBROKEN then { if GETBROKEN then {
_glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "AGM_OverlayCracked"); _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_OverlayCracked");
}; };
if (_glassImagePath != "") then { if (_glassImagePath != "") then {
150 cutRsc["RscAGM_Goggles", "PLAIN",1, false]; 150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
(GLASSDISPLAY displayCtrl 10650) ctrlSetText _glassImagePath; (GLASSDISPLAY displayCtrl 10650) ctrlSetText _glassImagePath;
}; };
if GETDIRT then { if GETDIRT then {
call AGM_Goggles_fnc_ApplyDirtEffect; call FUNC(applyDirtEffect);
}; };
if GETDUSTT(DACTIVE) then { if GETDUSTT(DACTIVE) then {
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
call AGM_Goggles_fnc_ApplyDust; call FUNC(applyDust);
}; };

View File

@ -0,0 +1,37 @@
/*
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.
*/
#include "script_component.hpp"
if (!alive ace_player) exitWith {};
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);
};
};
};

View File

@ -0,0 +1,38 @@
/*
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;
_effects = GLASSESDEFAULT;
_effects set [BROKEN, _broken];
SETGLASSES(ace_player,_effects);
if ((stance ace_player) != "PRONE") then {
ace_player playActionNow "gestureWipeFace";
};
[{
if (cameraView == "INTERNAL") then {
addCamShake [5, 1.75, 2];
};
}, [], 0.3, 0] call EFUNC(common,waitAndExecute);
call FUNC(removeDirtEffect);
call FUNC(removeRainEffect);
call FUNC(removeDustEffect);

View File

@ -1,29 +1,30 @@
/* /*
Name: AGM_Goggles_fnc_DustHandler fnc_DustHandler.sqf
Author: Garth de Wet (LH) Author: Garth de Wet (LH)
Description: Description:
Determines whether to place dust on the goggles, based on calibre of weapon fired and other requirements. 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) 0: Object - unit - eventhandler was attached to. (Used)
1: String - weapon - Weapon fired (Used) 1: String - weapon - Weapon fired (Used)
Returns: Returns:
Nothing Nothing
Example: Example:
player addEventHandler ["Fired", {[_this select 0, _this select 1] call AGM_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 See http://community.bistudio.com/wiki/ArmA_3:_Event_Handlers#Fired
*/ */
#include "\AGM_Goggles\script.sqf" #include "script_component.hpp"
private ["_bullets", "_position", "_surface", "_found", "_weapon", "_cloudType", "_unit"];
private ["_bullets", "_position", "_surface", "_found", "_weapon", "_cloudType"]; EXPLODE_2_PVT(_this,_unit,_weapon);
_weapon = _this select 1; if (_unit != ace_player) exitWith {true};
_cloudType = ""; _cloudType = "";
if ((_this select 0) != player) exitWith {true}; if (rain > 0.1) exitWith {true};
if ((stance _unit) != "PRONE") exitWith {true};
if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect")) then { if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect")) then {
_cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName"); _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName");
@ -34,10 +35,8 @@ if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEff
}; };
if (_cloudType == "") exitWith {true}; if (_cloudType == "") exitWith {true};
if (rain > 0.1) exitWith {true};
if ((stance player) != "PRONE") exitWith {true};
_position = getPosATL player; _position = getPosATL _unit;
if (surfaceIsWater _position) exitWith {}; if (surfaceIsWater _position) exitWith {};
if ((_position select 2) > 0.2) exitWith {}; if ((_position select 2) > 0.2) exitWith {};
@ -52,24 +51,24 @@ if (!_found) exitWith {};
_bullets = GETDUSTT(DBULLETS); _bullets = GETDUSTT(DBULLETS);
if ((time - GETDUSTT(DTIME)) > 1) then { if ((diag_tickTime - GETDUSTT(DTIME)) > 1) then {
_bullets = 0; _bullets = 0;
}; };
_bullets = _bullets + 1; _bullets = _bullets + 1;
SETDUST(DBULLETS,_bullets); SETDUST(DBULLETS,_bullets);
SETDUST(DTIME,time); SETDUST(DTIME,diag_tickTime);
if (GETDUSTT(DAMOUNT) < 2) then { if (GETDUSTT(DAMOUNT) < 2) then {
private "_bulletsRequired"; private "_bulletsRequired";
_bulletsRequired = 100; _bulletsRequired = 100;
if (isNumber (ConfigFile >> _cloudType >> "AGM_Goggles_BulletCount")) then { if (isNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount")) then {
_bulletsRequired = getNumber (ConfigFile >> _cloudType >> "AGM_Goggles_BulletCount"); _bulletsRequired = getNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount");
}; };
if (_bulletsRequired <= _bullets) then { if (_bulletsRequired <= _bullets) then {
SETDUST(DACTIVE,true); SETDUST(DACTIVE,true);
call AGM_Goggles_fnc_ApplyDust; call FUNC(applyDust);
}; };
}; };
true true

View File

@ -1,19 +1,20 @@
/* /*
Name: AGM_Goggles_fnc_ExternalCamera fnc_ExternalCamera.sqf
Author: Garth de Wet (LH) Author: Garth de Wet (LH)
Description: Description:
Returns if the camera is external or not. Returns if the camera is external or not.
Parameters: Parameters:
Nothing Nothing
Returns: Returns:
Boolean - whether the camera is in external view or not. Boolean - whether the camera is in external view or not.
Example: Example:
call AGM_Goggles_fnc_ExternalCamera; call FUNC(ExternalCamera);
*/ */
if (profileNamespace getVariable ["AGM_showInThirdPerson", false]) exitWith { false }; #include "script_component.hpp"
if (GETVAR(profileNamespace,ACE_showInThirdPerson,false)) exitWith { false };
(cameraView == "External") (cameraView == "External")

View 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

View File

@ -1,20 +1,21 @@
/* /*
Name: AGM_Goggles_fnc_isDivingGoggles fnc_isDivingGoggles.sqf
Author: Garth de Wet (LH) Author: Garth de Wet (LH)
Description: Description:
Determines whether current goggles worn by passed unit is diving goggles or a variant of them. Determines whether current goggles worn by passed unit is diving goggles or a variant of them.
Parameters: Parameters:
0: String - Glasses classname 0: String - Glasses classname
Returns: Returns:
Boolean - whether diving goggles are worn Boolean - whether diving goggles are worn
Example: Example:
(goggles player) call AGM_Goggles_fnc_isDivingGoggles; (goggles ace_player) call FUNC(isDivingGoggles);
*/ */
#include "script_component.hpp"
private ["_result", "_glasses"]; private ["_result", "_glasses"];
_glasses = _this; _glasses = _this;
_result = _glasses == "G_Diving"; _result = _glasses == "G_Diving";

View File

@ -1,20 +1,21 @@
/* /*
Name: AGM_Goggles_fnc_isGogglesVisible fnc_isGogglesVisible.sqf
Author: Garth de Wet (LH) Author: Garth de Wet (LH)
Description: Description:
Determines if goggles are visible on passed unit (Also checks if unit is in vehicle and cameraView is set to GUNNER) 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 0: Object - unit to check for visible goggles
Returns: Returns:
BOOL - Whether the goggles are visible or not. BOOL - Whether the goggles are visible or not.
Example: Example:
_visible = player call AGM_Goggles_fnc_isGogglesVisible; _visible = ace_player call FUNC(isGogglesVisible);
*/ */
#include "script_component.hpp"
private ["_currentGlasses", "_result", "_unit"]; private ["_currentGlasses", "_result", "_unit"];
_unit = _this; _unit = _this;
@ -26,12 +27,12 @@ if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")};
if (_currentGlasses != "") then { if (_currentGlasses != "") then {
_position =(getPosASLW _unit); _position =(getPosASLW _unit);
if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith { if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith {
_result = (_currentGlasses call AGM_Goggles_fnc_isDivingGoggles); _result = (_currentGlasses call FUNC(isDivingGoggles));
}; };
if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "AGM_Resistance") == 0) exitWith { if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith {
_result = false; _result = false;
}; };
_result = !(_currentGlasses call AGM_Goggles_fnc_isDivingGoggles); _result = !(_currentGlasses call FUNC(isDivingGoggles));
}; };
_result _result

View File

@ -1,24 +1,25 @@
/* /*
Name: AGM_Goggles_fnc_isInRotorWash fnc_isInRotorWash.sqf
Author: Garth de Wet (LH) Author: Garth de Wet (LH)
Description: Description:
Checks for nearby helicopters (within 15m) Checks for nearby helicopters (within 15m)
Parameters: Parameters:
0: Object - Unit 0: Object - Unit
1: NUMBER - (optional) Radius to check for helicopter Default: 15 1: NUMBER - (optional) Radius to check for helicopter Default: 15
Returns: Returns:
Array: Array:
0 - boolean - If in rotorwash 0 - boolean - If in rotorwash
1 - number - Amount of rotor wash. 1 - number - Amount of rotor wash.
Example: Example:
if (([player, 10] call AGM_Goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; }; if (([ace_player, 10] call FUNC(isInRotorWash)) select 0) then { hint "Rotor wash"; };
if (([player] call AGM_Goggles_fnc_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"]; private ["_heli", "_unit", "_result", "_radius"];
_unit = _this select 0; _unit = _this select 0;
_radius = 15; _radius = 15;
@ -41,6 +42,7 @@ _heli = (getPosATL _unit) nearEntities [["Helicopter"], _radius];
}; };
}; };
}; };
false
} count _heli; } count _heli;
_result _result

View 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)) exitWith {};
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 (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
GVAR(DustHandler) = -1;
};
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
GVAR(PostProcessEyes) ppEffectCommit 2;
GVAR(DustHandler) = [{
GVAR(PostProcessEyes) ppEffectEnable false;
GVAR(DustHandler) = -1;
}, [], 2, 0.5] call EFUNC(common,waitAndExecute);
};
};
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 (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
GVAR(DustHandler) = -1;
};
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;
};
};

View File

@ -0,0 +1,55 @@
/*
fnc_rainEffect.sqf
Author: Garth de Wet (LH)
Description:
Parameters:
Nothing
Returns:
Nothing
Example:
[] call FUNC(RainEffect);
*/
#include "script_component.hpp"
private ["_fnc_underCover"];
if (isNull(ace_player) || {!(alive ace_player)}) exitWith {};
_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])}
};
if (!isNull(findDisplay 312)) exitWith {
if (GVAR(RainActive)) then {
call FUNC(RemoveRainEffect);
};
};
// Ignore if ace_player is under water
if (!GVAR(EffectsActive) || {underwater ace_player}) exitWith{call FUNC(RemoveRainEffect);};
if (GVAR(RainLastLevel) != rain) then {
call FUNC(RemoveRainEffect);
GVAR(RainLastLevel) = rain;
// Rain is happening
if (GVAR(RainLastLevel) > 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 - GVAR(RainLastLevel)));
GVAR(RainDrops) attachTo [vehicle ace_player,[0,0,0]];
};
}else{
if (GVAR(RainLastLevel) > 0.05) then {
if (GVAR(RainActive) && {[ace_player] call _fnc_underCover}) exitWith {
call FUNC(RemoveRainEffect);
};
if (!GVAR(RainActive)) then {
GVAR(RainLastLevel) = -1;
};
};
};

View 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 "";
};

View 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 "";
};

View 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);

View File

@ -0,0 +1,23 @@
/*
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;
GVAR(RainLastLevel) = 0;

View File

@ -0,0 +1 @@
#include "\z\ace\addons\goggles\script_component.hpp"

View File

@ -0,0 +1,37 @@
#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 GETGLASSES(unit) GETVAR(unit,GVAR(Condition),GLASSESDEFAULT)
#define SETGLASSES(unit,value) SETVAR(unit,GVAR(Condition),value)
#define DIRT 0
#define DUST 1
#define BROKEN 2
#define GETDIRT (GETGLASSES(ace_player) select DIRT)
#define GETDUST (GETGLASSES(ace_player) select DUST)
#define GETBROKEN (GETGLASSES(ace_player) select BROKEN)
#define GETDUSTT(type) ((GETGLASSES(ace_player) select DUST) select type)
#define SETDUST(type,value) (GETGLASSES(ace_player) 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}})

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-19 --> <!-- Edited with tabler - 2014-12-19 -->
<Project name="AGM"> <Project name="ACE">
<Package name="Goggles"> <Package name="Goggles">
<Key ID="STR_AGM_Goggles_ShowInThirdPerson"> <Key ID="STR_ACE_Goggles_ShowInThirdPerson">
<English>Show Goggle Effects in Third Person</English> <English>Show Goggle Effects in Third Person</English>
<German>Brilleneffekt in dritter Person anzeigen</German> <German>Brilleneffekt in dritter Person anzeigen</German>
<Spanish>Mostrar efectos de las gafas en tercera persona</Spanish> <Spanish>Mostrar efectos de las gafas en tercera persona</Spanish>
@ -14,7 +14,7 @@
<Portuguese>Mostrar efeitos de óculos em Terceira Pessoa</Portuguese> <Portuguese>Mostrar efeitos de óculos em Terceira Pessoa</Portuguese>
<Italian>Attiva l'effetto degli occhiali in terza persona</Italian> <Italian>Attiva l'effetto degli occhiali in terza persona</Italian>
</Key> </Key>
<Key ID="STR_AGM_Goggles_WipeGlasses"> <Key ID="STR_ACE_Goggles_WipeGlasses">
<English>Wipe Goggles</English> <English>Wipe Goggles</English>
<German>Brille abwischen</German> <German>Brille abwischen</German>
<Spanish>Limpiar gafas</Spanish> <Spanish>Limpiar gafas</Spanish>
@ -27,4 +27,4 @@
<Italian>Pulisci gli occhiali</Italian> <Italian>Pulisci gli occhiali</Italian>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -1,3 +1,7 @@
#include "script_component.hpp" #include "script_component.hpp"
ADDON = false;
PREP(empty); PREP(empty);
ADDON = true;

0
tools/rename_fn.py Normal file → Executable file
View File

0
tools/stringtableduplicates.py Normal file → Executable file
View File