Enables "insufficient power"-speech in RA and C&C when powered-down supportpowerwidget is clicked

This commit is contained in:
Kanar
2014-01-27 04:29:32 +01:00
parent 8685ec64ae
commit 17cf890dce
10 changed files with 22 additions and 6 deletions

View File

@@ -167,7 +167,15 @@ namespace OpenRA.Mods.RA.Widgets
Action<MouseInput> HandleSupportPower(string key, SupportPowerManager manager)
{
return mi => { if (mi.Button == MouseButton.Left) manager.Target(key); };
return mi =>
{
if (mi.Button == MouseButton.Left)
{
if (!manager.Powers[key].Active)
Sound.PlayToPlayer(manager.self.Owner, manager.Powers[key].Info.InsufficientPowerSound);
manager.Target(key);
}
};
}
}
}