//Opens a form for the user to select which version to go to.
        private void revertGameVersionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int version   = 1;
            int toVersion = 1;

            //so the form doesn't get disposed before we get the data we need
            using (RevertVersion rev = new RevertVersion(this))
            {
                DialogResult res = rev.ShowDialog();
                if (res == DialogResult.OK)
                {
                    version   = rev.retVersion;
                    toVersion = rev.retToVersion;
                }
                else //the user closed the form without wanting to change
                {
                    return;
                }
            }

            if (version != 0)
            {
                if (ChangeCurrentVersion(version))
                {
                    sstriplblStatus.Text   = "Version change success. Click 'Download and Update' to update to latest version.";
                    lblCurrentVersion.Text = "Current Overgrowth version: " + GetCurrentVersion();
                }
                else
                {
                    sstriplblStatus.Text = "Version change failed.";
                }
            }
            else if (version == 0)
            {
                sstriplblStatus.Text = "Version change failed. You didn't select a valid version";
            }
            else if (version == 1 || toVersion == 1) //we only get here when bad things happen
            {
                sstriplblStatus.Text = "Version change failed. The variable(s) never got set";
            }

            if (toVersion != 0) //if we specified a version we want to update to
            {
                if (toVersion < version)
                {
                    sstriplblStatus.Text = "Will not update to the version specified, because it is less than the reverted version.";
                }
                else
                {
                    latestVersion = toVersion;
                }
            }
        }//end revertGameVersionToolStripMenuItem_Click
Beispiel #2
0
        //Opens a form for the user to select which version to go to.
        private void revertGameVersionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int version = 1;
            int toVersion = 1;

            //so the form doesn't get disposed before we get the data we need
            using (RevertVersion rev = new RevertVersion(this))
            {
                DialogResult res = rev.ShowDialog();
                if (res == DialogResult.OK)
                {
                    version = rev.retVersion;
                    toVersion = rev.retToVersion;
                }
                else //the user closed the form without wanting to change
                    return;
            }

            if (version != 0)
            {
                if (ChangeCurrentVersion(version))
                {
                    sstriplblStatus.Text = "Version change success. Click 'Download and Update' to update to latest version.";
                    lblCurrentVersion.Text = "Current Overgrowth version: "+ GetCurrentVersion();
                }
                else
                    sstriplblStatus.Text = "Version change failed.";
            }
            else if (version == 0)
                sstriplblStatus.Text = "Version change failed. You didn't select a valid version";
            else if (version == 1 || toVersion == 1) //we only get here when bad things happen
                sstriplblStatus.Text = "Version change failed. The variable(s) never got set";

            if (toVersion != 0) //if we specified a version we want to update to
            {
                if (toVersion < version)
                    sstriplblStatus.Text = "Will not update to the version specified, because it is less than the reverted version.";
                else
                    latestVersion = toVersion;
            }
        }