mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #3997 from acemod/gogglesEffectsSetting
Add goggle setting for level of effects
This commit is contained in:
commit
55c7b9bfc4
@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
class ACE_Settings {
|
class ACE_Settings {
|
||||||
/*class GVAR(enable) { // @todo
|
class GVAR(effects) {
|
||||||
value = 0;
|
displayName = CSTRING(effects_displayName);
|
||||||
typeName = "BOOL";
|
typeName = "SCALAR";
|
||||||
isClientSettable = 1;
|
value = 2;
|
||||||
displayName = CSTRING(enable);
|
values[] = {ECSTRING(common,Disabled), CSTRING(effects_tintOnly), CSTRING(enabled_tintAndEffects)};
|
||||||
};*/
|
};
|
||||||
class GVAR(showInThirdPerson) {
|
class GVAR(showInThirdPerson) {
|
||||||
value = 0;
|
value = 0;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
|
@ -24,11 +24,3 @@ class Extended_Killed_EventHandlers {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extended_Explosion_EventHandlers {
|
|
||||||
class CAManBase {
|
|
||||||
class ADDON {
|
|
||||||
clientExplosion = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleExplosion)});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
["ACE3 Common", QGVAR(wipeGlasses), localize LSTRING(WipeGlasses), {
|
["ACE3 Common", QGVAR(wipeGlasses), localize LSTRING(WipeGlasses), {
|
||||||
|
if (GVAR(effects) != 2) exitWith {false}; //Can only wipe if full effects setting is set
|
||||||
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
|
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
|
||||||
call FUNC(clearGlasses);
|
call FUNC(clearGlasses);
|
||||||
true
|
true
|
||||||
@ -12,38 +13,25 @@ if (!hasInterface) exitWith {};
|
|||||||
{false},
|
{false},
|
||||||
[20, [true, true, false]], false] call CBA_fnc_addKeybind;
|
[20, [true, true, false]], false] call CBA_fnc_addKeybind;
|
||||||
|
|
||||||
// make sure to stack effect layers in correct order
|
|
||||||
GVAR(GogglesEffectsLayer) = QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer;
|
|
||||||
GVAR(GogglesLayer) = QGVAR(GogglesLayer) call BIS_fnc_RSCLayer;
|
|
||||||
|
|
||||||
if (isNil QGVAR(UsePP)) then {
|
["ace_settingsInitialized", {
|
||||||
|
TRACE_2("ace_settingsInitialized eh",GVAR(effects),GVAR(showInThirdPerson));
|
||||||
|
|
||||||
|
if (GVAR(effects) == 0) exitWith {};
|
||||||
|
|
||||||
|
// ---Add the TINT Effect---
|
||||||
|
|
||||||
|
// make sure to stack effect layers in correct order
|
||||||
|
GVAR(GogglesEffectsLayer) = QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer;
|
||||||
|
GVAR(GogglesLayer) = QGVAR(GogglesLayer) call BIS_fnc_RSCLayer;
|
||||||
|
|
||||||
|
if (isNil QGVAR(UsePP)) then {
|
||||||
GVAR(UsePP) = true;
|
GVAR(UsePP) = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// init pp effects
|
// init GlassesChanged eventhandler
|
||||||
GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995];
|
GVAR(OldGlasses) = "<null>";
|
||||||
GVAR(PostProcessEyes) = ppEffectCreate ["ColorCorrections", 1992];
|
["loadout", {
|
||||||
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(FrameEvent) = [false, [false, 20]];
|
|
||||||
GVAR(PostProcessEyes_Enabled) = false;
|
|
||||||
GVAR(DustHandler) = -1;
|
|
||||||
GVAR(RainDrops) = objNull;
|
|
||||||
GVAR(RainActive) = false;
|
|
||||||
GVAR(RainLastLevel) = 0;
|
|
||||||
GVAR(surfaceCache) = "";
|
|
||||||
GVAR(surfaceCacheIsDust) = false;
|
|
||||||
|
|
||||||
// init GlassesChanged eventhandler
|
|
||||||
GVAR(OldGlasses) = "<null>";
|
|
||||||
|
|
||||||
["loadout", {
|
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
private _currentGlasses = goggles _unit;
|
private _currentGlasses = goggles _unit;
|
||||||
@ -52,10 +40,34 @@ GVAR(OldGlasses) = "<null>";
|
|||||||
["ace_glassesChanged", [_unit, _currentGlasses]] call CBA_fnc_localEvent;
|
["ace_glassesChanged", [_unit, _currentGlasses]] call CBA_fnc_localEvent;
|
||||||
GVAR(OldGlasses) = _currentGlasses;
|
GVAR(OldGlasses) = _currentGlasses;
|
||||||
};
|
};
|
||||||
}] call CBA_fnc_addPlayerEventHandler;
|
}] call CBA_fnc_addPlayerEventHandler;
|
||||||
|
|
||||||
// add glasses eventhandlers
|
|
||||||
["ace_glassesChanged", {
|
// init pp effects
|
||||||
|
GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995];
|
||||||
|
GVAR(EffectsActive) = false;
|
||||||
|
|
||||||
|
// check goggles
|
||||||
|
private _fnc_checkGoggles = {
|
||||||
|
params ["_unit"];
|
||||||
|
|
||||||
|
if (GVAR(EffectsActive)) then {
|
||||||
|
if (call FUNC(externalCamera) || {!([_unit] call FUNC(isGogglesVisible))}) then {
|
||||||
|
call FUNC(removeGlassesEffect);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if (!(call FUNC(externalCamera)) && {[_unit] call FUNC(isGogglesVisible)}) then {
|
||||||
|
[goggles _unit] call FUNC(applyGlassesEffect);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
["cameraView", _fnc_checkGoggles] call CBA_fnc_addPlayerEventHandler;
|
||||||
|
["ace_activeCameraChanged", _fnc_checkGoggles] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
|
|
||||||
|
// add glasses eventhandlers
|
||||||
|
["ace_glassesChanged", {
|
||||||
params ["_unit", "_glasses"];
|
params ["_unit", "_glasses"];
|
||||||
|
|
||||||
SETGLASSES(_unit,GLASSESDEFAULT);
|
SETGLASSES(_unit,GLASSESDEFAULT);
|
||||||
@ -67,9 +79,33 @@ GVAR(OldGlasses) = "<null>";
|
|||||||
} else {
|
} else {
|
||||||
call FUNC(removeGlassesEffect);
|
call FUNC(removeGlassesEffect);
|
||||||
};
|
};
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
["ace_glassesCracked", {
|
|
||||||
|
// // ---Add the Dust/Dirt/Rain Effects---
|
||||||
|
if (GVAR(effects) == 2) then {
|
||||||
|
|
||||||
|
// Register fire event handler
|
||||||
|
["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
|
//Add Explosion XEH
|
||||||
|
["CAManBase", "explosion", FUNC(handleExplosion)] call CBA_fnc_addClassEventHandler;
|
||||||
|
|
||||||
|
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(PostProcessEyes_Enabled) = false;
|
||||||
|
|
||||||
|
GVAR(FrameEvent) = [false, [false, 20]];
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
|
GVAR(RainDrops) = objNull;
|
||||||
|
GVAR(RainActive) = false;
|
||||||
|
GVAR(RainLastLevel) = 0;
|
||||||
|
GVAR(surfaceCache) = "";
|
||||||
|
GVAR(surfaceCacheIsDust) = false;
|
||||||
|
|
||||||
|
["ace_glassesCracked", {
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
_unit setVariable ["ACE_EyesDamaged", true];
|
_unit setVariable ["ACE_EyesDamaged", true];
|
||||||
@ -93,28 +129,10 @@ GVAR(OldGlasses) = "<null>";
|
|||||||
|
|
||||||
}, _unit, 25] call CBA_fnc_waitAndExecute;
|
}, _unit, 25] call CBA_fnc_waitAndExecute;
|
||||||
|
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
// check goggles
|
// goggles effects main PFH
|
||||||
private _fnc_checkGoggles = {
|
[{
|
||||||
params ["_unit"];
|
|
||||||
|
|
||||||
if (GVAR(EffectsActive)) then {
|
|
||||||
if (call FUNC(externalCamera) || {!([_unit] call FUNC(isGogglesVisible))}) then {
|
|
||||||
call FUNC(removeGlassesEffect);
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
if (!(call FUNC(externalCamera)) && {[_unit] call FUNC(isGogglesVisible)}) then {
|
|
||||||
[goggles _unit] call FUNC(applyGlassesEffect);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
["cameraView", _fnc_checkGoggles] call CBA_fnc_addPlayerEventHandler;
|
|
||||||
["ace_activeCameraChanged", _fnc_checkGoggles] call CBA_fnc_addEventHandler;
|
|
||||||
|
|
||||||
// goggles effects main PFH
|
|
||||||
[{
|
|
||||||
BEGIN_COUNTER(goggles);
|
BEGIN_COUNTER(goggles);
|
||||||
|
|
||||||
// rain
|
// rain
|
||||||
@ -131,7 +149,6 @@ private _fnc_checkGoggles = {
|
|||||||
call FUNC(applyRotorWashEffect);
|
call FUNC(applyRotorWashEffect);
|
||||||
|
|
||||||
END_COUNTER(goggles);
|
END_COUNTER(goggles);
|
||||||
}, 0.5, []] call CBA_fnc_addPerFrameHandler;
|
}, 0.5, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
};
|
||||||
// Register fire event handler
|
}] call CBA_fnc_addEventHandler;
|
||||||
["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
|
|
||||||
|
@ -46,13 +46,15 @@ if (_imagePath != "") then {
|
|||||||
(GLASSDISPLAY displayCtrl 10650) ctrlSetText _imagePath;
|
(GLASSDISPLAY displayCtrl 10650) ctrlSetText _imagePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GETDIRT) then {
|
if (GVAR(effects) == 2) then {
|
||||||
|
if (GETDIRT) then {
|
||||||
call FUNC(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 FUNC(applyDustEffect);
|
call FUNC(applyDustEffect);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(EffectsActive) = true;
|
GVAR(EffectsActive) = true;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
// Handle the ThreeDen Editor Camera
|
// Handle the ThreeDen Editor Camera
|
||||||
if ((!isNil {is3DEN}) && {is3DEN}) exitWith {true};
|
if (is3DEN) exitWith {true};
|
||||||
|
|
||||||
if (GVAR(showInThirdPerson)) then {
|
if (GVAR(showInThirdPerson)) then {
|
||||||
cameraView in ["GROUP"] || EFUNC(common,isFeatureCameraActive)
|
cameraView in ["GROUP"] || EFUNC(common,isFeatureCameraActive)
|
||||||
|
@ -15,20 +15,21 @@
|
|||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
if (_unit != ACE_player) exitWith {true};
|
if (_unit != ACE_player) exitWith {true};
|
||||||
|
if (GVAR(effects) == 0) exitWith {true};
|
||||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
|
||||||
|
|
||||||
SETGLASSES(_unit,GLASSESDEFAULT);
|
|
||||||
|
|
||||||
call FUNC(removeGlassesEffect);
|
call FUNC(removeGlassesEffect);
|
||||||
|
|
||||||
GVAR(EffectsActive) = false;
|
if (GVAR(effects) == 2) then {
|
||||||
|
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||||
|
|
||||||
_unit setVariable ["ACE_EyesDamaged", false];
|
SETGLASSES(_unit,GLASSESDEFAULT);
|
||||||
|
|
||||||
if (GVAR(DustHandler) != -1) then {
|
_unit setVariable ["ACE_EyesDamaged", false];
|
||||||
|
|
||||||
|
if (GVAR(DustHandler) != -1) then {
|
||||||
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
||||||
|
};
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
};
|
};
|
||||||
GVAR(DustHandler) = -1;
|
|
||||||
|
|
||||||
true
|
true
|
||||||
|
@ -22,6 +22,8 @@ if (!isNull (GLASSDISPLAY)) then {
|
|||||||
GLASSDISPLAY closeDisplay 0;
|
GLASSDISPLAY closeDisplay 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
call FUNC(removeDirtEffect);
|
if (GVAR(effects) == 2) then {
|
||||||
call FUNC(removeRainEffect);
|
call FUNC(removeDirtEffect);
|
||||||
call FUNC(removeDustEffect);
|
call FUNC(removeRainEffect);
|
||||||
|
call FUNC(removeDustEffect);
|
||||||
|
};
|
||||||
|
@ -25,5 +25,14 @@
|
|||||||
<Portuguese>Limpar Óculos</Portuguese>
|
<Portuguese>Limpar Óculos</Portuguese>
|
||||||
<Italian>Pulisci gli occhiali</Italian>
|
<Italian>Pulisci gli occhiali</Italian>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Goggles_effects_displayName">
|
||||||
|
<English>Goggle Effects</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Goggles_effects_tintOnly">
|
||||||
|
<English>Tint</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Goggles_enabled_tintAndEffects">
|
||||||
|
<English>Tint + Effects</English>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue
Block a user