more infantry tweaks; sidebar mouseover shows desc & prices now

This commit is contained in:
Chris Forbes
2009-11-01 15:06:21 +13:00
parent db810105da
commit 4ada055f06
6 changed files with 48 additions and 12 deletions

View File

@@ -20,6 +20,8 @@ namespace OpenRa.Game.Graphics
Action drawFunction;
Action<MouseInput> mouseHandler;
Rectangle rect;
public bool UseScissor = true;
public bool AlwaysWantMovement = false;
static int2 MakeSize(Viewport v, DockStyle d, int size)
{
@@ -40,7 +42,6 @@ namespace OpenRa.Game.Graphics
public bool HandleMouseInput(MouseInput mi)
{
/* todo: route to the mousehandler once that's sorted */
if (mouseHandler != null) mouseHandler(new MouseInput
{
Button = mi.Button,
@@ -83,9 +84,11 @@ namespace OpenRa.Game.Graphics
public void Draw(Renderer renderer)
{
renderer.Device.EnableScissor((int)location.X, (int)location.Y, (int)Size.X, (int)Size.Y);
if (UseScissor)
renderer.Device.EnableScissor((int)location.X, (int)location.Y, (int)Size.X, (int)Size.Y);
drawFunction();
renderer.Device.DisableScissor();
if (UseScissor)
renderer.Device.DisableScissor();
}
}
}