Replace broken (Disabled)TabClick and with (Disabled)ClickSound.

This commit is contained in:
Paul Chote
2019-01-22 23:13:55 +00:00
parent 635038aa0b
commit 8d276ff9de
5 changed files with 9 additions and 11 deletions

View File

@@ -47,8 +47,8 @@ namespace OpenRA.Mods.Common.Widgets
public readonly int2 IconMargin = int2.Zero;
public readonly int2 IconSpriteOffset = int2.Zero;
public readonly string TabClick = null;
public readonly string DisabledTabClick = null;
public readonly string ClickSound = ChromeMetrics.Get<string>("ClickSound");
public readonly string ClickDisabledSound = ChromeMetrics.Get<string>("ClickDisabledSound");
public readonly string TooltipContainer;
public readonly string TooltipTemplate = "PRODUCTION_TOOLTIP";
@@ -267,14 +267,14 @@ namespace OpenRA.Mods.Common.Widgets
{
if (PickUpCompletedBuildingIcon(icon, item))
{
Game.Sound.Play(SoundType.UI, TabClick);
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
return true;
}
if (item != null && item.Paused)
{
// Resume a paused item
Game.Sound.Play(SoundType.UI, TabClick);
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
World.IssueOrder(Order.PauseProduction(CurrentQueue.Actor, icon.Name, false));
return true;
}
@@ -284,7 +284,7 @@ namespace OpenRA.Mods.Common.Widgets
if (buildable != null)
{
// Queue a new item
Game.Sound.Play(SoundType.UI, TabClick);
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
string notification;
var canQueue = CurrentQueue.CanQueue(buildable, out notification);
@@ -307,7 +307,7 @@ namespace OpenRA.Mods.Common.Widgets
if (item == null)
return false;
Game.Sound.Play(SoundType.UI, TabClick);
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
if (CurrentQueue.Info.DisallowPaused || item.Paused || item.Done || item.TotalCost == item.RemainingCost)
{
@@ -331,7 +331,7 @@ namespace OpenRA.Mods.Common.Widgets
return false;
// Directly cancel, skipping "on-hold"
Game.Sound.Play(SoundType.UI, TabClick);
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Faction.InternalName);
World.IssueOrder(Order.CancelProduction(CurrentQueue.Actor, icon.Name, handleCount));
@@ -351,7 +351,7 @@ namespace OpenRA.Mods.Common.Widgets
: false;
if (!handled)
Game.Sound.Play(SoundType.UI, DisabledTabClick);
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickDisabledSound, null);
return true;
}