Moved effect functions to GUI folder

This commit is contained in:
Thomas Kooi 2015-01-17 12:05:07 +01:00
parent ef4248650e
commit f25766d4e4
4 changed files with 92 additions and 0 deletions

View File

@ -17,5 +17,8 @@ PREP(displayInformation);
PREP(displayMessage);
PREP(blurScreen);
PREP(displayIcon);
PREP(effectPain);
PREP(effectBleeding);
PREP(effectBlackOut);
ADDON = true;

View File

@ -0,0 +1,21 @@
/**
* fn_effectBlackOut.sqf
* @Descr: Displays the blacked out effect for clients.
* @Author: Glowbal
*
* @Arguments: [displayEffect BOOL]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_displayEffect","_effect"];
_displayEffect = [_this, 0, false,[false]] call bis_fnc_param;
disableSerialization;
_effect = uiNamespace getVariable QGVAR(ScreenEffectsBlack);
if (_displayEffect) then {
(_effect displayCtrl 11112) ctrlSetTextColor [0.0,0.0,0.0,0.9];
} else {
(_effect displayCtrl 11112) ctrlSetTextColor [0.0,0.0,0.0,0.0];
};

View File

@ -0,0 +1,36 @@
/**
* fn_effectBleeding.sqf
* @Descr: Displays the ACE Bleeding effect
* @Author: Glowbal
*
* @Arguments: [bloodLoss NUMBER]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
if (isnil QGVAR(DisplayingBleedingEffect)) then {
GVAR(DisplayingBleedingEffect) = false;
};
if (GVAR(DisplayingBleedingEffect)) exitwith {};
private ["_bloodLoss","_time"];
_bloodLoss = _this select 0;
if (!(_bloodLoss > 0)) exitwith{};
_time = 10 - _bloodLoss;
if (_time < 1.5) then {
_time = 1.5;
};
GVAR(DisplayingBleedingEffect) = true;
47 cutRsc [QGVAR(ScreenEffectsBleeding),"PLAIN"];
[{
if !(isnil QGVAR(DisplayingBleedingEffect_ran)) then {
GVAR(DisplayingBleedingEffect_ran) = nil;
GVAR(DisplayingBleedingEffect) = false;
[(_this select 1)] call cba_fnc_removePerFrameHandler;
} else {
GVAR(DisplayingBleedingEffect_ran) = true;
};
}, _time, [] ] call CBA_fnc_addPerFrameHandler;

View File

@ -0,0 +1,32 @@
/**
* fn_effectPain.sqf
* @Descr: Displays the ACE Pain effect
* @Author: Glowbal
*
* @Arguments: [painRatio NUMBER]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
if (isnil QGVAR(DisplayingPainEffect)) then {
GVAR(DisplayingPainEffect) = false;
};
if (GVAR(DisplayingPainEffect)) exitwith {};
private ["_ratio","_time"];
_ratio = _this select 0;
if (!(_ratio > 0)) exitwith{};
_time = 6 - _ratio;
if (_time <1.5) then {
_time = 1.5;
};
GVAR(DisplayingPainEffect) = true;
46 cutRsc [QGVAR(ScreenEffectsPain),"PLAIN"];
[{
GVAR(DisplayingPainEffect) = false;
[(_this select 1)] call cba_fnc_removePerFrameHandler;
}, _time, [] ] call CBA_fnc_addPerFrameHandler;