Exemple #1
0
 public static CompilePreset Parse(GenericStructure gs)
 {
     return(new CompilePreset
     {
         Name = gs["Name"] ?? "",
         Description = gs["Description"] ?? "",
         Csg = gs["Csg"] ?? "",
         Bsp = gs["Bsp"] ?? "",
         Vis = gs["Vis"] ?? "",
         Rad = gs["Rad"] ?? "",
         RunCsg = gs.PropertyBoolean("RunCsg", true),
         RunBsp = gs.PropertyBoolean("RunBsp", true),
         RunVis = gs.PropertyBoolean("RunVis", true),
         RunRad = gs.PropertyBoolean("RunRad", true)
     });
 }
Exemple #2
0
        public void Read(GenericStructure gs)
        {
            ID                                 = gs.PropertyInteger("ID");
            Name                               = gs["Name"];
            Engine                             = (Engine)Enum.Parse(typeof(Engine), gs["EngineID"]);
            BuildID                            = gs.PropertyInteger("BuildID");
            SteamInstall                       = gs.PropertyBoolean("SteamInstall");
            WonGameDir                         = gs["WonGameDir"];
            SteamGameDir                       = gs["SteamGameDir"];
            ModDir                             = gs["ModDir"];
            UseHDModels                        = gs.PropertyBoolean("UseHDModels", true);
            BaseDir                            = gs["BaseDir"];
            Executable                         = gs["Executable"];
            ExecutableParameters               = gs["ExecutableParameters"];
            MapDir                             = gs["MapDir"];
            Autosave                           = gs.PropertyBoolean("Autosave");
            UseCustomAutosaveDir               = gs.PropertyBoolean("UseCustomAutosaveDir");
            AutosaveDir                        = gs["AutosaveDir"];
            AutosaveTime                       = gs.PropertyInteger("AutosaveTime");
            AutosaveLimit                      = gs.PropertyInteger("AutosaveLimit");
            AutosaveOnlyOnChanged              = gs.PropertyBoolean("AutosaveOnlyOnChanged", true);
            AutosaveTriggerFileSave            = gs.PropertyBoolean("AutosaveTriggerFileChange", true);
            DefaultPointEntity                 = gs["DefaultPointEntity"];
            DefaultBrushEntity                 = gs["DefaultBrushEntity"];
            DefaultTextureScale                = gs.PropertyDecimal("DefaultTextureScale");
            DefaultLightmapScale               = gs.PropertyDecimal("DefaultLightmapScale");
            IncludeFgdDirectoriesInEnvironment = gs.PropertyBoolean("IncludeFgdDirectoriesInEnvironment", true);
            OverrideMapSize                    = gs.PropertyBoolean("OverrideMapSize");
            OverrideMapSizeLow                 = gs.PropertyInteger("OverrideMapSizeLow");
            OverrideMapSizeHigh                = gs.PropertyInteger("OverrideMapSizeHigh");

            var additional = gs.Children.FirstOrDefault(x => x.Name == "AdditionalPackages");

            if (additional != null)
            {
                foreach (var key in additional.GetPropertyKeys())
                {
                    AdditionalPackages.Add(additional[key]);
                }
            }

            PackageBlacklist = (gs["PackageBlacklist"] ?? "").Replace(";", "\r\n");
            PackageWhitelist = (gs["PackageWhitelist"] ?? "").Replace(";", "\r\n");

            var fgds = gs.Children.FirstOrDefault(x => x.Name == "Fgds");

            if (fgds != null)
            {
                foreach (var key in fgds.GetPropertyKeys())
                {
                    Fgds.Add(new Fgd {
                        Path = fgds[key]
                    });
                }
            }
        }
Exemple #3
0
        public static CompileTool Parse(GenericStructure gs)
        {
            var tool = new CompileTool
            {
                Name        = gs["Name"] ?? "",
                Description = gs["Description"] ?? "",
                Order       = gs.PropertyInteger("Order"),
                Enabled     = gs.PropertyBoolean("Enabled", true)
            };
            var parameters = gs.GetChildren("Parameter");

            tool.Parameters.AddRange(parameters.Select(CompileParameter.Parse));
            return(tool);
        }
Exemple #4
0
        public static CompileParameter Parse(GenericStructure gs)
        {
            var param = new CompileParameter
            {
                Name         = gs["Name"] ?? "",
                Flag         = gs["Flag"] ?? "",
                Description  = gs["Description"] ?? "",
                Enabled      = gs.PropertyBoolean("Enabled"),
                Value        = gs["Value"] ?? "",
                Type         = gs.PropertyEnum("Type", CompileParameterType.Checkbox),
                Min          = gs.PropertyDecimal("Min", Decimal.MinValue),
                Max          = gs.PropertyDecimal("Max", Decimal.MaxValue),
                Precision    = gs.PropertyInteger("Precision", 1),
                Options      = (gs["Options"] ?? "").Split(',').ToList(),
                OptionValues = (gs["OptionValues"] ?? "").Split(',').ToList(),
                Filter       = gs["Filter"] ?? ""
            };

            return(param);
        }
Exemple #5
0
        public void Read(GenericStructure gs)
        {
            ID                       = gs.PropertyInteger("ID");
            Name                     = gs["Name"];
            Specification            = gs["Specification"];
            Engine                   = (Engine)Enum.Parse(typeof(Engine), gs["EngineID"]);
            DontRedirectOutput       = gs.PropertyBoolean("DontRedirectOutput");
            Path                     = gs["Path"];
            Bsp                      = gs["Bsp"];
            Csg                      = gs["Csg"];
            Vis                      = gs["Vis"];
            Rad                      = gs["Rad"];
            IncludePathInEnvironment = gs.PropertyBoolean("IncludePathInEnvironment", true);

            WorkingDirectory  = gs.PropertyEnum("WorkingDirectory", CompileWorkingDirectory.TemporaryDirectory);
            AfterCopyBsp      = gs.PropertyBoolean("AfterCopyBsp");
            AfterRunGame      = gs.PropertyBoolean("AfterRunGame");
            AfterAskBeforeRun = gs.PropertyBoolean("AfterAskBeforeRun");

            CopyBsp = gs.PropertyBoolean("CopyBsp");
            CopyRes = gs.PropertyBoolean("CopyRes");
            CopyLin = gs.PropertyBoolean("CopyLin");
            CopyMap = gs.PropertyBoolean("CopyMap");
            CopyPts = gs.PropertyBoolean("CopyPts");
            CopyLog = gs.PropertyBoolean("CopyLog");
            CopyErr = gs.PropertyBoolean("CopyErr");

            foreach (var prof in gs.GetChildren("Profile"))
            {
                var bp = new BuildProfile();
                bp.Read(prof);
                Profiles.Add(bp);
            }
        }