Common - Fix disableUserInput blocking respawn (#9053)

This commit is contained in:
mharis001 2023-01-31 18:14:50 -05:00 committed by GitHub
parent 8d2d49202d
commit b4005bca43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,11 +107,24 @@ if (_state) then {
}; };
GVAR(disableInputPFH) = [{ GVAR(disableInputPFH) = [{
if (isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) && {!visibleMap && {isNull findDisplay IDD_INTERRUPT} && {isNull findDisplay IDD_RSCDISPLAYCURATOR} && {isNull findDisplay IDD_TEAMSWITCH}}) then { if (isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) && {!visibleMap && {isNull findDisplay IDD_INTERRUPT} && {isNull findDisplay IDD_RSCDISPLAYCURATOR} && {isNull findDisplay IDD_TEAMSWITCH}}) exitWith {
[GVAR(disableInputPFH)] call CBA_fnc_removePerFrameHandler; [GVAR(disableInputPFH)] call CBA_fnc_removePerFrameHandler;
GVAR(disableInputPFH) = nil; GVAR(disableInputPFH) = nil;
[true] call FUNC(disableUserInput); [true] call FUNC(disableUserInput);
}; };
// Allow user input if the player is respawning and a respawn template (menu position or spectator)
// is open (otherwise they cannot click the respawn button)
if (
!alive player
&& {playerRespawnTime != -1}
&& {
missionNamespace getVariable ["BIS_RscRespawnControlsMap_shown", false]
|| {missionNamespace getVariable ["BIS_RscRespawnControlsSpectate_shown", false]}
}
) exitWith {
[false] call FUNC(disableUserInput);
};
}, 0, []] call CBA_fnc_addPerFrameHandler; }, 0, []] call CBA_fnc_addPerFrameHandler;
} else { } else {
if (!isNil QGVAR(disableInputPFH)) then { if (!isNil QGVAR(disableInputPFH)) then {