Fix flickering tooltip
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user