Skip to content

Commit

Permalink
code done. pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
stamepicmorg committed Mar 25, 2022
1 parent 90b560b commit c9a70ac
Showing 1 changed file with 138 additions and 7 deletions.
145 changes: 138 additions & 7 deletions src/UI/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,138 @@ private void resetVTools()

#endregion

#region apply
private void applyVMod()
{
try
{
pictureBoxVMod.Image = Properties.Resources.wait;
Cursor.Current = Cursors.WaitCursor;
try
{
Environment.SetEnvironmentVariable("VMod", textBoxVMod.Text, EnvironmentVariableTarget.User);
checkVMod();
}
catch
{
checkVMod();
}

MessageBox.Show("VMod successfully updated!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Cursor.Current = Cursors.Default;
}
catch
{
MessageBox.Show("Something went wrong and VMod was not successfully updated", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Cursor.Current = Cursors.Default;
}
}

private void applyVProject()
{
try
{
pictureBoxVProject.Image = Properties.Resources.wait;
Cursor.Current = Cursors.WaitCursor;
try
{
Environment.SetEnvironmentVariable("VProject", textBoxVProject.Text, EnvironmentVariableTarget.User);
checkVProject();
}
catch
{
checkVProject();
}

MessageBox.Show("VProject successfully updated!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Cursor.Current = Cursors.Default;
}
catch
{
MessageBox.Show("Something went wrong and VProject was not successfully updated", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Cursor.Current = Cursors.Default;
}
}

private void applyVGame()
{
try
{
pictureBoxVGame.Image = Properties.Resources.wait;
Cursor.Current = Cursors.WaitCursor;
try
{
Environment.SetEnvironmentVariable("VGame", textBoxVGame.Text, EnvironmentVariableTarget.User);
checkVGame();
}
catch
{
checkVGame();
}

MessageBox.Show("VGame successfully cleared updated!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Cursor.Current = Cursors.Default;
}
catch
{
MessageBox.Show("Something went wrong and VGame was not successfully updated", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Cursor.Current = Cursors.Default;
}
}

private void applyVContent()
{
try
{
pictureBoxVContent.Image = Properties.Resources.wait;
Cursor.Current = Cursors.WaitCursor;
try
{
Environment.SetEnvironmentVariable("VContent", textBoxVContent.Text, EnvironmentVariableTarget.User);
checkVContent();
}
catch
{
checkVContent();
}

MessageBox.Show("VContent successfully updated!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Cursor.Current = Cursors.Default;
}
catch
{
MessageBox.Show("Something went wrong and VContent was not successfully updated", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Cursor.Current = Cursors.Default;
}
}

private void applyVTools()
{
try
{
pictureBoxVTools.Image = Properties.Resources.wait;
Cursor.Current = Cursors.WaitCursor;
try
{
Environment.SetEnvironmentVariable("VTools", textBoxVTools.Text, EnvironmentVariableTarget.User);
checkVTools();
}
catch
{
checkVTools();
}

MessageBox.Show("VTools successfully cleared updated!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Cursor.Current = Cursors.Default;
}
catch
{
MessageBox.Show("Something went wrong and VTools was not successfully updated", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Cursor.Current = Cursors.Default;
}
}
#endregion

#region btn-reset
private void resetAllToolStripMenuItem_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -309,7 +441,7 @@ private void buttonResetVTools_Click(object sender, EventArgs e)
}
}
#endregion

#region btn-browse
private void buttonBrowseVProject_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -349,43 +481,42 @@ private void buttonApplyVMod_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{

applyVMod();
}
}

private void buttonApplyVProject_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{

applyVProject();
}
}

private void buttonApplyVGame_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{

applyVGame();
}
}

private void buttonApplyVContent_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{

applyVContent();
}
}

private void buttonApplyVTools_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{

applyVTools();
}
}
#endregion


}
}

0 comments on commit c9a70ac

Please sign in to comment.