Pushed down the MouseInput handling to the OrderGenerators and made a base class for handling the basic logic
This commit is contained in:
@@ -82,6 +82,14 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
var multiClick = mi.MultiTapCount >= 2;
|
||||
|
||||
if (!(World.OrderGenerator is UnitOrderGenerator))
|
||||
{
|
||||
ApplyOrders(World, mi);
|
||||
isDragging = false;
|
||||
YieldMouseFocus(mi);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Down)
|
||||
{
|
||||
if (!TakeMouseFocus(mi))
|
||||
@@ -89,15 +97,6 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
dragStart = mousePos;
|
||||
isDragging = true;
|
||||
|
||||
// Place buildings, use support powers, and other non-unit things
|
||||
if (!(World.OrderGenerator is UnitOrderGenerator))
|
||||
{
|
||||
ApplyOrders(World, mi);
|
||||
isDragging = false;
|
||||
YieldMouseFocus(mi);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Up)
|
||||
|
||||
Reference in New Issue
Block a user