This commit is contained in:
Chris Forbes
2010-01-25 22:07:33 +13:00
parent 3ec2b6e19b
commit c3e8a900dc
2 changed files with 18 additions and 3 deletions

View File

@@ -932,10 +932,10 @@ namespace OpenRa
shpRenderer.DrawSprite(ready.Image,
drawPos + new float2((64 - ready.Image.size.X) / 2, 2),
PaletteType.Chrome);
AddButton(rect, HandleSupportPower( sp ));
}
AddButton(rect, HandleSupportPower(sp));
if (rect.Contains(lastMousePos.ToPoint()))
{
tooltipItem = sp;

View File

@@ -102,6 +102,21 @@ namespace OpenRa.Traits
protected virtual void OnFinishCharging() { }
protected virtual void OnActivate() { }
public void Activate() { OnActivate(); } // todo: some more hax
public void Activate()
{
if (!IsAvailable || !IsReady)
{
Sound.Play("briefing.aud");
return;
}
if (Info.RequiresPower && Owner.GetPowerState() != PowerState.Normal)
{
Sound.Play("nopowr1.aud");
return;
}
OnActivate();
}
}
}