예제 #1
0
 private void NewSong_MenuItem_Click(object sender, EventArgs e)
 {
     SongData songData = new SongData(this.gh3Songlist_0, this.forceRB3MidConversionToolStripMenuItem.Checked);
     if (songData.ShowDialog() == DialogResult.OK)
     {
         GH3Song gH3Song = this.bool_0 ? new GHASong() : new GH3Song();
         if (songData.bool_1)
         {
             Class250 @class = songData.method_1(this.class319_0, this.dataFolder);
             this.method_4(@class);
             gH3Song.vmethod_0(@class.class362_0.gh3Song_0);
         }
         if (songData.bool_0)
         {
             Class248 class2 = songData.method_0(this.dataFolder);
             this.method_4(class2);
             gH3Song.name = class2.string_1;
             gH3Song.no_rhythm_track = !class2.bool_0;
             gH3Song.use_coop_notetracks = class2.bool_1;
             gH3Song.version = 3;
             gH3Song.leaderboard = true;
             gH3Song.editable = true;
         }
         SongProperties songProperties = new SongProperties(gH3Song);
         if (songProperties.ShowDialog() == DialogResult.OK)
         {
             songProperties.GetSongWithChanges();
         }
         this.gh3Songlist_0.Add(gH3Song.name, gH3Song);
         this.method_4(new Class247(this.class319_0, this.gh3Songlist_0));
         this.method_0();
     }
 }
예제 #2
0
 private void RebuildSong_MenuItem_Click(object sender, EventArgs e)
 {
     GH3Song song = (GH3Song)this.SongListBox.Items[this.SongListBox.SelectedIndex];
     SongData songData;
     if (!song.isEditable())
     {
         if (MsgBoxEditDefaultSongs() != DialogResult.Yes)
             return;
     }
     if (this.SongListBox.SelectedIndex >= 0 && (songData = new SongData(song.name, false, false)).ShowDialog() == DialogResult.OK)
     {
         if (songData.bool_1)
         {
             Class250 @class = songData.method_1(this.class319_0, this.dataFolder);
             this.method_4(@class);
             if (DialogResult.Yes == MessageBox.Show("Do you wish to get the song properties from the game track? (Current properties will be overwritten | Mid files have no properties!)", "Tier Exporting", MessageBoxButtons.YesNo))
             {
                 bool no_rhythm_track = song.no_rhythm_track;
                 bool use_coop_notetracks = song.use_coop_notetracks;
                 song.vmethod_0(@class.class362_0.gh3Song_0);
                 song.no_rhythm_track = no_rhythm_track;
                 song.use_coop_notetracks = use_coop_notetracks;
                 this.method_4(new Class247(this.class319_0, this.gh3Songlist_0));
             }
         }
         if (songData.bool_0)
         {
             Class248 class2 = songData.method_0(this.dataFolder);
             this.method_4(class2);
             song.no_rhythm_track = !class2.bool_0;
             song.use_coop_notetracks = class2.bool_1;
             this.method_4(new Class247(this.class319_0, this.gh3Songlist_0));
         }
     }
 }
예제 #3
0
 private void MassImporter_MenuItem_Click(object sender, EventArgs e)
 {
     FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
     folderBrowserDialog.ShowNewFolderButton = false;
     folderBrowserDialog.Description = "Please select a folder that contains the folder structure for mass song importing.";
     folderBrowserDialog.RootFolder = Environment.SpecialFolder.DesktopDirectory;
     if (folderBrowserDialog.ShowDialog() != DialogResult.OK)
     {
         return;
     }
     string[] directories = Directory.GetDirectories(folderBrowserDialog.SelectedPath, "*", SearchOption.TopDirectoryOnly);
     List<string> list = new List<string>(directories);
     string[] array = directories;
     for (int i = 0; i < array.Length; i++)
     {
         string file = array[i];
         try
         {
             List<string> list2 = KeyGenerator.checkFile(file, "*.mid;*.chart;*.qbc;*.dbc", true);
             List<string> list3 = KeyGenerator.checkFile(file, "*.wav;*.mp3;*.ogg", true);
             string[] files = Directory.GetFiles(file, "*.dat", SearchOption.TopDirectoryOnly);
             if (list2.Count != 0 && (list3.Count != 0 || files.Length != 0))
             {
                 GH3Song gH3Song = this.bool_0 ? new GHASong() : new GH3Song();
                 gH3Song.name = KeyGenerator.GetFileName(file).ToLower().Replace(" ", "").Replace('.', '_');
                 if (gH3Song.name.Length > 30)
                 {
                     gH3Song.name = gH3Song.name.Remove(30);
                 }
                 if (QbSongClass1.smethod_4(gH3Song.name) || this.gh3Songlist_0.method_3(gH3Song.name))
                 {
                     int num = 2;
                     while (QbSongClass1.smethod_4(gH3Song.name + num) || this.gh3Songlist_0.method_3(gH3Song.name + num))
                     {
                         num++;
                     }
                     GH3Song expr_176 = gH3Song;
                     expr_176.name += num;
                 }
                 QBCParser qbcParser = null;
                 foreach (string current in list2)
                 {
                     try
                     {
                         if (current.EndsWith(".qbc"))
                         {
                             qbcParser = new QBCParser(current);
                         }
                         else if (current.EndsWith(".mid"))
                         {
                             qbcParser = Midi2Chart.getMidiSong(current, this.forceRB3MidConversionToolStripMenuItem.Checked);
                         }
                         else
                         {
                             qbcParser = new ChartParser(current).method_3();
                         }
                         break;
                     }
                     catch
                     {
                     }
                 }
                 if (qbcParser != null)
                 {
                     zzQbSongObject class2 = null;
                     if (files.Length != 0)
                     {
                         string[] array2 = files;
                         for (int j = 0; j < array2.Length; j++)
                         {
                             string text2 = array2[j];
                             try
                             {
                                 if (File.Exists(text2.Replace(".dat.xen", ".fsb.xen")))
                                 {
                                     class2 = new zzQbSongObject(text2);
                                     if ((int)new FileInfo(text2.Replace(".dat.xen", ".fsb.xen")).Length == class2.int_0)
                                     {
                                         break;
                                     }
                                 }
                             }
                             catch
                             {
                             }
                         }
                     }
                     if (class2 != null || list3.Count != 0)
                     {
                         SongData songData = new SongData(gH3Song.name, qbcParser, class2, list3.ToArray());
                         Class250 class3 = songData.method_1(this.class319_0, this.dataFolder);
                         Class248 class4 = songData.method_0(this.dataFolder);
                         gH3Song.vmethod_0(class3.class362_0.gh3Song_0);
                         if (File.Exists(file + "\\song.ini"))
                         {
                             string[] array3 = File.ReadAllLines(file + "\\song.ini");
                             for (int k = 0; k < array3.Length; k++)
                             {
                                 string text3 = array3[k];
                                 if (text3.StartsWith("name"))
                                 {
                                     gH3Song.title = text3.Remove(0, text3.IndexOf('=') + 1).Trim();
                                 }
                                 else if (text3.StartsWith("artist"))
                                 {
                                     gH3Song.artist = text3.Remove(0, text3.IndexOf('=') + 1).Trim();
                                 }
                             }
                         }
                         gH3Song.no_rhythm_track = !class4.bool_0;
                         gH3Song.use_coop_notetracks = class4.bool_1;
                         gH3Song.version = 3;
                         gH3Song.leaderboard = true;
                         gH3Song.editable = true;
                         this.method_4(class3);
                         this.method_4(class4);
                         this.gh3Songlist_0.Add(gH3Song.name, gH3Song);
                         list.Remove(file);
                     }
                 }
             }
         }
         catch
         {
         }
     }
     this.method_4(new Class247(this.class319_0, this.gh3Songlist_0));
     this.method_0();
     if (list.Count != 0)
     {
         string text4 = "The follwing songs (by folder name) failed:";
         foreach (string current2 in list)
         {
             text4 = text4 + "\n" + KeyGenerator.GetFileName(current2);
         }
         MessageBox.Show(text4, "Error!");
     }
 }