Exemplo n.º 1
0
        private void LoadConfig()
        {
            string filename = Path.Combine(DataDir, ConfigFile);
            if (File.Exists(filename))
            {
                // Load the data
                configdata = JsonConvert.DeserializeObject<ConfigData>(File.ReadAllText(filename));

                // Fix window position for legacy configs
                if (!(configdata.windowx > -32000 && configdata.windowy > -32000))
                {
                    configdata.ResetWindow();
                }

                // Set window position
                arenawindow.Left = configdata.windowx;
                arenawindow.Top = configdata.windowy;

                // Set options
                arenawindow.CheckBoxOverlay.IsChecked = configdata.overlay;
                arenawindow.CheckBoxManual.IsChecked = configdata.manualclicks;
                arenawindow.CheckBoxAutoSave.IsChecked = configdata.autosave;
                arenawindow.CheckBoxDebug.IsChecked = configdata.debug;
            }

            configinit = true;
        }