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

View File

@@ -82,7 +82,6 @@ Sounds:
SignalFlareNorth: flaren1 SignalFlareNorth: flaren1
SignalFlareSouth: flares1 SignalFlareSouth: flares1
SignalFlareWest: flarew1 SignalFlareWest: flarew1
TabClick: button
Target1: target1 Target1: target1
Target2: target2 Target2: target2
Target3: target3 Target3: target3

View File

@@ -488,6 +488,7 @@ Container@PLAYER_WIDGETS:
MaximumRows: 6 MaximumRows: 6
HotkeyPrefix: Production HotkeyPrefix: Production
HotkeyCount: 24 HotkeyCount: 24
ClickSound: TabClick
Container@PRODUCTION_TYPES: Container@PRODUCTION_TYPES:
X: 6 X: 6
Y: 2 Y: 2

View File

@@ -1,5 +1,4 @@
Sounds: Sounds:
Notifications: Notifications:
TabClick:
ClickSound: ClickSound:
ClickDisabledSound: ClickDisabledSound:

View File

@@ -28,7 +28,6 @@ Sounds:
Scoldsfx: scoldsfx Scoldsfx: scoldsfx
SellSound: cashturn SellSound: cashturn
StubSoundForTriggers: boop StubSoundForTriggers: boop
TabClick:
Text1: text1 Text1: text1
Text2: text2 Text2: text2
Text3: text3 Text3: text3