Exemplo n.º 1
0
        static void InitConsole()
        {
            Engine.GamePath = ConVar.Register("game", "basegame", ConVarType.Replicated | ConVarType.Init);
            //Engine.GamePath = ConVar.Register("game", "legprocessor", ConVarType.Replicated | ConVarType.Init);

            Engine.MaxFPS       = ConVar.Register("maxfps", 60, ConVarType.Archive);
            Engine.WindowWidth  = ConVar.Register("width", 1366, ConVarType.Archive);
            Engine.WindowHeight = ConVar.Register("height", 768, ConVarType.Archive);

            //Engine.WindowWidth = CVar.Register("width", 800, CVarType.Archive);
            //Engine.WindowHeight = CVar.Register("height", 600, CVarType.Archive);

            Engine.WindowBorderless = ConVar.Register("borderless", false, ConVarType.Archive);
            Engine.WindowResizable  = ConVar.Register("resizable", false, ConVarType.Archive);
            Engine.ShowFPS          = ConVar.Register("showfps", true, ConVarType.Archive);

            Engine.MSAA = ConVar.Register("msaa", 32, ConVarType.Archive);

            Engine.SourceGameDirs = ConVar.Register("source_game_dirs", "C:/Program Files (x86)/Steam/steamapps/common/GarrysMod", ConVarType.Archive);
            Engine.DebugDraw      = ConVar.Register("debugdraw", true, ConVarType.Cheat);

            // Parse all arguments and set CVars
            foreach (var Arg in ArgumentParser.All)
            {
                switch (Arg.Key)
                {
                case "console":
                    GConsole.Open = true;
                    break;

                case "game":
                    Engine.GamePath.Value = Arg.Value.Last();
                    break;

                default:
                    GConsole.Error("Invalid switch '{0}' with value '{1}'", Arg.Key, Arg.Value);
                    break;
                }
            }

            foreach (var CVar in ConVar.GetAll())
            {
                GConsole.WriteLine(CVar);
            }

            ConCmd.Register("exit", (Argv) => Environment.Exit(0));
            GConsole.RegisterAlias("quit", "exit");
        }
Exemplo n.º 2
0
        static void InitConsole()
        {
            Engine.GamePath = ConVar.Register("game", "basegame", ConVarType.Replicated | ConVarType.Init);
            //Engine.GamePath = ConVar.Register("game", "legprocessor", ConVarType.Replicated | ConVarType.Init);

            Engine.WindowWidth  = ConVar.Register("width", 1366, ConVarType.Archive);
            Engine.WindowHeight = ConVar.Register("height", 768, ConVarType.Archive);

            //Engine.WindowWidth = CVar.Register("width", 800, CVarType.Archive);
            //Engine.WindowHeight = CVar.Register("height", 600, CVarType.Archive);

            Engine.WindowBorderless = ConVar.Register("borderless", false, ConVarType.Archive);
            Engine.WindowResizable  = ConVar.Register("resizable", false, ConVarType.Archive);

            // Parse all arguments and set CVars
            foreach (var Arg in ArgumentParser.All)
            {
                switch (Arg.Key)
                {
                case "console":
                    GConsole.Open = true;
                    break;

                case "game":
                    Engine.GamePath.Value = Arg.Value.Last();
                    break;

                default:
                    GConsole.Error("Invalid switch '{0}' with value '{1}'", Arg.Key, Arg.Value);
                    break;
                }
            }

            foreach (var CVar in ConVar.GetAll())
            {
                GConsole.WriteLine(CVar);
            }

            ConCmd.Register("exit", (Argv) => Environment.Exit(0));
            GConsole.RegisterAlias("quit", "exit");
        }