3D buttons (still needs a little work)

This commit is contained in:
Paul Chote
2010-03-17 20:37:58 +13:00
parent 79bcb3c739
commit a2b2ad0af5
8 changed files with 69 additions and 36 deletions

View File

@@ -136,6 +136,8 @@ namespace OpenRA
}
public Widget rootWidget;
public Widget selectedWidget;
List<string> visibleTabs = new List<string>();
public void Tick(World world)
@@ -1045,6 +1047,12 @@ namespace OpenRA
int2 lastMousePos;
public bool HandleInput(World world, MouseInput mi)
{
if (selectedWidget != null)
{
selectedWidget.HandleInput(mi);
return true;
}
if (rootWidget.HandleInput(mi))
return true;
@@ -1065,6 +1073,9 @@ namespace OpenRA
public bool HitTest(int2 mousePos)
{
if (selectedWidget != null)
return true;
return rootWidget.GetEventBounds().Contains(mousePos.X, mousePos.Y)
|| buttons.Any(a => a.First.Contains(mousePos.ToPoint()));
}