Unstatic the Sound class.
This commit is contained in:
@@ -39,19 +39,19 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
[Desc("Play an announcer voice listed in notifications.yaml")]
|
||||
public void PlaySpeechNotification(Player player, string notification)
|
||||
{
|
||||
Sound.PlayNotification(world.Map.Rules, player, "Speech", notification, player != null ? player.Faction.InternalName : null);
|
||||
Game.Sound.PlayNotification(world.Map.Rules, player, "Speech", notification, player != null ? player.Faction.InternalName : null);
|
||||
}
|
||||
|
||||
[Desc("Play a sound listed in notifications.yaml")]
|
||||
public void PlaySoundNotification(Player player, string notification)
|
||||
{
|
||||
Sound.PlayNotification(world.Map.Rules, player, "Sounds", notification, player != null ? player.Faction.InternalName : null);
|
||||
Game.Sound.PlayNotification(world.Map.Rules, player, "Sounds", notification, player != null ? player.Faction.InternalName : null);
|
||||
}
|
||||
|
||||
[Desc("Play a sound file")]
|
||||
public void PlaySound(string file)
|
||||
{
|
||||
Sound.Play(file);
|
||||
Game.Sound.Play(file);
|
||||
}
|
||||
|
||||
Action onComplete;
|
||||
|
||||
@@ -37,23 +37,23 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
w.SetPauseState(true);
|
||||
|
||||
// Mute world sounds
|
||||
var oldModifier = Sound.SoundVolumeModifier;
|
||||
var oldModifier = Game.Sound.SoundVolumeModifier;
|
||||
|
||||
// TODO: this also modifies vqa audio
|
||||
// Sound.SoundVolumeModifier = 0f;
|
||||
// Game.Sound.SoundVolumeModifier = 0f;
|
||||
|
||||
// Stop music while fmv plays
|
||||
var music = Sound.MusicPlaying;
|
||||
var music = Game.Sound.MusicPlaying;
|
||||
if (music)
|
||||
Sound.PauseMusic();
|
||||
Game.Sound.PauseMusic();
|
||||
|
||||
player.PlayThen(() =>
|
||||
{
|
||||
if (music)
|
||||
Sound.PlayMusic();
|
||||
Game.Sound.PlayMusic();
|
||||
|
||||
Ui.CloseWindow();
|
||||
Sound.SoundVolumeModifier = oldModifier;
|
||||
Game.Sound.SoundVolumeModifier = oldModifier;
|
||||
w.SetPauseState(false);
|
||||
onComplete();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user