notifications (formerly EVAalerts) centralized and race specific

outsourced into notifications.yaml
triggered with PlayNotification(...)

(v2: less redundant code for PlayVoice/Notifications)

added harvester under attack and battlecontrol terminated
This commit is contained in:
Matthias Mailänder
2012-06-28 19:52:25 +02:00
committed by Chris Forbes
parent 5fee165692
commit 7a578a0679
40 changed files with 271 additions and 219 deletions

View File

@@ -22,8 +22,6 @@ namespace OpenRA.Widgets
public bool Depressed = false;
public int VisualHeight = ChromeMetrics.Get<int>("ButtonDepth");
public string Font = ChromeMetrics.Get<string>("ButtonFont");
public string ClickSound = null;
public string ClickDisabledSound = null;
public bool Disabled = false;
public Func<string> GetText;
public Func<bool> IsDisabled;
@@ -73,10 +71,10 @@ namespace OpenRA.Widgets
if (!IsDisabled())
{
OnKeyPress(e);
Sound.Play(ClickSound);
Sound.PlayNotification(null, "Sounds", "ClickSound", null);
}
else
Sound.Play(ClickDisabledSound);
Sound.PlayNotification(null, "Sounds", "ClickDisabledSound", null);
return true;
}
@@ -105,12 +103,12 @@ namespace OpenRA.Widgets
{
OnMouseDown(mi);
Depressed = true;
Sound.Play(ClickSound);
Sound.PlayNotification(null, "Sounds", "ClickSound", null);
}
else
{
LoseFocus(mi);
Sound.Play(ClickDisabledSound);
Sound.PlayNotification(null, "Sounds", "ClickDisabledSound", null);
}
}
else if (mi.Event == MouseInputEvent.Move && Focused)