refactoring Widget

This commit is contained in:
Bob
2010-05-25 11:44:57 +12:00
parent ac10ca3fad
commit 8285c7d158
16 changed files with 30 additions and 76 deletions

View File

@@ -52,14 +52,8 @@ namespace OpenRA.Widgets
GetText = (other as LabelWidget).GetText;
}
public override void Draw(World world)
public override void DrawInner(World world)
{
if (!IsVisible())
{
base.Draw(world);
return;
}
var font = (Bold) ? Game.chrome.renderer.BoldFont : Game.chrome.renderer.RegularFont;
var text = GetText();
int2 textSize = font.Measure(text);
@@ -69,7 +63,6 @@ namespace OpenRA.Widgets
position += new int2((Bounds.Width - textSize.X)/2, 0);
font.DrawText(text, position, Color.White);
base.Draw(world);
}
public override Widget Clone()