public void setSoundName(Sound.SoundsEnum sound) { this.settings[Config.keyActionSoundName] = sound; //this.actionSoundFile = sound; // Enable if have something to play setMustPlaySound(sound != Sound.SoundsEnum.None); }
///// <summary> ///// Are we in the game lobby and not on some other game screen? ///// Also not in the SWF lobby. ///// </summary> //private static bool isGameLobbyShown() //{ // bool hasShop = ScreenParser.hasShopIcon(); // bool hasReady = ScreenParser.hasReadyButton(); // bool hasUnready = ScreenParser.hasUnreadyButton(); // // Make sure we are really in game lobby // return !hasShop && !ScreenParser.hasSurvivorLookingForMatchText() && // (hasReady || hasUnready); //} public static void playSound(Sound.SoundsEnum sound, bool bLooped = false) { // All sound muted? - don't play if (Form1.getInstance().isSoundMuted()) { return; } Sound.playSound(sound, bLooped); }
public static void playSound(Sound.SoundsEnum sound, bool bLooped = false) { // All sound muted? - don't play if (Form1.getInstance().isSoundMuted()) { return; } switch (sound) { case Sound.SoundsEnum.Shutter: Player = new SoundPlayer(soundPath + "stored.wav"); if (bLooped) { Player.PlayLooping(); } else { Player.Play(); } break; case Sound.SoundsEnum.Notify1: Player = new SoundPlayer(soundPath + "notify1.wav"); if (bLooped) { Player.PlayLooping(); } else { Player.Play(); } //System.Media.SystemSounds.Exclamation.Play(); break; case Sound.SoundsEnum.Notify2: Player = new SoundPlayer(soundPath + "notify2.wav"); if (bLooped) { Player.PlayLooping(); } else { Player.Play(); } break; case Sound.SoundsEnum.Tada: Player = new SoundPlayer(soundPath + "tada.wav"); if (bLooped) { Player.PlayLooping(); } else { Player.Play(); } break; case Sound.SoundsEnum.Horn: Player = new SoundPlayer(soundPath + "horn.wav"); if (bLooped) { Player.PlayLooping(); } else { Player.Play(); } break; case Sound.SoundsEnum.Check: Player = new SoundPlayer(soundPath + "check.wav"); if (bLooped) { Player.PlayLooping(); } else { Player.Play(); } break; case Sound.SoundsEnum.Starting: Player = new SoundPlayer(soundPath + "Starting.wav"); if (bLooped) { Player.PlayLooping(); } else { Player.Play(); } break; default: break; } }