Пример #1
0
        public void Compile()
        {
            string _args     = CompilerUtils._compileArgs;
            string arguments = string.Format("-game \"{0}\" \"{1}\"", ProjectUtils.GetGameInfoPath(), _path);

            if (!string.IsNullOrEmpty(_args))
            {
                arguments = string.Format("-game \"{0}\" {1} \"{2}\"", ProjectUtils.GetGameInfoPath(), _args, _path);
            }

            Process procLaunchStudioMdl = new Process();

            procLaunchStudioMdl.StartInfo.Arguments              = arguments;
            procLaunchStudioMdl.StartInfo.CreateNoWindow         = true;
            procLaunchStudioMdl.StartInfo.FileName               = CompilerUtils.GetStudioMdlPath();
            procLaunchStudioMdl.StartInfo.UseShellExecute        = false;
            procLaunchStudioMdl.StartInfo.WindowStyle            = ProcessWindowStyle.Hidden;
            procLaunchStudioMdl.StartInfo.RedirectStandardOutput = true;
            procLaunchStudioMdl.Start();

            while (!procLaunchStudioMdl.StandardOutput.EndOfStream && CompilerUtils.IsCompiling())
            {
                string line = procLaunchStudioMdl.StandardOutput.ReadLine();

                Globals.compileLog.Invoke(new Action(() => Globals.compileLog.Text += (line + Environment.NewLine)));
                _log += (line + Environment.NewLine);
            }

            LoggingUtils.CreateCompileLog(_mdlName, _log, _directoryStructure);
            CompilerUtils.ProcessQCFile();
        }
Пример #2
0
        public static void CloseProject()
        {
            if (!IsProjectLoaded())
            {
                return;
            }

            // We want to close our project, what do we do?:
            // Close all windows associated to the project,
            // Auto Save the current stuff,
            // Cancel any in-action process such as compiling.
            if (CompilerUtils.IsCompiling())
            {
                CompilerUtils.StopCompile();
            }

            SaveProject();
            WindowHandler.CloseAllWindows();

            _projectFilters.Dispose();
            _projectFilters = null;
            SharedEvents.ClosedProject();
            _pszActiveProjectPath   = null;
            Globals.compileLog.Text = null;
        }
Пример #3
0
        public void BuildFilter(Filter sub)
        {
            for (int i = 0; i < sub.GetFiles().Count(); i++)
                CompilerUtils.AddToQueue(sub.GetFiles()[i].GetPath());

            for (int i = 0; i < sub.GetSubFilters().Count(); i++)
                BuildFilter(sub.GetSubFilters()[i]);
        }