really fix modifier keys

This commit is contained in:
Chris Forbes
2010-02-22 21:25:47 +13:00
parent c2ac8ad096
commit 28215387cb
3 changed files with 21 additions and 18 deletions

View File

@@ -29,17 +29,9 @@ namespace OpenRa
{
public class Controller : IHandleInput
{
public IOrderGenerator orderGenerator;
public IOrderGenerator orderGenerator = new UnitOrderGenerator();
public Selection selection = new Selection();
readonly Func<Modifiers> GetModifierKeys;
public Controller(Func<Modifiers> getModifierKeys)
{
GetModifierKeys = getModifierKeys;
CancelInputMode();
}
public void CancelInputMode() { orderGenerator = new UnitOrderGenerator(); }
public bool ToggleInputMode<T>() where T : IOrderGenerator, new()
@@ -123,6 +115,7 @@ namespace OpenRa
}
public float2 MousePosition { get { return dragEnd; } }
Modifiers modifiers;
public string ChooseCursor( World world )
{
@@ -134,7 +127,7 @@ namespace OpenRa
{
Location = ( Game.CellSize * MousePosition - Game.viewport.Location ).ToInt2(),
Button = MouseButton.Right,
Modifiers = GetModifierKeys(),
Modifiers = modifiers
};
return orderGenerator.GetCursor( world, MousePosition.ToInt2(), mi );
@@ -145,5 +138,7 @@ namespace OpenRa
throw new InvalidOperationException( "Desync in Controller.ChooseCursor" );
}
}
public void SetModifiers(Modifiers mods) { modifiers = mods; }
}
}