Esempio n. 1
0
        ///// <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);
        }
Esempio n. 2
0
        public static void onAddCurGameToResults()
        {
            // Sound disabled?
            if (!Config.getConfigValueAsBool(Config.keyGeneralPlaySoundOnSavingCurGameStats))
            {
                return;
            }

            Actions.playSound(Sound.SoundsEnum.Shutter);

            // Recalc stats
            Form1.getInstance().recalcStats();
        }
Esempio n. 3
0
        /// <summary>
        /// Add results of the current game
        /// </summary>
        public static void addCurGameResult(GameResult curGameResult)
        {
            Dbg.assert(curGameResult != null);

            // Exit if we are not allowed to add new results
            if (!Form1.getInstance().isAddNewGameResultsEnabled())
            {
                return;
            }

            // Set date of this game to today
            curGameResult.setDate(DateTime.Now);

            lastGameResult = curGameResult;

            Log.log("Cur game stats stored: " + curGameResult.ToString());

            addGameToStats(curGameResult);

            Actions.onAddCurGameToResults();
        }
Esempio n. 4
0
        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;
            }
        }