Exemplo n.º 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);
            }
        }
Exemplo n.º 2
0
        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));
            }
        }
Exemplo n.º 3
0
        public AbortWindow(FormConfiguration conf)
        {
            InitializeComponent();
            Ok.Click += CloseWindow;

            if (conf.Lang == DeLauncherForm.Language.Rus)
            {
                ErrorMessage1.Text = "Другой процесс DeLauncher уже(или ещё) активен!";
                ErrorMessage2.Text = "Пожалуйста, подождите и перезапустите DeLauncher";
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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();
        }
Exemplo n.º 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);
        }
Exemplo n.º 7
0
 public static async Task PrepareWithUpdate(FormConfiguration conf)
 {
     await ReposWorker.LoadActualPatch(conf.Patch);
 }