private void GameSettingsSwitch_MenuItem_Click(object sender, EventArgs e) { if (DialogResult.Yes != MessageBox.Show("Do you wish to switch Game Settings to a different language? Current Game Settings will be overwritten and you will start from a backup!", "Game Settings Switch", MessageBoxButtons.YesNo)) { return; } LoadGameSettings loadGameSettings = new LoadGameSettings(new string[] { "English", "French", "Italian", "Spanish", "German", "Korean" }); if (loadGameSettings.ShowDialog() != DialogResult.OK) { return; } int num = loadGameSettings.method_3(); string text = KeyGenerator.GetFileNameNoExt(this.class319_0.string_0); if (!this.method_16(num) && DialogResult.Yes == MessageBox.Show("A proper backup doesn't exist. Do you wish to start backup creation? (Overwriting!)", "Loading Game Settings", MessageBoxButtons.YesNo) && !this.method_17(num)) { return; } new List<string>(this.list_0).IndexOf(text.Replace("qb", "")); this.method_15(); using (zzPabNode @class = new zzPabNode(string.Concat(new string[] { this.string_0, this.string_3, "originals\\qb", this.list_0[num], ".pak.xen" }), string.Concat(new string[] { this.string_0, this.string_3, "originals\\qb", this.list_0[num], ".pab.xen" }), false)) { GameSettingsChecker.SignHash(@class); @class.method_20(this.dataFolder + "PAK\\" + text + ".pak.xen", this.dataFolder + "PAK\\" + text + ".pab.xen"); } GC.Collect(); }
private void method_14(bool bool_1) { LoadGameSettings loadGameSettings = new LoadGameSettings(this.string_6); if (loadGameSettings.ShowDialog() != DialogResult.OK) { return; } this.method_15(); this.string_6 = loadGameSettings.method_2(); this.method_13(); try { RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(this.string_1); this.dataFolder = (string)registryKey.GetValue("Path") + "\\DATA\\"; if (!Directory.Exists(this.dataFolder)) { throw new Exception(); } } catch { string text = KeyGenerator.OpenOrSaveFile("Find Guitar Hero " + (this.bool_0 ? "Aerosmith" : "3"), this.bool_0 ? "Guitar Hero Aerosmith Executable|Guitar Hero Aerosmith.exe" : "Guitar Hero 3 Executable|GH3.exe", true); if (string.IsNullOrEmpty(text)) { return; } try { this.dataFolder = new FileInfo(text).Directory.FullName; RegistryKey registryKey = Registry.LocalMachine.CreateSubKey(this.string_1); registryKey.SetValue("Path", this.dataFolder); this.dataFolder += "\\DATA\\"; } catch { MessageBox.Show("Guitar Hero " + (this.bool_0 ? "Aerosmith" : "3") + " is not installed properly on this computer.", "Error!"); return; } } string text2 = this.list_0[loadGameSettings.method_3()]; int int_ = loadGameSettings.method_3(); using (new Class217("QB Parse Operations")) { try { if (!this.method_16(int_) && DialogResult.Yes == MessageBox.Show("A proper backup doesn't exist. Do you wish to start backup creation? (Overwriting!)", "Loading Game Settings", MessageBoxButtons.YesNo) && !this.method_17(int_)) { return; } zzPabNode class2 = new zzPabNode(string.Concat(new string[] { this.string_0, this.string_3, "originals\\qb", text2, ".pak.xen" }), string.Concat(new string[] { this.string_0, this.string_3, "originals\\qb", text2, ".pab.xen" }), false); GH3Songlist gH3Songlist = null; using (this.class319_0 = new zzPabNode(this.dataFolder + "PAK\\qb" + text2 + ".pak.xen", this.dataFolder + "PAK\\qb" + text2 + ".pab.xen", false)) { if (this.method_19(int_).GameSettingsAreValid()) { if (!bool_1) { goto IL_478; } } try { gH3Songlist = new GH3Songlist(this.class319_0.zzGetNode1("scripts\\guitar\\songlist.qb"), new GH3Songlist(class2.zzGetNode1("scripts\\guitar\\songlist.qb"), null)); new zzSetListParser(this.class319_0, gH3Songlist, this.bool_0).method_0(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } this.class319_0.Dispose(); this.class319_0 = null; if (gH3Songlist != null) { DialogResult dialogResult = MessageBox.Show("Game Settings files are not compatible, but something can be recovered. Do you wish to recover when starting from backup? (Overwriting!)", "Loading Game Settings", MessageBoxButtons.YesNoCancel); if (dialogResult == DialogResult.Cancel) { return; } if (dialogResult == DialogResult.No) { gH3Songlist = null; } } else if (DialogResult.No == MessageBox.Show("Game Settings files are not compatible, and nothing can be recovered. Do you wish to start from backup? (Overwriting!)", "Loading Game Settings", MessageBoxButtons.YesNo)) { return; } if (!this.method_16(int_)) { return; } KeyGenerator.smethod_19(this.dataFolder + "PAK\\qb" + text2 + ".pab.xen", string.Concat(new string[] { this.string_0, this.string_3, "lastedited\\qb", text2, ".pab.xen" }), true); KeyGenerator.smethod_19(this.dataFolder + "PAK\\qb" + text2 + ".pak.xen", string.Concat(new string[] { this.string_0, this.string_3, "lastedited\\qb", text2, ".pak.xen" }), true); KeyGenerator.smethod_19(string.Concat(new string[] { this.string_0, this.string_3, "originals\\qb", text2, ".pab.xen" }), this.dataFolder + "PAK\\qb" + text2 + ".pab.xen", true); KeyGenerator.smethod_19(string.Concat(new string[] { this.string_0, this.string_3, "originals\\qb", text2, ".pak.xen" }), this.dataFolder + "PAK\\qb" + text2 + ".pak.xen", true); IL_478:; } this.class319_0 = new zzPabNode(this.dataFolder + "PAK\\qb" + text2 + ".pak.xen", this.dataFolder + "PAK\\qb" + text2 + ".pab.xen", false); this.method_20(int_); this.gh3Songlist_0 = new GH3Songlist(this.class319_0.zzGetNode1("scripts\\guitar\\songlist.qb"), new GH3Songlist(class2.zzGetNode1("scripts\\guitar\\songlist.qb"), null)); class2.Dispose(); bool flag = false; if (gH3Songlist != null) { foreach (string current in gH3Songlist.Keys) { if (!this.gh3Songlist_0.method_3(current)) { this.gh3Songlist_0.Add(gH3Songlist[current]); flag = true; } } } if (flag) { this.method_4(new Class247(this.class319_0, this.gh3Songlist_0)); } new CustomMenuCreator(this.class319_0, this.bool_0).method_0(); new zzSetListParser(this.class319_0, this.gh3Songlist_0, this.bool_0).method_0(); if (flag && gH3Songlist.gh3SetlistList.Count != 0) { bool flag2 = false; using (Dictionary<int, GH3Setlist>.KeyCollection.Enumerator enumerator2 = gH3Songlist.gh3SetlistList.Keys.GetEnumerator()) { IL_78C: while (enumerator2.MoveNext()) { int current2 = enumerator2.Current; GH3Setlist gH3Setlist = gH3Songlist.gh3SetlistList[current2]; if (gH3Setlist.method_4()) { try { /*if (this.gh3Songlist_0.CustomBitMask == -1) { break; }*/ for (int i = 0; ; ) { int num = 1 << i; if (!((this.gh3Songlist_0.CustomBitMask & num) == 0)) goto SKIPIT; this.gh3Songlist_0.CustomBitMask |= (gH3Setlist.CustomBit = num); IL_666: gH3Setlist.prefix = "custom" + (i + 1); int num2; this.gh3Songlist_0.gh3SetlistList.Add(num2 = QbSongClass1.smethod_9("gh3_custom" + (i + 1) + "_songs"), gH3Setlist); int value; this.gh3Songlist_0.dictionary_1.Add(value = QbSongClass1.smethod_9("custom" + (i + 1) + "_progression"), new GHLink(num2)); this.gh3Songlist_0.class214_0.Add("Custom Setlist " + (i + 1), value); this.method_4(new Class246(value, this.class319_0, this.gh3Songlist_0, true)); flag2 = true; goto IL_78C; SKIPIT: i++; if (i >= 32) goto IL_666; } } catch (Exception ex2) { Console.WriteLine(ex2.ToString()); continue; } } if (gH3Setlist.method_2() == "scripts\\guitar\\guitar_download.qb") { this.gh3Songlist_0.gh3SetlistList[current2].method_0().AddRange(gH3Setlist.method_0()); this.method_4(new zzSetListUpdater(current2, this.class319_0, this.gh3Songlist_0)); } } } if (flag2) { this.method_4(new UpdateSetlistSwitcher(this.class319_0, this.gh3Songlist_0, this.bool_0)); } } new Class249(this.class319_0).method_0(); new QbDatabaseInitialModifier(this.class319_0, this.bool_0).method_0(); this.method_0(); } catch (Exception ex3) { if (this.class319_0 != null) { this.class319_0.Dispose(); this.class319_0 = null; } Console.WriteLine(ex3.Message); if (DialogResult.Yes == MessageBox.Show("Game Settings files are corrupt. Do you wish to start from backup? (Overwriting!)", "Loading Game Settings", MessageBoxButtons.YesNo) && this.method_16(int_)) { KeyGenerator.smethod_19(string.Concat(new string[] { this.string_0, this.string_3, "originals\\qb", text2, ".pab.xen" }), this.dataFolder + "PAK\\qb" + text2 + ".pab.xen", true); KeyGenerator.smethod_19(string.Concat(new string[] { this.string_0, this.string_3, "originals\\qb", text2, ".pak.xen" }), this.dataFolder + "PAK\\qb" + text2 + ".pak.xen", true); } return; } } foreach (string current3 in this.gh3Songlist_0.class214_0.Keys) { this.Setlist_DropBox.Items.Add(current3); } this.method_12(true); if (this.Setlist_DropBox.Items.Count != 0) { this.Setlist_DropBox.SelectedIndex = 0; } this.TabControl.SelectedIndex = 1; }