Page MenuHomeFeedback Tracker

inputAction doesn't work in dialogs (returns 0)
Closed, ResolvedPublic

Description

This doesn't work:

addUserActionEventHandler ["ReloadMagazine", "Activate", { 
createDialog "RscDisplayEmpty";
systemChat str inputAction "ReloadMagazine"; //returns 0, other actions don't work either while dialog is open
}];

If you remove the createDialog line or replace it with findDisplay 46 createDisplay "RscDisplayEmpty" it works:

addUserActionEventHandler ["ReloadMagazine", "Activate", { 
systemChat str inputAction "ReloadMagazine";
}];
addUserActionEventHandler ["ReloadMagazine", "Activate", { 
findDisplay 46 createDisplay "RscDisplayEmpty";
systemChat str inputAction "ReloadMagazine"; 
}];

Details

Severity
Minor
Resolution
Not A Bug
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

Leopard20 updated the task description. (Show Details)Mar 10 2022, 10:05 PM
dedmen set Ref Ticket to AIII-55003.Mar 14 2022, 12:04 PM
dedmen changed the task status from New to Assigned.
dedmen closed this task as Resolved.Jul 5 2022, 4:29 PM
dedmen claimed this task.
dedmen added a subscriber: dedmen.

When you open dialog, it grabs input focus away from the game.
But inputAction returns action state inside game.
Which makes sense, as when you press walk or reload inside the dialog, you don't want to actually run or reload or shoot or whatever. The input goes to the dialog, not to the game.

This is as designed, not a bug.

dedmen changed Resolution from Open to Not A Bug.Jul 5 2022, 4:29 PM