private void installAnAddonButton_Click(object sender, EventArgs e)
{
Button source = (Button)sender;
switch (source.Name.Replace("button", string.Empty))
{
case "AddonBrowse":
{
if (addonLocationDialog.ShowDialog() == DialogResult.OK)
{
string targetAddon = addonLocationDialog.FileName;
readAddon(targetAddon);
}
}
break;
case "AddonInstall":
{
buttonAddonInstall.Enabled = false;
buttonAddonInstall.Text = "Installing...";
string targetAddon = addonLocationDialog.FileName;
if (targetAddon.installAddon())
{
offlineServerTalk.notify(IPCPacketType.installedAddon, targetAddon.readAddonProperty(addonNameDef));
MessageBox.Show("The selected addon has been installed successfully.", "Just to let you know...",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("There was an error while installing the selected addon. Please double-check the addon and retry.", "Beep boop, I done goofed",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
this.BringToFront();
buttonAddonInstall.Text = "Install Addon";
buttonAddonInstall.Enabled = true;
}
break;
}
}
private void toolStripMenuItem_Click(object sender, EventArgs e)