コード例 #1
0
ファイル: HPPConfig.cs プロジェクト: laetemn/HeroesPowerPlant
        /// <summary>
        /// Loads the current Power Plant Config. Note: Returns a new instance on successful load, throw the old instance away.
        /// </summary>
        public HPPConfig Load(MainForm.MainForm mainForm)
        {
            if (!File.Exists(ConfigPath))
            {
                Save();
                System.Windows.Forms.MessageBox.Show("It appears this is your first time using Heroes Power Plant.\nIf you haven't yet, please check out readme.md as that file has useful info regarding use of the program.\nThere are also tutorials available on YouTube and Sonic Retro.");
                mainForm.AboutBox.Show();
            }

            string fileText = File.ReadAllText(ConfigPath);

            Instance = JsonConvert.DeserializeObject <HPPConfig>(fileText);
            Instance.ApplyConfig(mainForm);

            return(Instance);
        }
コード例 #2
0
        /// <summary>
        /// Loads the current Power Plant Config. Note: Returns a new instance on successful load, throw the old instance away.
        /// </summary>
        public HPPConfig Load(MainForm.MainForm mainForm)
        {
            if (!File.Exists(ConfigPath))
            {
                Save();
                System.Windows.Forms.MessageBox.Show("It appears this is your first time using Heroes Power Plant.\nIf you haven't yet, please check out the Heroes Power Plant wiki on GitHub, as it features a complete guide on using the program and creating custom stages for Sonic Heroes and Shadow the Hedgehog.");
                mainForm.AboutBox.Show();
            }

            string fileText = File.ReadAllText(ConfigPath);

            Instance = JsonConvert.DeserializeObject <HPPConfig>(fileText);
            Instance.ApplyConfig(mainForm);

            return(Instance);
        }