Restore highlighting of units on hover.
Optimise overlay code a bit. This was SVN commit r8253.
This commit is contained in:
parent
a47227daaa
commit
aa32677784
@ -471,20 +471,12 @@ function handleInputAfterGui(ev)
|
||||
switch (ev.type)
|
||||
{
|
||||
case "mousemotion":
|
||||
// Highlight the first hovered entities, if it's not a unit
|
||||
// Highlight the first hovered entity (if any)
|
||||
var ents = Engine.PickEntitiesAtPoint(ev.x, ev.y);
|
||||
if (ents.length == 0)
|
||||
{
|
||||
g_Selection.setHighlightList([]);
|
||||
}
|
||||
if (ents.length)
|
||||
g_Selection.setHighlightList([ents[0]]);
|
||||
else
|
||||
{
|
||||
var entState = GetEntityState(ents[0]);
|
||||
if (entState && !isUnit(entState))
|
||||
g_Selection.setHighlightList([ents[0]]);
|
||||
else
|
||||
g_Selection.setHighlightList([]);
|
||||
}
|
||||
g_Selection.setHighlightList([]);
|
||||
|
||||
return false;
|
||||
|
||||
|
@ -115,6 +115,13 @@ public:
|
||||
|
||||
void Interpolate(float UNUSED(frameTime), float frameOffset)
|
||||
{
|
||||
// Skip all the following computations if we have no sprites
|
||||
if (m_Sprites.empty())
|
||||
{
|
||||
m_Enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable rendering of the unit if it has no position
|
||||
CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), GetEntityId());
|
||||
if (cmpPosition.null() || !cmpPosition->IsInWorld())
|
||||
|
Loading…
Reference in New Issue
Block a user