Fix flickering tooltip

This commit is contained in:
rob-v
2017-05-27 09:21:10 +02:00
committed by Paul Chote
parent 7772ebedf4
commit 1b3422db2d
4 changed files with 4 additions and 6 deletions

View File

@@ -539,8 +539,6 @@ namespace OpenRA
var integralTickTimestep = (uiTickDelta / Timestep) * Timestep;
Ui.LastTickTime += integralTickTimestep >= TimestepJankThreshold ? integralTickTimestep : Timestep;
Viewport.TicksSinceLastMove += uiTickDelta / Timestep;
Sync.CheckSyncUnchanged(world, Ui.Tick);
Cursor.Tick();
}

View File

@@ -80,7 +80,7 @@ namespace OpenRA.Graphics
}
}
public static long TicksSinceLastMove = 0;
public static long LastMoveRunTime = 0;
public static int2 LastMousePos;
float ClosestTo(float[] collection, float target)

View File

@@ -108,7 +108,7 @@ namespace OpenRA.Widgets
if (mi.Event == MouseInputEvent.Move)
{
Viewport.LastMousePos = mi.Location;
Viewport.TicksSinceLastMove = 0;
Viewport.LastMoveRunTime = Game.RunTime;
}
if (wasMouseOver != MouseOverWidget)

View File

@@ -24,12 +24,12 @@ namespace OpenRA.Mods.Common.Widgets
public int BottomEdgeYOffset = -5;
public Action BeforeRender = Nothing;
public int TooltipDelay = 5;
public int TooltipDelayMilliseconds = 200;
Widget tooltip;
public TooltipContainerWidget()
{
IsVisible = () => Viewport.TicksSinceLastMove >= TooltipDelay;
IsVisible = () => Game.RunTime > Viewport.LastMoveRunTime + TooltipDelayMilliseconds;
}
public void SetTooltip(string id, WidgetArgs args)