move LastMousePosition et al from Widget to Viewport

This commit is contained in:
Bob
2010-07-30 20:07:39 +12:00
parent 3cd9a1e0e4
commit 2dd558a065
8 changed files with 31 additions and 29 deletions

View File

@@ -203,8 +203,6 @@ namespace OpenRA.Widgets
public virtual bool HandleInputInner(MouseInput mi) { return !ClickThrough; }
public static int TicksSinceLastMove = 0;
public static int2 LastMousePos;
public static bool HandleInput(World world, MouseInput mi)
{
bool handled = false;
@@ -216,8 +214,8 @@ namespace OpenRA.Widgets
if (mi.Event == MouseInputEvent.Move)
{
LastMousePos = mi.Location;
TicksSinceLastMove = 0;
Viewport.LastMousePos = mi.Location;
Viewport.TicksSinceLastMove = 0;
}
return handled;
}
@@ -344,7 +342,7 @@ namespace OpenRA.Widgets
if (!world.GameHasStarted) return;
if (world.LocalPlayer == null) return;
++TicksSinceLastMove;
++Viewport.TicksSinceLastMove;
}
public static void DoDraw(World world)