mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Moved effect functions to GUI folder
This commit is contained in:
parent
ef4248650e
commit
f25766d4e4
@ -17,5 +17,8 @@ PREP(displayInformation);
|
||||
PREP(displayMessage);
|
||||
PREP(blurScreen);
|
||||
PREP(displayIcon);
|
||||
PREP(effectPain);
|
||||
PREP(effectBleeding);
|
||||
PREP(effectBlackOut);
|
||||
|
||||
ADDON = true;
|
21
addons/gui/functions/fnc_effectBlackOut.sqf
Normal file
21
addons/gui/functions/fnc_effectBlackOut.sqf
Normal 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];
|
||||
};
|
36
addons/gui/functions/fnc_effectBleeding.sqf
Normal file
36
addons/gui/functions/fnc_effectBleeding.sqf
Normal 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;
|
32
addons/gui/functions/fnc_effectPain.sqf
Normal file
32
addons/gui/functions/fnc_effectPain.sqf
Normal 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;
|
Loading…
Reference in New Issue
Block a user