Skip to content

Medical Gui - Prevent firing on sudden menu close#11344

Open
PabstMirror wants to merge 3 commits into
masterfrom
medMenuFire
Open

Medical Gui - Prevent firing on sudden menu close#11344
PabstMirror wants to merge 3 commits into
masterfrom
medMenuFire

Conversation

@PabstMirror
Copy link
Copy Markdown
Contributor

Gives very brief block of mouse firing when the medical menu closes because of condition
(not on intentional closure from hitting escape)

e.g. treating patient, clicking on action, they move a little bit away, and you click and shoot them ☹️

could make setting if needed

@PabstMirror PabstMirror added this to the 3.21.1 milestone Apr 7, 2026
@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Apr 7, 2026
@Drofseh
Copy link
Copy Markdown
Contributor

Drofseh commented Apr 7, 2026

0.5 seconds seems like a long time to me but if it's only on sudden closures and not all closures then it's probably fine.

@some-evil-kitty
Copy link
Copy Markdown
Contributor

some-evil-kitty commented Apr 7, 2026

Mean visual reaction time of some med students was like 0.25s so 0.5s seems reasonable to account for the Arma old-timers. Could make it a slider setting, 0 to disable and up to 1s?

@DartRuffian
Copy link
Copy Markdown
Contributor

Might be good to extend this to after waking up from uncon as well?

Comment thread addons/common/functions/fnc_temporaryBlockFire.sqf Outdated
PabstMirror and others added 2 commits May 8, 2026 12:03
Co-authored-by: Dart <59131299+DartRuffian@users.noreply.github.com>
[[ELSTRING(medical,DistanceToFar), GVAR(target) call EFUNC(common,getName)], 2] call EFUNC(common,displayTextStructured);
};

[0.5] call EFUNC(common,temporaryBlockFire); // prevent firing from sudden menu closure
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[0.5] call EFUNC(common,temporaryBlockFire); // prevent firing from sudden menu closure
[0.5] call EFUNC(common,temporaryBlockFire); // prevent firing from sudden menu closure

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During testing I found that I was often shooting despite this safeguard. I tried increasing it to 2 seconds just to test and was able to fire immediately upon menu closure, so it looks like it doesn't intercept all mouse events in time.

I think 0.5 seconds is not enough for me at least. You mentioned adding a setting - imo having a slider that would allow players to set the timeout themselves would be the best option, as it could also allow them to disable it.

if (_unit == ACE_player) then {
switch EGVAR(medical,windowOnWakeUp) do {
case 1: { // Focus
[0.5] call EFUNC(common,temporaryBlockFire); // prevent firing from surprise context switch
Copy link
Copy Markdown
Contributor

@johnb432 johnb432 May 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the likelihood of this actually doing something? Players are usually in the unconscious animation and need to unholster their weapon before they can shoot, which is longer than 0.5 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Release Notes: **IMPROVED:**

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants