fixed line-endings on *.cs
This commit is contained in:
@@ -21,45 +21,45 @@
|
||||
using System.Drawing;
|
||||
using OpenRA.Graphics;
|
||||
|
||||
namespace OpenRA.Widgets
|
||||
{
|
||||
class ButtonWidget : Widget
|
||||
{
|
||||
public string Text = "";
|
||||
public bool Depressed = false;
|
||||
public int VisualHeight = 1;
|
||||
public override bool HandleInput(MouseInput mi)
|
||||
{
|
||||
if (Game.chrome.selectedWidget == this)
|
||||
Depressed = (GetEventBounds().Contains(mi.Location.X,mi.Location.Y)) ? true : false;
|
||||
|
||||
// Relinquish focus
|
||||
if (Game.chrome.selectedWidget == this && mi.Event == MouseInputEvent.Up)
|
||||
{
|
||||
Game.chrome.selectedWidget = null;
|
||||
Depressed = false;
|
||||
}
|
||||
|
||||
// Are we able to handle this event?
|
||||
if (!Visible || !GetEventBounds().Contains(mi.Location.X,mi.Location.Y))
|
||||
return base.HandleInput(mi);
|
||||
|
||||
|
||||
if (base.HandleInput(mi))
|
||||
return true;
|
||||
|
||||
// Give button focus only while the mouse is down
|
||||
// This is a bit of a hack: it will become cleaner soonish
|
||||
// It will also steal events from any potential children
|
||||
// We also want to play a click sound
|
||||
if (mi.Event == MouseInputEvent.Down)
|
||||
{
|
||||
Game.chrome.selectedWidget = this;
|
||||
Depressed = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
namespace OpenRA.Widgets
|
||||
{
|
||||
class ButtonWidget : Widget
|
||||
{
|
||||
public string Text = "";
|
||||
public bool Depressed = false;
|
||||
public int VisualHeight = 1;
|
||||
public override bool HandleInput(MouseInput mi)
|
||||
{
|
||||
if (Game.chrome.selectedWidget == this)
|
||||
Depressed = (GetEventBounds().Contains(mi.Location.X,mi.Location.Y)) ? true : false;
|
||||
|
||||
// Relinquish focus
|
||||
if (Game.chrome.selectedWidget == this && mi.Event == MouseInputEvent.Up)
|
||||
{
|
||||
Game.chrome.selectedWidget = null;
|
||||
Depressed = false;
|
||||
}
|
||||
|
||||
// Are we able to handle this event?
|
||||
if (!Visible || !GetEventBounds().Contains(mi.Location.X,mi.Location.Y))
|
||||
return base.HandleInput(mi);
|
||||
|
||||
|
||||
if (base.HandleInput(mi))
|
||||
return true;
|
||||
|
||||
// Give button focus only while the mouse is down
|
||||
// This is a bit of a hack: it will become cleaner soonish
|
||||
// It will also steal events from any potential children
|
||||
// We also want to play a click sound
|
||||
if (mi.Event == MouseInputEvent.Down)
|
||||
{
|
||||
Game.chrome.selectedWidget = this;
|
||||
Depressed = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Draw()
|
||||
@@ -78,6 +78,6 @@ namespace OpenRA.Widgets
|
||||
Game.chrome.renderer.BoldFont.Measure(Text).Y / 2) + stateOffset, Color.White));
|
||||
|
||||
base.Draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user