Skip to content

Commit

Permalink
GUI - Allow Volume Control during ACE Progressbar Dialog (#1336)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrschick authored Dec 18, 2024
1 parent fbf348d commit 81e582c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion addons/sys_gui/fnc_volumeKeyDown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@
* Public: No
*/

if (!alive acre_player || dialog || ACRE_IS_SPECTATOR || GVAR(volumeOpen)) exitWith {false};
if (!alive acre_player || ACRE_IS_SPECTATOR || GVAR(volumeOpen)) exitWith {false};

// Abort on open Dialogs that aren't an ACE Progressbar
private _aceProgressBar = displayNull;
if (
(dialog && !EGVAR(sys_core,aceLoaded)) ||
{_aceProgressBar = (uiNamespace getVariable ["ace_common_dlgProgress", displayNull]); _aceProgressBar isEqualTo displayNull}
) exitWith {false};

// Add MouseScroll EH to open ACE Progressbar, for volume control
if (dialog && {!(_aceProgressBar getVariable [QGVAR(mouseScrollEHAdded), false])}) then {
_aceProgressBar displayAddEventHandler ["MouseZChanged", LINKFUNC(onMouseZChanged)];
_aceProgressBar setVariable [QGVAR(mouseScrollEHAdded), true];
};

inGameUISetEventHandler ["PrevAction", "true"];
inGameUISetEventHandler ["NextAction", "true"];
Expand Down

0 comments on commit 81e582c

Please sign in to comment.