ACE3/addons/common/functions/fnc_blurScreen.sqf

52 lines
1.3 KiB
Plaintext
Raw Normal View History

2015-09-18 07:38:19 +00:00
/*
* Author: Glowbal
* Blurs screen.
*
2015-09-18 07:38:19 +00:00
* Arguments:
* 0: ID <NUMBER>
* 1: Show? <BOOL, NUMBER>
2015-09-18 07:38:19 +00:00
*
* Return Value:
* None
*
* Example:
* [5, true] call ace_common_fnc_blurScreen
*
2015-09-18 07:38:19 +00:00
* Public: Yes
*/
#include "script_component.hpp"
if (!hasInterface) exitWith {};
2015-09-18 07:38:19 +00:00
params ["_id", ["_show", false]];
if (_show isEqualType 0) then {
2015-09-18 07:38:19 +00:00
_show = _show == 1;
};
2015-05-14 18:02:42 +00:00
if (isNil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then {
GVAR(SHOW_BLUR_SCREEN_COLLECTION) = [];
};
if (_show) then {
2015-09-18 07:38:19 +00:00
GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushBack _id;
// show blur
2015-11-30 16:22:16 +00:00
if (isNil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then {
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102];
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9];
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true;
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectCommit 0;
};
} else {
GVAR(SHOW_BLUR_SCREEN_COLLECTION) = GVAR(SHOW_BLUR_SCREEN_COLLECTION) - [_id];
2015-09-18 07:38:19 +00:00
if (GVAR(SHOW_BLUR_SCREEN_COLLECTION) isEqualTo []) then {
// hide blur
2015-09-18 07:38:19 +00:00
if (!isNil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then {
ppEffectDestroy GVAR(MENU_ppHandle_GUI_BLUR_SCREEN);
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil;
};
};
};