Example #1
0
        static public void SaveConfiguration(FormConfiguration conf)
        {
            File.Delete(EntryPoint.configName);

            var formatter = new XmlSerializer(typeof(FormConfiguration));

            using (var fs = new FileStream(EntryPoint.configName, FileMode.Create))
            {
                formatter.Serialize(fs, conf);
            }
        }
        public DownloadWindow(FormConfiguration conf)
        {
            InitializeComponent();

            configuration = conf;

            if (conf.Lang == DeLauncherForm.Language.Rus)
            {
                Info.Source = new BitmapImage(new Uri("/Windows/Resources/info_rus.png", UriKind.Relative));
            }
        }
        public AbortWindow(FormConfiguration conf)
        {
            InitializeComponent();
            Ok.Click += CloseWindow;

            if (conf.Lang == DeLauncherForm.Language.Rus)
            {
                ErrorMessage1.Text = "Другой процесс DeLauncher уже(или ещё) активен!";
                ErrorMessage2.Text = "Пожалуйста, подождите и перезапустите DeLauncher";
            }
        }
Example #4
0
        static private void CreateNewConfiguration()
        {
            var conf = new FormConfiguration
            {
                Patch = new Vanilla(),
                Lang  = Language.Eng
            };

            var formatter = new XmlSerializer(typeof(FormConfiguration));

            using (var fs = new FileStream(EntryPoint.configName, FileMode.Create))
            {
                formatter.Serialize(fs, conf);
            }
        }
Example #5
0
        public static void SetGameFiles(FormConfiguration conf)
        {
            RenameROTRFiles();

            foreach (var exceptionFile in conf.Patch.ExceptionFiles)
            {
                if (File.Exists(exceptionFile + ".big"))
                {
                    File.Move(exceptionFile + ".big", exceptionFile + ".gib");
                }
            }

            RenameScriptFiles();
            RenameWindowFiles();
        }
Example #6
0
        private static int StartExe(FormConfiguration conf, LaunchOptions options, bool worldBuilderLaunch)
        {
            Process process;

            if (worldBuilderLaunch)
            {
                process = Process.Start(EntryPoint.WorldBuilderFile);
                return(process.Id);
            }

            var parameters = "";

            if (conf.Windowed)
            {
                parameters += "-win ";
            }
            if (conf.QuickStart)
            {
                parameters += "-quickstart ";
            }
            if (conf.particleEdit)
            {
                parameters += "-particleEdit ";
            }
            if (conf.scriptDebug)
            {
                parameters += "-scriptDebug";
            }


            if (!options.ModdedExe)
            {
                process = Process.Start(EntryPoint.GameFile, parameters);
            }
            else
            {
                process = Process.Start(EntryPoint.ModdedGameFile, parameters);
            }


            return(process.Id);
        }
Example #7
0
 public static async Task PrepareWithUpdate(FormConfiguration conf)
 {
     await ReposWorker.LoadActualPatch(conf.Patch);
 }