Example #1
0
        public void Launch(object sender, RoutedEventArgs e)
        {
            if (!ValidateOverviewer(OverviewerPath))
            {
                console.AppendError("overviewer.exe not found");
                return;
            }

            RenderProfile prof = GenerateProfile();

            if (prof == null)
            {
                return;
            }

            string code = "";

            try {
                code = launcher.Launch(prof);
                if (!code.Equals(ErrorCode.CORRECT))
                {
                    console.AppendError(code);
                }
                else
                {
                    ToggleLaunchStop(true);
                }
            } catch (Exception ex) {
                Stop(null, null);
            }
        }
Example #2
0
        public void LoadConfig()
        {
            string filePath = Utils.BrowseFile("config.json");

            if (filePath != null)
            {
                string        json  = File.ReadAllText(filePath);
                RenderProfile saved = JsonConvert.DeserializeObject <RenderProfile>(json);
                OutputPath   = saved.OutPath;
                MinecraftJar = saved.JarPath;
                ThreadCount  = saved.ThreadCount;
                // TODO continue
            }
        }
Example #3
0
        public void SaveConfig()
        {
            RenderProfile prof = GenerateProfile();

            if (prof == null)
            {
                return;
            }
            string filePath = Utils.SaveFile("config.json");

            if (filePath != null)
            {
                string json = JsonConvert.SerializeObject(prof);
                File.WriteAllText(filePath, json);
            }
        }
Example #4
0
        public string Launch(RenderProfile prof)
        {
            this.profile = prof;
            this.ovPath  = UserSettings.OverviewerPath;

            main.console.AppendMsg("Launching... this may take a while, especially if you have many big worlds");

            watch = new Stopwatch();
            watch.Start();
            running = true;

            Directory.CreateDirectory(prof.OutPath);

            ovThread = new Thread(new ThreadStart(Run));
            ovThread.Start();
            main.console.Append("Starting overviewer thread", ColorCode.MSG);
            return(ErrorCode.CORRECT);
        }