Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI - Allow Volume Control during ACE Progressbar Dialog #1336

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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