some widgets cleanup
This commit is contained in:
@@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -21,7 +20,6 @@ namespace OpenRA.Widgets
|
|||||||
class WorldInteractionControllerWidget : Widget
|
class WorldInteractionControllerWidget : Widget
|
||||||
{
|
{
|
||||||
public WorldInteractionControllerWidget() : base() {}
|
public WorldInteractionControllerWidget() : base() {}
|
||||||
protected WorldInteractionControllerWidget(WorldInteractionControllerWidget widget) : base(widget) {}
|
|
||||||
|
|
||||||
public override void DrawInner( World world )
|
public override void DrawInner( World world )
|
||||||
{
|
{
|
||||||
@@ -173,7 +171,5 @@ namespace OpenRA.Widgets
|
|||||||
.DefaultIfEmpty( new Actor[] {} )
|
.DefaultIfEmpty( new Actor[] {} )
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Widget Clone() { return new WorldInteractionControllerWidget(this); }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,10 +9,9 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using OpenRA.Mods.RA.Activities;
|
using OpenRA.Mods.RA.Activities;
|
||||||
using OpenRA.Traits;
|
|
||||||
using OpenRA.Mods.RA.Orders;
|
using OpenRA.Mods.RA.Orders;
|
||||||
|
using OpenRA.Traits;
|
||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,11 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.FileFormats;
|
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
@@ -21,17 +17,9 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
{
|
{
|
||||||
class MoneyBinWidget : Widget
|
class MoneyBinWidget : Widget
|
||||||
{
|
{
|
||||||
const int chromeButtonGap = 2;
|
|
||||||
public bool SplitOreAndCash = false;
|
public bool SplitOreAndCash = false;
|
||||||
|
|
||||||
/* legacy crap!!! */
|
|
||||||
List<Pair<Rectangle, Action<MouseInput>>> buttons = new List<Pair<Rectangle, Action<MouseInput>>>();
|
|
||||||
void AddButton(Rectangle r, Action<MouseInput> b) { buttons.Add(Pair.New(r, b)); }
|
|
||||||
|
|
||||||
public MoneyBinWidget() : base() { }
|
public MoneyBinWidget() : base() { }
|
||||||
protected MoneyBinWidget(Widget other) : base(other) { }
|
|
||||||
|
|
||||||
public override Widget Clone() { return new MoneyBinWidget(this); }
|
|
||||||
|
|
||||||
public override void DrawInner(World world)
|
public override void DrawInner(World world)
|
||||||
{
|
{
|
||||||
@@ -74,20 +62,5 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInputInner(MouseInput mi)
|
|
||||||
{
|
|
||||||
if (mi.Event == MouseInputEvent.Down)
|
|
||||||
{
|
|
||||||
var action = buttons.Where(a => a.First.Contains(mi.Location.ToPoint()))
|
|
||||||
.Select(a => a.Second).FirstOrDefault();
|
|
||||||
if (action == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
action(mi);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||||
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
|
* available to you under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation. For more information,
|
||||||
|
* see LICENSE.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ using System.Drawing;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Traits;
|
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
namespace OpenRA.Mods.RA.Widgets
|
namespace OpenRA.Mods.RA.Widgets
|
||||||
|
|||||||
Reference in New Issue
Block a user