The render bounds for an actor now include the area covered
by bibs, shadows, and any other widgets. In many cases this
area is much larger than we really want to consider for
tooltips and mouse selection.
An optional Margin is added to Selectable to support cases
like infantry, where we want the mouse area of the actor
to be larger than the drawn selection box.
This avoids the allocations caused by LINQ when using traits.FirstOrDefault(Exts.IsTraitEnabled). This is important in FrozenActorLayer.RefreshState which is called very often. We apply the new helper method to all areas using the old pattern. An overload that takes an array allows arrays to be enumerated without causing allocations.
FogObscures is more expensive than simpler boolean, player or HasTraitInfo checks, so in these places it makes sense to perform the other checks first.
This re-introduces a bug where releasing the RMB button causes an order to be generated for the selected units if the user didn't move their mouse just prior.
This patch adds mouse cursors to the joystick scrolling feature.
On Tiberian Sun, which itself had joystick scrolling, the same cursors are
used as in the original game.
As the older games did not have joystick scrolling, I've had to make a
best-effort guess as to what were suitable cursors.
-> When scrolling in all directions is available, the default arrow
cursor is used.
-> When a direction is blocked, the edge-scrolling blocked direction
cursor is used.
This patch introduces support for the right-click-and-drag scrolling that
is available in Tiberian Sun and Red Alert 2. It can be enabled by
selecting "Joystick" scrolling in the Input settings.
The speed of the scroll is proportional to the product of the distance of
the drag, and the Scroll Speed selected in the Input settings menu.
A side-effect of this is that events previously tied to right clicks on
the world are now based on the release of the click rather than the press.
The "Middle-Mouse Scrolling:" option is renamed
to "Mouse Scrolling Method:"
If a class is caching the TraitsImplementing enumerable, instead cache the results of enumerating it to an array. The avoids having to enumerate the sequence each time it is needed.