You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you drag-select units the engine automatically attempts to filter them. As an example: if you drag select a tank and an engineer you'll select the tank.
Even though this behavior is fine, it doesn't give us control to customize the behavior.
Suggested change
To completely disable the engine behavior and to give Lua a chance to implement its own filtering. Specifically it would be a function that gives you all the units in the drag selection event, and the units it ends up returning would become your selection.
At the moment this is done as a post processing step as part of the OnSelectionChanged function in lua\ui\game\gamemain.lua.
As an example of the new Lua function: OnSelectionDrag(units: UserUnit[]) : UserUnit[]. It would be part of the module lua\ui\game\gamemain.lua.
What we can do with it
This would allow us to properly implement the filtering of the selection. It would also prevent 'accidentally' filtering of a selection when, for example, a UI script calls SelectUnits.
A few examples of what we can do with it are in https://github.com/FAForever/fa/pull/4905/files , which is on hold because it would likely break any UI mod that relies on how the selection works.
The text was updated successfully, but these errors were encountered:
Description
When you drag-select units the engine automatically attempts to filter them. As an example: if you drag select a tank and an engineer you'll select the tank.
Even though this behavior is fine, it doesn't give us control to customize the behavior.
Suggested change
To completely disable the engine behavior and to give Lua a chance to implement its own filtering. Specifically it would be a function that gives you all the units in the drag selection event, and the units it ends up returning would become your selection.
At the moment this is done as a post processing step as part of the
OnSelectionChanged
function inlua\ui\game\gamemain.lua
.As an example of the new Lua function:
OnSelectionDrag(units: UserUnit[]) : UserUnit[]
. It would be part of the modulelua\ui\game\gamemain.lua
.What we can do with it
This would allow us to properly implement the filtering of the selection. It would also prevent 'accidentally' filtering of a selection when, for example, a UI script calls
SelectUnits
.A few examples of what we can do with it are in https://github.com/FAForever/fa/pull/4905/files , which is on hold because it would likely break any UI mod that relies on how the selection works.
The text was updated successfully, but these errors were encountered: