2015-09-18 07:38:19 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
2016-07-12 14:13:53 +00:00
|
|
|
* Blurs screen.
|
2015-01-16 23:22:37 +00:00
|
|
|
*
|
2015-09-18 07:38:19 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: ID <NUMBER>
|
2017-06-08 13:31:51 +00:00
|
|
|
* 1: Show? <BOOL, NUMBER>
|
2015-09-18 07:38:19 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2016-07-12 14:13:53 +00:00
|
|
|
* Example:
|
|
|
|
* [5, true] call ace_common_fnc_blurScreen
|
|
|
|
*
|
2015-09-18 07:38:19 +00:00
|
|
|
* Public: Yes
|
2015-01-16 23:22:37 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-09-11 14:58:26 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
2015-09-09 15:05:48 +00:00
|
|
|
|
2015-09-18 07:38:19 +00:00
|
|
|
params ["_id", ["_show", false]];
|
|
|
|
|
2015-11-20 17:40:31 +00:00
|
|
|
if (_show isEqualType 0) then {
|
2015-09-18 07:38:19 +00:00
|
|
|
_show = _show == 1;
|
|
|
|
};
|
2015-01-16 23:22:37 +00:00
|
|
|
|
2015-05-14 18:02:42 +00:00
|
|
|
if (isNil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
GVAR(SHOW_BLUR_SCREEN_COLLECTION) = [];
|
2015-01-16 23:22:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (_show) then {
|
2015-09-18 07:38:19 +00:00
|
|
|
GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushBack _id;
|
|
|
|
|
2015-04-06 16:22:43 +00:00
|
|
|
// show blur
|
2015-11-30 16:22:16 +00:00
|
|
|
if (isNil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
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;
|
|
|
|
};
|
2015-01-16 23:22:37 +00:00
|
|
|
} else {
|
2015-04-06 16:22:43 +00:00
|
|
|
GVAR(SHOW_BLUR_SCREEN_COLLECTION) = GVAR(SHOW_BLUR_SCREEN_COLLECTION) - [_id];
|
2015-09-18 07:38:19 +00:00
|
|
|
|
2015-04-06 16:22:43 +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 {
|
2015-04-06 16:22:43 +00:00
|
|
|
ppEffectDestroy GVAR(MENU_ppHandle_GUI_BLUR_SCREEN);
|
|
|
|
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil;
|
|
|
|
};
|
|
|
|
};
|
2015-02-14 19:06:55 +00:00
|
|
|
};
|