示例#1
0
文件: S.cs 项目: optimus-code/Q2Sharp
 public static void StartSound(Single[] origin, Int32 entnum, Int32 entchannel, sfx_t sfx, Single fvol, Single attenuation, Single timeofs)
 {
     impl.StartSound(origin, entnum, entchannel, sfx, fvol, attenuation, timeofs);
 }
示例#2
0
        private bool CheckFunctionKey(DoomKey key)
        {
            switch (key)
            {
            case DoomKey.F1:
                menu.ShowHelpScreen();
                return(true);

            case DoomKey.F2:
                menu.ShowSaveScreen();
                return(true);

            case DoomKey.F3:
                menu.ShowLoadScreen();
                return(true);

            case DoomKey.F4:
                menu.ShowVolumeControl();
                return(true);

            case DoomKey.F6:
                menu.QuickSave();
                return(true);

            case DoomKey.F7:
                if (currentState == DoomState.Game)
                {
                    menu.EndGame();
                }
                else
                {
                    options.Sound.StartSound(Sfx.OOF);
                }
                return(true);

            case DoomKey.F8:
                video.DisplayMessage = !video.DisplayMessage;
                if (currentState == DoomState.Game && game.State == GameState.Level)
                {
                    string msg;
                    if (video.DisplayMessage)
                    {
                        msg = DoomInfo.Strings.MSGON;
                    }
                    else
                    {
                        msg = DoomInfo.Strings.MSGOFF;
                    }
                    game.World.ConsolePlayer.SendMessage(msg);
                }
                menu.StartSound(Sfx.SWTCHN);
                return(true);

            case DoomKey.F9:
                menu.QuickLoad();
                return(true);

            case DoomKey.F10:
                menu.Quit();
                return(true);

            case DoomKey.F11:
                var gcl = video.GammaCorrectionLevel;
                gcl++;
                if (gcl > video.MaxGammaCorrectionLevel)
                {
                    gcl = 0;
                }
                video.GammaCorrectionLevel = gcl;
                if (currentState == DoomState.Game && game.State == GameState.Level)
                {
                    string msg;
                    if (gcl == 0)
                    {
                        msg = DoomInfo.Strings.GAMMALVL0;
                    }
                    else
                    {
                        msg = "Gamma correction level " + gcl;
                    }
                    game.World.ConsolePlayer.SendMessage(msg);
                }
                return(true);

            case DoomKey.Add:
            case DoomKey.Quote:
            case DoomKey.Equal:
                if (currentState == DoomState.Game &&
                    game.State == GameState.Level &&
                    game.World.AutoMap.Visible)
                {
                    return(false);
                }
                else
                {
                    video.WindowSize = Math.Min(video.WindowSize + 1, video.MaxWindowSize);
                    sound.StartSound(Sfx.STNMOV);
                    return(true);
                }

            case DoomKey.Subtract:
            case DoomKey.Hyphen:
            case DoomKey.Semicolon:
                if (currentState == DoomState.Game &&
                    game.State == GameState.Level &&
                    game.World.AutoMap.Visible)
                {
                    return(false);
                }
                else
                {
                    video.WindowSize = Math.Max(video.WindowSize - 1, 0);
                    sound.StartSound(Sfx.STNMOV);
                    return(true);
                }

            default:
                return(false);
            }
        }