Exemple #1
0
        /// NEW CUSTOM LEVEL FOLDER
        private void newLevelFolderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogInput customlevel = new DialogInput();

            //show the new level folder dialog box
            if (customlevel.ShowDialog() == DialogResult.OK)
            {
                //if all OK, populate new JObject with data from the form
                CreateCustomLevelFolder(customlevel);
            }
            customlevel.Dispose();
        }
Exemple #2
0
        private void editLevelDetailsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            dynamic _load = new JObject();

            try {
                //atempt to parse JSON of LEVEL DETAILS. This wil lalso take care of the situation if it doesn't exist
                _load = JsonConvert.DeserializeObject(Regex.Replace(File.ReadAllText($@"{workingfolder}\LEVEL DETAILS.txt"), "#.*", ""));
            }
            catch { }
            DialogInput customlevel = new DialogInput();

            //set the form text fields to whatever is in LEVEL DETAILS
            customlevel.txtCustomPath.Text = workingfolder;
            //if the LEVEL DETAILS file is missing, or missing parameters, this fill fill the blanks will empty space
            customlevel.txtCustomName.Text   = _load.ContainsKey("level_name") ? (string)_load["level_name"] : "";
            customlevel.txtCustomDiff.Text   = _load.ContainsKey("difficulty") ? (string)_load["difficulty"] : "";
            customlevel.txtDesc.Text         = _load.ContainsKey("description") ? (string)_load["description"] : "";
            customlevel.txtCustomAuthor.Text = _load.ContainsKey("author") ? (string)_load["author"] : "";
            //set samp pack checks
            customlevel.chkLevel1.Checked     = File.Exists($@"{workingfolder}\samp_level1_320bpm.txt");
            customlevel.chkLevel2.Checked     = File.Exists($@"{workingfolder}\samp_level2_340bpm.txt");
            customlevel.chkLevel3.Checked     = File.Exists($@"{workingfolder}\samp_level3_360bpm.txt");
            customlevel.chkLevel4.Checked     = File.Exists($@"{workingfolder}\samp_level4_380bpm.txt");
            customlevel.chkLevel5.Checked     = File.Exists($@"{workingfolder}\samp_level5_400bpm.txt");
            customlevel.chkLevel6.Checked     = File.Exists($@"{workingfolder}\samp_level6_420bpm.txt");
            customlevel.chkLevel7.Checked     = File.Exists($@"{workingfolder}\samp_level7_440bpm.txt");
            customlevel.chkLevel8.Checked     = File.Exists($@"{workingfolder}\samp_level8_460bpm.txt");
            customlevel.chkLevel9.Checked     = File.Exists($@"{workingfolder}\samp_level9_480bpm.txt");
            customlevel.chkDissonance.Checked = File.Exists($@"{workingfolder}\samp_dissonant.txt");
            customlevel.chkGlobal.Checked     = File.Exists($@"{workingfolder}\samp_globaldrones.txt");
            customlevel.chkRests.Checked      = File.Exists($@"{workingfolder}\samp_rests.txt");
            customlevel.chkMisc.Checked       = File.Exists($@"{workingfolder}\samp_misc.txt");
            //show the new level folder dialog box
            if (customlevel.ShowDialog() == DialogResult.OK)
            {
                //if all OK, populate new JObject with data from the form
                CreateCustomLevelFolder(customlevel);
            }
            customlevel.Dispose();
        }