Skip to content

Commit

Permalink
Merge pull request #2363 from acemod/MedicalMenuBlackoutBlur
Browse files Browse the repository at this point in the history
Add Screen Blur and Blackout for Medical Menu by Interact_menu setting
  • Loading branch information
thojkooi committed Sep 5, 2015
2 parents d617fba + c70c9cd commit c8a7b94
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions addons/medical_menu/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
ADDON = false;

PREP(onMenuOpen);
PREP(onMenuClose);
PREP(openMenu);

PREP(canOpenMenu);
Expand Down
21 changes: 21 additions & 0 deletions addons/medical_menu/functions/fnc_onMenuClose.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Author: joko // Jonas
* Handle medical menu closed
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_medical_menu_onMenuClosed
*
* Public: No
*/
#include "script_component.hpp"

if (EGVAR(interact_menu,menuBackground)==1) then {[QGVAR(id), false] call EFUNC(common,blurScreen);};
if (EGVAR(interact_menu,menuBackground)==2) then {(uiNamespace getVariable [QEGVAR(interact_menu,menuBackground), displayNull]) closeDisplay 0;};

[GVAR(MenuPFHID)] call CBA_fnc_removePerFrameHandler;
3 changes: 3 additions & 0 deletions addons/medical_menu/functions/fnc_onMenuOpen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ params ["_display"];

if (isNil "_display") exitwith {};

if (EGVAR(interact_menu,menuBackground)==1) then {[QGVAR(id), true] call EFUNC(common,blurScreen);};
if (EGVAR(interact_menu,menuBackground)==2) then {0 cutRsc[QEGVAR(interact_menu,menuBackground), "PLAIN", 1, false];};

if (isNil QGVAR(LatestDisplayOptionMenu)) then {
GVAR(LatestDisplayOptionMenu) = "triage";
} else {
Expand Down
4 changes: 2 additions & 2 deletions addons/medical_menu/ui/menu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class GVAR(medicalMenu) {
idd = 314412;
movingEnable = true;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [_this select 0] call FUNC(onMenuOpen););
onUnload = QUOTE([GVAR(MenuPFHID)] call CBA_fnc_removePerFrameHandler;);
onUnload = QUOTE([] call FUNC(onMenuClose));
class controlsBackground {
class HeaderBackground: ACE_gui_backgroundBase{
class HeaderBackground: ACE_gui_backgroundBase {
idc = -1;
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
Expand Down

0 comments on commit c8a7b94

Please sign in to comment.