// Replace button private void button2_Click(object sender, EventArgs e) { openFileDialog1.InitialDirectory = Properties.Settings.Default.texLoadPath; if (openFileDialog1.ShowDialog() == DialogResult.OK) { Properties.Settings.Default.texLoadPath = Path.GetDirectoryName(openFileDialog1.FileName); Properties.Settings.Default.Save(); bool result = GhgManager.OverwriteTexture(selected, ghg, currentGhgPath, openFileDialog1.FileName); if (result) { MessageBox.Show("Successfully replaced texture!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Failed to replace texture.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } LoadTexturesFromGhg(currentGhgPath); int i = 0; foreach (ImagePanelWithDetails imgPanel in panel1.Controls.OfType <ImagePanelWithDetails>()) { if (i == selected) { imgPanel.SetSelected(true); pictureBox1.Image = imgPanel.pictureBox.Image; } i++; } }
// Replace button private void button2_Click(object sender, EventArgs e) { openFileDialog1.InitialDirectory = Properties.Settings.Default.iconLoadPath; if (openFileDialog1.ShowDialog() == DialogResult.OK) { Properties.Settings.Default.iconLoadPath = Path.GetDirectoryName(openFileDialog1.FileName); Properties.Settings.Default.Save(); bool result = GhgManager.OverwriteTexture(0, ghg, currentIconPath, openFileDialog1.FileName); if (result) { MessageBox.Show("Successfully replaced texture!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Failed to replace texture.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } LoadIconFromGsc(currentIconPath); } }