private void addFilesToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog OFD = new OpenFileDialog(); OFD.Multiselect = true; if (OFD.ShowDialog() != DialogResult.OK) { return; } menuStrip1.Enabled = buttonX1.Enabled = buttonX2.Enabled = listView1.Enabled = false; List <ListViewItem> xItems = new List <ListViewItem>(); progressBarX1.Value = 0; progressBarX1.Maximum = OFD.FileNames.Length; textBoxX1.Text = "Status: Reading files..."; textBoxX1.Refresh(); foreach (string x in OFD.FileNames) { GameGPD z = null; try { z = new GameGPD(x, ProfileTools.GPDNameToID(Path.GetFileName(x))); ListViewItem u = new ListViewItem(z.GetStringByID((long)GPDIDs.ThisTitle)); if (u.SubItems[0].Text == null || u.SubItems[0].Text == "") { z.Close(); continue; } u.SubItems.Add(z.TitleID.ToString("X2")); u.SubItems.Add(x); z.Close(); xItems.Add(u); } catch { if (z != null) { z.Close(); } } progressBarX1.Value++; Application.DoEvents(); } listView1.Items.AddRange(xItems.ToArray()); textBoxX1.Text = "Status: Idle..."; menuStrip1.Enabled = buttonX1.Enabled = buttonX2.Enabled = listView1.Enabled = true; }
private void addFilesToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog OFD = new OpenFileDialog(); OFD.Multiselect = true; if (OFD.ShowDialog() != DialogResult.OK) return; menuStrip1.Enabled = buttonX1.Enabled = buttonX2.Enabled = listView1.Enabled = false; List<ListViewItem> xItems = new List<ListViewItem>(); progressBarX1.Value = 0; progressBarX1.Maximum = OFD.FileNames.Length; textBoxX1.Text = "Status: Reading files..."; textBoxX1.Refresh(); foreach (string x in OFD.FileNames) { GameGPD z = null; try { z = new GameGPD(x, ProfileTools.GPDNameToID(Path.GetFileName(x))); ListViewItem u = new ListViewItem(z.GetStringByID((long)GPDIDs.ThisTitle)); if (u.SubItems[0].Text == null || u.SubItems[0].Text == "") { z.Close(); continue; } u.SubItems.Add(z.TitleID.ToString("X2")); u.SubItems.Add(x); z.Close(); xItems.Add(u); } catch { if (z != null) z.Close(); } progressBarX1.Value++; Application.DoEvents(); } listView1.Items.AddRange(xItems.ToArray()); textBoxX1.Text = "Status: Idle..."; menuStrip1.Enabled = buttonX1.Enabled = buttonX2.Enabled = listView1.Enabled = true; }
private void loadInViewerToolStripMenuItem1_Click(object sender, EventArgs e) { this.Enabled = false; FileEntry xent = xprof.GetFile(xprof.UserGPD.TitlesPlayed[listBox3.SelectedIndex].ID.ToString("X") + ".gpd"); if (xent == null) { Log("Could not find specified file"); this.Enabled = true; return; } Log("Extracting " + xent.Name + "..."); string xOut = VariousFunctions.GetTempFileLocale(); if (!xent.Extract(xOut)) { Log("Extraction error"); VariousFunctions.DeleteFile(xOut); this.Enabled = true; return; } GameGPD xload = new GameGPD(xOut, ProfileTools.GPDNameToID(xent.Name)); if (!xload.IsValid) { Log("Error when parsing GPD"); xload.Close(); try { VariousFunctions.DeleteFile(xOut); } catch { } this.Enabled = true; return; } GPDViewer x = new GPDViewer(xload); x.MdiParent = xMForm; x.Show(); Log("GPD Loaded"); this.Enabled = true; }
private void buttonX15_Click(object sender, EventArgs e) { if (!xprof.HasDashGPD) { return; } MultiAdder x = new MultiAdder(); if (x.ShowDialog() != DialogResult.OK) { return; } tabControl1.Enabled = false; foreach (ListViewItem y in x.listView1.Items) { try { GameGPD z = null; try { z = new GameGPD(y.SubItems[2].Text, Convert.ToUInt32(y.SubItems[1].Text, 16)); } catch { continue; } if (xprof.AddGame(z)) { listBox3.Items.Add(y.SubItems[0].Text + " (" + y.SubItems[1].Text + ")"); } else { SetList(); } z.Close(); } catch { } Application.DoEvents(); } SetNmric(GPDIDs.GCardCredit, textBoxX15); tabControl1.Enabled = true; }
private void loadInViewerToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedIndices.Count == 0) { return; } FileEntry xent = (FileEntry)listView1.SelectedItems[0].Tag; this.Enabled = false; Log("Extracting " + xent.Name + "..."); string xOut = VariousFunctions.GetTempFileLocale(); if (!xent.Extract(xOut)) { Log("Extraction error"); this.Enabled = true; return; } GameGPD xload = new GameGPD(xOut, ProfileTools.GPDNameToID(xent.Name)); if (!xload.IsValid) { Log("Error when parsing GPD"); xload.Close(); try { VariousFunctions.DeleteFile(xOut); } catch { } this.Enabled = true; return; } GPDViewer x = new GPDViewer(xload); x.MdiParent = xMForm; x.Show(); Log("GPD Loaded"); this.Enabled = true; }
private void loadInViewerToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedIndices.Count == 0) return; FileEntry xent = (FileEntry)listView1.SelectedItems[0].Tag; this.Enabled = false; Log("Extracting " + xent.Name + "..."); string xOut = VariousFunctions.GetTempFileLocale(); if (!xent.Extract(xOut)) { Log("Extraction error"); this.Enabled = true; return; } GameGPD xload = new GameGPD(xOut, ProfileTools.GPDNameToID(xent.Name)); if (!xload.IsValid) { Log("Error when parsing GPD"); xload.Close(); try { VariousFunctions.DeleteFile(xOut); } catch { } this.Enabled = true; return; } GPDViewer x = new GPDViewer(xload); x.MdiParent = xMForm; x.Show(); Log("GPD Loaded"); this.Enabled = true; }
private void listBox3_SelectedIndexChanged(object sender, EventArgs e) { if (listBox3.SelectedIndex < 0) return; tabControl1.Enabled = false; buttonX12.Enabled = true; TitlePlayedEntry x = xprof.UserGPD.TitlesPlayed[listBox3.SelectedIndex]; try { dateTimePicker3.Value = dateTimePicker4.Value = x.LastLoadedDT; } catch { dateTimePicker3.Value = dateTimePicker4.Value = DateTime.Now; } textBoxX14.Text = "Unlocked " + x.EarnedCount.ToString() + " of " + x.PossibleCount.ToString(); textBoxX14.Text += Environment.NewLine + "Total of " + x.EarnedWorth.ToString() + " of " + x.PossibleWorth.ToString(); string path = x.TitleID.ToString("X").ToUpper() + ".gpd"; FileEntry xent = xPackage.GetFile(path); if (xent == null) { Log("Error: could not find GPD"); killachievetab(); tabControl1.Enabled = true; return; } string xOut = VariousFunctions.GetTempFileLocale(); if (!xent.Extract(xOut)) { Log("Extraction error"); killachievetab(); tabControl1.Enabled = true; return; } GameGPD xload = new GameGPD(xOut, x.TitleID); if (!xload.IsValid) { Log("Error when parsing GPD"); xload.Close(); try { VariousFunctions.DeleteFile(xOut); } catch { } xload = null; killachievetab(); tabControl1.Enabled = true; return; } listBox2.Items.Clear(); for (int i = 0; i < xload.Achievements.Length; i++) listBox2.Items.Add(xload.Achievements[i].Title); Image xTitleIMGS = xload.GetImageByID(0x8000); if (xTitleIMGS != null) pictureBox4.Image = xTitleIMGS; else pictureBox4.Image = PublicResources.NoImage; string xTitleStrings = xload.GetStringByID(0x8000); if (xTitleStrings != null) textBoxX4.Text = xTitleStrings; else textBoxX4.Text = "Unknown"; xLoadedGPD = xload; xLoadedEntry = xent; if (listBox2.Items.Count > 0) listBox2.SelectedIndex = 0; listBox2_SelectedIndexChanged(null, null); buttonX11.Enabled = buttonX3.Enabled = buttonX10.Enabled = tabControl1.Enabled = buttonX6.Enabled = tabControlPanel10.Enabled = true; Log("GPD Loaded"); }
private void buttonX15_Click(object sender, EventArgs e) { if (!xprof.HasDashGPD) return; MultiAdder x = new MultiAdder(); if (x.ShowDialog() != DialogResult.OK) return; tabControl1.Enabled = false; foreach (ListViewItem y in x.listView1.Items) { try { GameGPD z = null; try { z = new GameGPD(y.SubItems[2].Text, Convert.ToUInt32(y.SubItems[1].Text, 16)); } catch { continue; } if (xprof.AddGame(z)) listBox3.Items.Add(y.SubItems[0].Text + " (" + y.SubItems[1].Text + ")"); else SetList(); z.Close(); } catch { } Application.DoEvents(); } SetNmric(GPDIDs.GCardCredit, textBoxX15); tabControl1.Enabled = true; }
private void listBox3_SelectedIndexChanged(object sender, EventArgs e) { if (listBox3.SelectedIndex < 0) { return; } tabControl1.Enabled = false; buttonX12.Enabled = true; TitlePlayedEntry x = xprof.UserGPD.TitlesPlayed[listBox3.SelectedIndex]; try { dateTimePicker3.Value = dateTimePicker4.Value = x.LastLoadedDT; } catch { dateTimePicker3.Value = dateTimePicker4.Value = DateTime.Now; } textBoxX14.Text = "Unlocked " + x.EarnedCount.ToString() + " of " + x.PossibleCount.ToString(); textBoxX14.Text += Environment.NewLine + "Total of " + x.EarnedWorth.ToString() + " of " + x.PossibleWorth.ToString(); string path = x.TitleID.ToString("X").ToUpper() + ".gpd"; FileEntry xent = xPackage.GetFile(path); if (xent == null) { Log("Error: could not find GPD"); killachievetab(); tabControl1.Enabled = true; return; } string xOut = VariousFunctions.GetTempFileLocale(); if (!xent.Extract(xOut)) { Log("Extraction error"); killachievetab(); tabControl1.Enabled = true; return; } GameGPD xload = new GameGPD(xOut, x.TitleID); if (!xload.IsValid) { Log("Error when parsing GPD"); xload.Close(); try { VariousFunctions.DeleteFile(xOut); } catch { } xload = null; killachievetab(); tabControl1.Enabled = true; return; } listBox2.Items.Clear(); for (int i = 0; i < xload.Achievements.Length; i++) { listBox2.Items.Add(xload.Achievements[i].Title); } Image xTitleIMGS = xload.GetImageByID(0x8000); if (xTitleIMGS != null) { pictureBox4.Image = xTitleIMGS; } else { pictureBox4.Image = PublicResources.NoImage; } string xTitleStrings = xload.GetStringByID(0x8000); if (xTitleStrings != null) { textBoxX4.Text = xTitleStrings; } else { textBoxX4.Text = "Unknown"; } xLoadedGPD = xload; xLoadedEntry = xent; if (listBox2.Items.Count > 0) { listBox2.SelectedIndex = 0; } listBox2_SelectedIndexChanged(null, null); buttonX11.Enabled = buttonX3.Enabled = buttonX10.Enabled = tabControl1.Enabled = buttonX6.Enabled = tabControlPanel10.Enabled = true; Log("GPD Loaded"); }