コード例 #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);
            }
        }
コード例 #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));
            }
        }
コード例 #3
0
        public AbortWindow(FormConfiguration conf)
        {
            InitializeComponent();
            Ok.Click += CloseWindow;

            if (conf.Lang == DeLauncherForm.Language.Rus)
            {
                ErrorMessage1.Text = "Другой процесс DeLauncher уже(или ещё) активен!";
                ErrorMessage2.Text = "Пожалуйста, подождите и перезапустите DeLauncher";
            }
        }
コード例 #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);
            }
        }
コード例 #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();
        }
コード例 #6
0
ファイル: GameLauncher.cs プロジェクト: p0ls3r/DeLauncherForm
        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);
        }
コード例 #7
0
ファイル: GameLauncher.cs プロジェクト: p0ls3r/DeLauncherForm
 public static async Task PrepareWithUpdate(FormConfiguration conf)
 {
     await ReposWorker.LoadActualPatch(conf.Patch);
 }