예제 #1
0
        private void Items_editor_Load(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;

            _settings_      = JsonConvert.DeserializeObject <settings.Rootobject>(File.ReadAllText("Settings\\Settings.json"));
            _configuration_ = JsonConvert.DeserializeObject <configuration.Rootobject>(File.ReadAllText("Settings\\Configuration.json"));

            background.BackColor = Color.FromArgb(75, 0, 0, 0);

            if (Directory.Exists("Themes"))
            {
                BackgroundImage = Image.FromFile(_settings_.theme);
            }

            load_survivors().Wait();
            load_killers().Wait();

            Cursor = Cursors.Default;
        }
예제 #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;

            _killers_   = 0;
            _survivors_ = 0;

            if (Directory.Exists("Settings"))
            {
                if (File.Exists("Settings\\Settings.json"))
                {
                    _settings_ = JsonConvert.DeserializeObject <settings.Rootobject>(File.ReadAllText("Settings\\Settings.json"));

                    background.BackColor = Color.FromArgb(200, 0, 0, 0);

                    if (Directory.Exists("Themes"))
                    {
                        string[] all_themes = Directory.GetFiles("Themes", "*.*", SearchOption.AllDirectories);

                        for (int i = 0; i < all_themes.Length; i++)
                        {
                            if (all_themes[i].EndsWith(".png") || all_themes[i].EndsWith(".jpg"))
                            {
                                theme.Items.Add(all_themes[i]);
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Directory 'Themes' not found");
                        Application.Exit();
                    }

                    if (Directory.Exists("Sounds"))
                    {
                        string[] sounds = Directory.GetFiles("Sounds", "*.wav", SearchOption.AllDirectories);

                        for (int i = 0; i < sounds.Length; i++)
                        {
                            sound_start.Items.Add(sounds[i]);
                            sound_save.Items.Add(sounds[i]);
                            sound_theme.Items.Add(sounds[i]);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Directory 'Sounds' not found");
                        Application.Exit();
                    }

                    sound.Checked            = _settings_.sound.enabled;
                    sound_start.SelectedItem = _settings_.sound.launch;
                    sound_save.SelectedItem  = _settings_.sound.save;
                    sound_theme.SelectedItem = _settings_.sound.theme;
                    music_background.Checked = _settings_.sound.play_theme;

                    play_sound(_settings_.sound.launch).Wait();
                    if (music_background.Checked == true)
                    {
                        play_sound(_settings_.sound.theme, true).Wait();
                    }

                    if (theme.Items.Contains(_settings_.theme))
                    {
                        BackgroundImage = Image.FromFile(_settings_.theme);
                    }

                    theme.SelectedItem = _settings_.theme;

                    if (_settings_.update.check == true)
                    {
                        version = downlaoder.DownloadString("https://raw.githubusercontent.com/Neotoxic-off/SaveEditor/main/version.txt");

                        if (version.Contains(current_version.Text) == false)
                        {
                            MessageBox.Show("New Update available !");
                            Process.Start("https://discord.gg/QWSZmNq4YQ");
                            if (_settings_.update.display == true)
                            {
                                changelogs = downlaoder.DownloadString("https://raw.githubusercontent.com/Neotoxic-off/SaveEditor/main/changelog.txt");
                                MessageBox.Show(changelogs, "Changelog by Neo");
                            }
                        }
                    }
                    update.Checked  = _settings_.update.check;
                    display.Checked = _settings_.update.display;

                    load_configuration().Wait();
                    load_characters().Wait();

                    unlock(false).Wait();
                }
                else
                {
                    MessageBox.Show("'Settings\\Settings.json' not found");
                    Application.Exit();
                }
            }
            else
            {
                MessageBox.Show("Directory 'Settings' not found");
                Application.Exit();
            }

            Cursor = Cursors.Default;
        }