Beispiel #1
0
        // Default settings.
        public Config()
        {
            key_forward = new KeyBinding(
                new DoomKey[]
            {
                DoomKey.Up,
                DoomKey.W
            });
            key_backward = new KeyBinding(
                new DoomKey[]
            {
                DoomKey.Down,
                DoomKey.S
            });
            key_strafeleft = new KeyBinding(
                new DoomKey[]
            {
                DoomKey.A
            });
            key_straferight = new KeyBinding(
                new DoomKey[]
            {
                DoomKey.D
            });
            key_turnleft = new KeyBinding(
                new DoomKey[]
            {
                DoomKey.Left
            });
            key_turnright = new KeyBinding(
                new DoomKey[]
            {
                DoomKey.Right
            });
            key_fire = new KeyBinding(
                new DoomKey[]
            {
                DoomKey.LControl,
                DoomKey.RControl
            },
                new DoomMouseButton[]
            {
                DoomMouseButton.Mouse1
            });
            key_use = new KeyBinding(
                new DoomKey[]
            {
                DoomKey.Space
            },
                new DoomMouseButton[]
            {
                DoomMouseButton.Mouse2
            });
            key_run = new KeyBinding(
                new DoomKey[]
            {
                DoomKey.LShift,
                DoomKey.RShift
            });
            key_strafe = new KeyBinding(
                new DoomKey[]
            {
                DoomKey.LAlt,
                DoomKey.RAlt
            });

            mouse_sensitivity  = 8;
            mouse_disableyaxis = false;

            game_alwaysrun = true;

            var vm = ConfigUtilities.GetDefaultVideoMode();

            video_screenwidth     = (int)vm.Width;
            video_screenheight    = (int)vm.Height;
            video_fullscreen      = false;
            video_highresolution  = true;
            video_gamescreensize  = 7;
            video_displaymessage  = true;
            video_gammacorrection = 2;

            audio_soundvolume = 8;
            audio_musicvolume = 8;
            audio_randompitch = true;
            audio_soundfont   = "TimGM6mb.sf2";
        }
Beispiel #2
0
        public CommandLineArgs(string[] args)
        {
            iwad = GetString(args, "-iwad");
            file = Check_file(args);
            deh  = Check_deh(args);

            warp    = Check_warp(args);
            episode = GetInt(args, "-episode");
            skill   = GetInt(args, "-skill");

            deathmatch = new Arg(args.Contains("-deathmatch"));
            altdeath   = new Arg(args.Contains("-altdeath"));
            fast       = new Arg(args.Contains("-fast"));
            respawn    = new Arg(args.Contains("-respawn"));
            nomonsters = new Arg(args.Contains("-nomonsters"));

            playdemo = GetString(args, "-playdemo");
            timedemo = GetString(args, "-timedemo");

            loadgame = GetInt(args, "-loadgame");

            nomouse = new Arg(args.Contains("-nomouse"));
            nosound = new Arg(args.Contains("-nosound"));
            nosfx   = new Arg(args.Contains("-nosfx"));
            nomusic = new Arg(args.Contains("-nomusic"));

            nodeh = new Arg(args.Contains("-nodeh"));

            // Check for drag & drop.
            if (args.Length > 0 && args.All(arg => arg.FirstOrDefault() != '-'))
            {
                string iwadPath  = null;
                var    pwadPaths = new List <string>();
                var    dehPaths  = new List <string>();

                foreach (var path in args)
                {
                    var extension = Path.GetExtension(path).ToLower();

                    if (extension == ".wad")
                    {
                        if (ConfigUtilities.IsIwad(path))
                        {
                            iwadPath = path;
                        }
                        else
                        {
                            pwadPaths.Add(path);
                        }
                    }
                    else if (extension == ".deh")
                    {
                        dehPaths.Add(path);
                    }
                }

                if (iwadPath != null)
                {
                    iwad = new Arg <string>(iwadPath);
                }

                if (pwadPaths.Count > 0)
                {
                    file = new Arg <string[]>(pwadPaths.ToArray());
                }

                if (dehPaths.Count > 0)
                {
                    deh = new Arg <string[]>(dehPaths.ToArray());
                }
            }
        }