code update

This commit is contained in:
STAM 2022-03-26 03:11:48 +05:00
parent 584611e67e
commit e249ff1fe7
Signed by: stam
GPG Key ID: E149C3760CFA3C7E
2 changed files with 239 additions and 24 deletions

View File

@ -33,6 +33,8 @@
this.menuStrip = new System.Windows.Forms.MenuStrip(); this.menuStrip = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.resetAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -59,7 +61,7 @@
this.buttonApplyVContent = new System.Windows.Forms.Button(); this.buttonApplyVContent = new System.Windows.Forms.Button();
this.textBoxVContent = new System.Windows.Forms.TextBox(); this.textBoxVContent = new System.Windows.Forms.TextBox();
this.pictureBoxVContent = new System.Windows.Forms.PictureBox(); this.pictureBoxVContent = new System.Windows.Forms.PictureBox();
this.groupBox5 = new System.Windows.Forms.GroupBox(); this.groupBoxVTools = new System.Windows.Forms.GroupBox();
this.buttonBrowseVTools = new System.Windows.Forms.Button(); this.buttonBrowseVTools = new System.Windows.Forms.Button();
this.buttonResetVTools = new System.Windows.Forms.Button(); this.buttonResetVTools = new System.Windows.Forms.Button();
this.buttonApplyVTools = new System.Windows.Forms.Button(); this.buttonApplyVTools = new System.Windows.Forms.Button();
@ -75,7 +77,7 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBoxVGame)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxVGame)).BeginInit();
this.groupBoxVContent.SuspendLayout(); this.groupBoxVContent.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxVContent)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxVContent)).BeginInit();
this.groupBox5.SuspendLayout(); this.groupBoxVTools.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxVTools)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxVTools)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -94,6 +96,8 @@
// //
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.refreshToolStripMenuItem, this.refreshToolStripMenuItem,
this.resetAllToolStripMenuItem,
this.toolStripSeparator1,
this.exitToolStripMenuItem}); this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
@ -103,16 +107,30 @@
// //
this.refreshToolStripMenuItem.Image = global::SourceSDK.ENV.Editor.Properties.Resources.refresh16; this.refreshToolStripMenuItem.Image = global::SourceSDK.ENV.Editor.Properties.Resources.refresh16;
this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem"; this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
this.refreshToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.refreshToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
this.refreshToolStripMenuItem.Text = "Refresh"; this.refreshToolStripMenuItem.Text = "Refresh";
this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click); this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
// //
// resetAllToolStripMenuItem
//
this.resetAllToolStripMenuItem.Image = global::SourceSDK.ENV.Editor.Properties.Resources.power_on;
this.resetAllToolStripMenuItem.Name = "resetAllToolStripMenuItem";
this.resetAllToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
this.resetAllToolStripMenuItem.Text = "Reset all";
this.resetAllToolStripMenuItem.Click += new System.EventHandler(this.resetAllToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6);
//
// exitToolStripMenuItem // exitToolStripMenuItem
// //
this.exitToolStripMenuItem.Image = global::SourceSDK.ENV.Editor.Properties.Resources.power_on; this.exitToolStripMenuItem.Image = global::SourceSDK.ENV.Editor.Properties.Resources.arrows;
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.exitToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
// //
// helpToolStripMenuItem // helpToolStripMenuItem
// //
@ -149,7 +167,9 @@
this.buttonResetVMod.Name = "buttonResetVMod"; this.buttonResetVMod.Name = "buttonResetVMod";
this.buttonResetVMod.Size = new System.Drawing.Size(75, 23); this.buttonResetVMod.Size = new System.Drawing.Size(75, 23);
this.buttonResetVMod.TabIndex = 2; this.buttonResetVMod.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonResetVMod, "Reset");
this.buttonResetVMod.UseVisualStyleBackColor = true; this.buttonResetVMod.UseVisualStyleBackColor = true;
this.buttonResetVMod.Click += new System.EventHandler(this.buttonResetVMod_Click);
// //
// buttonApplyVMod // buttonApplyVMod
// //
@ -158,7 +178,7 @@
this.buttonApplyVMod.Name = "buttonApplyVMod"; this.buttonApplyVMod.Name = "buttonApplyVMod";
this.buttonApplyVMod.Size = new System.Drawing.Size(75, 23); this.buttonApplyVMod.Size = new System.Drawing.Size(75, 23);
this.buttonApplyVMod.TabIndex = 2; this.buttonApplyVMod.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonApplyVMod, "asdss"); this.toolTip.SetToolTip(this.buttonApplyVMod, "Apply");
this.buttonApplyVMod.UseVisualStyleBackColor = true; this.buttonApplyVMod.UseVisualStyleBackColor = true;
// //
// textBoxVMod // textBoxVMod
@ -168,6 +188,7 @@
this.textBoxVMod.PlaceholderText = "MyMod"; this.textBoxVMod.PlaceholderText = "MyMod";
this.textBoxVMod.Size = new System.Drawing.Size(595, 23); this.textBoxVMod.Size = new System.Drawing.Size(595, 23);
this.textBoxVMod.TabIndex = 1; this.textBoxVMod.TabIndex = 1;
this.toolTip.SetToolTip(this.textBoxVMod, "Your sourcemod name");
// //
// pictureBoxVMod // pictureBoxVMod
// //
@ -200,6 +221,7 @@
this.buttonBrowseVProject.Size = new System.Drawing.Size(75, 23); this.buttonBrowseVProject.Size = new System.Drawing.Size(75, 23);
this.buttonBrowseVProject.TabIndex = 3; this.buttonBrowseVProject.TabIndex = 3;
this.buttonBrowseVProject.Text = "..."; this.buttonBrowseVProject.Text = "...";
this.toolTip.SetToolTip(this.buttonBrowseVProject, "Browse");
this.buttonBrowseVProject.UseVisualStyleBackColor = true; this.buttonBrowseVProject.UseVisualStyleBackColor = true;
// //
// buttonResetVProject // buttonResetVProject
@ -209,7 +231,9 @@
this.buttonResetVProject.Name = "buttonResetVProject"; this.buttonResetVProject.Name = "buttonResetVProject";
this.buttonResetVProject.Size = new System.Drawing.Size(75, 23); this.buttonResetVProject.Size = new System.Drawing.Size(75, 23);
this.buttonResetVProject.TabIndex = 2; this.buttonResetVProject.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonResetVProject, "Reset");
this.buttonResetVProject.UseVisualStyleBackColor = true; this.buttonResetVProject.UseVisualStyleBackColor = true;
this.buttonResetVProject.Click += new System.EventHandler(this.buttonResetVProject_Click);
// //
// buttonApplyVProject // buttonApplyVProject
// //
@ -218,6 +242,7 @@
this.buttonApplyVProject.Name = "buttonApplyVProject"; this.buttonApplyVProject.Name = "buttonApplyVProject";
this.buttonApplyVProject.Size = new System.Drawing.Size(75, 23); this.buttonApplyVProject.Size = new System.Drawing.Size(75, 23);
this.buttonApplyVProject.TabIndex = 2; this.buttonApplyVProject.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonApplyVProject, "Apply");
this.buttonApplyVProject.UseVisualStyleBackColor = true; this.buttonApplyVProject.UseVisualStyleBackColor = true;
// //
// textBoxVProject // textBoxVProject
@ -227,6 +252,7 @@
this.textBoxVProject.PlaceholderText = "C:\\Program Files\\Steam\\steamapps\\sourcemods\\MyMod"; this.textBoxVProject.PlaceholderText = "C:\\Program Files\\Steam\\steamapps\\sourcemods\\MyMod";
this.textBoxVProject.Size = new System.Drawing.Size(514, 23); this.textBoxVProject.Size = new System.Drawing.Size(514, 23);
this.textBoxVProject.TabIndex = 1; this.textBoxVProject.TabIndex = 1;
this.toolTip.SetToolTip(this.textBoxVProject, "Path to Your sourcemod folder");
// //
// pictureBoxVProject // pictureBoxVProject
// //
@ -259,6 +285,7 @@
this.buttonBrowseVGame.Size = new System.Drawing.Size(75, 23); this.buttonBrowseVGame.Size = new System.Drawing.Size(75, 23);
this.buttonBrowseVGame.TabIndex = 3; this.buttonBrowseVGame.TabIndex = 3;
this.buttonBrowseVGame.Text = "..."; this.buttonBrowseVGame.Text = "...";
this.toolTip.SetToolTip(this.buttonBrowseVGame, "Browse");
this.buttonBrowseVGame.UseVisualStyleBackColor = true; this.buttonBrowseVGame.UseVisualStyleBackColor = true;
// //
// buttonResetVGame // buttonResetVGame
@ -268,7 +295,9 @@
this.buttonResetVGame.Name = "buttonResetVGame"; this.buttonResetVGame.Name = "buttonResetVGame";
this.buttonResetVGame.Size = new System.Drawing.Size(75, 23); this.buttonResetVGame.Size = new System.Drawing.Size(75, 23);
this.buttonResetVGame.TabIndex = 2; this.buttonResetVGame.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonResetVGame, "Reset");
this.buttonResetVGame.UseVisualStyleBackColor = true; this.buttonResetVGame.UseVisualStyleBackColor = true;
this.buttonResetVGame.Click += new System.EventHandler(this.buttonResetVGame_Click);
// //
// buttonApplyVGame // buttonApplyVGame
// //
@ -277,6 +306,7 @@
this.buttonApplyVGame.Name = "buttonApplyVGame"; this.buttonApplyVGame.Name = "buttonApplyVGame";
this.buttonApplyVGame.Size = new System.Drawing.Size(75, 23); this.buttonApplyVGame.Size = new System.Drawing.Size(75, 23);
this.buttonApplyVGame.TabIndex = 2; this.buttonApplyVGame.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonApplyVGame, "Apply");
this.buttonApplyVGame.UseVisualStyleBackColor = true; this.buttonApplyVGame.UseVisualStyleBackColor = true;
// //
// textBoxVGame // textBoxVGame
@ -286,6 +316,7 @@
this.textBoxVGame.PlaceholderText = "C:\\Program Files\\Steam\\steamapps\\common\\SourceFilmmaker\\game"; this.textBoxVGame.PlaceholderText = "C:\\Program Files\\Steam\\steamapps\\common\\SourceFilmmaker\\game";
this.textBoxVGame.Size = new System.Drawing.Size(514, 23); this.textBoxVGame.Size = new System.Drawing.Size(514, 23);
this.textBoxVGame.TabIndex = 1; this.textBoxVGame.TabIndex = 1;
this.toolTip.SetToolTip(this.textBoxVGame, "Path to \"game \" folder");
// //
// pictureBoxVGame // pictureBoxVGame
// //
@ -318,6 +349,7 @@
this.buttonBrowseVContent.Size = new System.Drawing.Size(75, 23); this.buttonBrowseVContent.Size = new System.Drawing.Size(75, 23);
this.buttonBrowseVContent.TabIndex = 3; this.buttonBrowseVContent.TabIndex = 3;
this.buttonBrowseVContent.Text = "..."; this.buttonBrowseVContent.Text = "...";
this.toolTip.SetToolTip(this.buttonBrowseVContent, "Browse");
this.buttonBrowseVContent.UseVisualStyleBackColor = true; this.buttonBrowseVContent.UseVisualStyleBackColor = true;
// //
// buttonResetVContent // buttonResetVContent
@ -327,6 +359,7 @@
this.buttonResetVContent.Name = "buttonResetVContent"; this.buttonResetVContent.Name = "buttonResetVContent";
this.buttonResetVContent.Size = new System.Drawing.Size(75, 23); this.buttonResetVContent.Size = new System.Drawing.Size(75, 23);
this.buttonResetVContent.TabIndex = 2; this.buttonResetVContent.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonResetVContent, "Reset");
this.buttonResetVContent.UseVisualStyleBackColor = true; this.buttonResetVContent.UseVisualStyleBackColor = true;
// //
// buttonApplyVContent // buttonApplyVContent
@ -336,6 +369,7 @@
this.buttonApplyVContent.Name = "buttonApplyVContent"; this.buttonApplyVContent.Name = "buttonApplyVContent";
this.buttonApplyVContent.Size = new System.Drawing.Size(75, 23); this.buttonApplyVContent.Size = new System.Drawing.Size(75, 23);
this.buttonApplyVContent.TabIndex = 2; this.buttonApplyVContent.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonApplyVContent, "Apply");
this.buttonApplyVContent.UseVisualStyleBackColor = true; this.buttonApplyVContent.UseVisualStyleBackColor = true;
// //
// textBoxVContent // textBoxVContent
@ -345,6 +379,7 @@
this.textBoxVContent.PlaceholderText = "C:\\Program Files\\Steam\\steamapps\\common\\SourceFilmmaker\\content"; this.textBoxVContent.PlaceholderText = "C:\\Program Files\\Steam\\steamapps\\common\\SourceFilmmaker\\content";
this.textBoxVContent.Size = new System.Drawing.Size(514, 23); this.textBoxVContent.Size = new System.Drawing.Size(514, 23);
this.textBoxVContent.TabIndex = 1; this.textBoxVContent.TabIndex = 1;
this.toolTip.SetToolTip(this.textBoxVContent, "Path to \"content \" folder");
// //
// pictureBoxVContent // pictureBoxVContent
// //
@ -356,19 +391,19 @@
this.pictureBoxVContent.TabIndex = 0; this.pictureBoxVContent.TabIndex = 0;
this.pictureBoxVContent.TabStop = false; this.pictureBoxVContent.TabStop = false;
// //
// groupBox5 // groupBoxVTools
// //
this.groupBox5.Controls.Add(this.buttonBrowseVTools); this.groupBoxVTools.Controls.Add(this.buttonBrowseVTools);
this.groupBox5.Controls.Add(this.buttonResetVTools); this.groupBoxVTools.Controls.Add(this.buttonResetVTools);
this.groupBox5.Controls.Add(this.buttonApplyVTools); this.groupBoxVTools.Controls.Add(this.buttonApplyVTools);
this.groupBox5.Controls.Add(this.textBoxVTools); this.groupBoxVTools.Controls.Add(this.textBoxVTools);
this.groupBox5.Controls.Add(this.pictureBoxVTools); this.groupBoxVTools.Controls.Add(this.pictureBoxVTools);
this.groupBox5.Location = new System.Drawing.Point(12, 399); this.groupBoxVTools.Location = new System.Drawing.Point(12, 399);
this.groupBox5.Name = "groupBox5"; this.groupBoxVTools.Name = "groupBoxVTools";
this.groupBox5.Size = new System.Drawing.Size(629, 87); this.groupBoxVTools.Size = new System.Drawing.Size(629, 87);
this.groupBox5.TabIndex = 1; this.groupBoxVTools.TabIndex = 1;
this.groupBox5.TabStop = false; this.groupBoxVTools.TabStop = false;
this.groupBox5.Text = "VTools (SFM)"; this.groupBoxVTools.Text = "VTools (SFM)";
// //
// buttonBrowseVTools // buttonBrowseVTools
// //
@ -377,6 +412,7 @@
this.buttonBrowseVTools.Size = new System.Drawing.Size(75, 23); this.buttonBrowseVTools.Size = new System.Drawing.Size(75, 23);
this.buttonBrowseVTools.TabIndex = 3; this.buttonBrowseVTools.TabIndex = 3;
this.buttonBrowseVTools.Text = "..."; this.buttonBrowseVTools.Text = "...";
this.toolTip.SetToolTip(this.buttonBrowseVTools, "Browse");
this.buttonBrowseVTools.UseVisualStyleBackColor = true; this.buttonBrowseVTools.UseVisualStyleBackColor = true;
// //
// buttonResetVTools // buttonResetVTools
@ -386,6 +422,7 @@
this.buttonResetVTools.Name = "buttonResetVTools"; this.buttonResetVTools.Name = "buttonResetVTools";
this.buttonResetVTools.Size = new System.Drawing.Size(75, 23); this.buttonResetVTools.Size = new System.Drawing.Size(75, 23);
this.buttonResetVTools.TabIndex = 2; this.buttonResetVTools.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonResetVTools, "Reset");
this.buttonResetVTools.UseVisualStyleBackColor = true; this.buttonResetVTools.UseVisualStyleBackColor = true;
// //
// buttonApplyVTools // buttonApplyVTools
@ -395,6 +432,7 @@
this.buttonApplyVTools.Name = "buttonApplyVTools"; this.buttonApplyVTools.Name = "buttonApplyVTools";
this.buttonApplyVTools.Size = new System.Drawing.Size(75, 23); this.buttonApplyVTools.Size = new System.Drawing.Size(75, 23);
this.buttonApplyVTools.TabIndex = 2; this.buttonApplyVTools.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonApplyVTools, "Apply");
this.buttonApplyVTools.UseVisualStyleBackColor = true; this.buttonApplyVTools.UseVisualStyleBackColor = true;
// //
// textBoxVTools // textBoxVTools
@ -404,6 +442,7 @@
this.textBoxVTools.PlaceholderText = "C:\\Program Files\\Steam\\steamapps\\common\\SourceFilmmaker\\game\\sdktools"; this.textBoxVTools.PlaceholderText = "C:\\Program Files\\Steam\\steamapps\\common\\SourceFilmmaker\\game\\sdktools";
this.textBoxVTools.Size = new System.Drawing.Size(514, 23); this.textBoxVTools.Size = new System.Drawing.Size(514, 23);
this.textBoxVTools.TabIndex = 1; this.textBoxVTools.TabIndex = 1;
this.toolTip.SetToolTip(this.textBoxVTools, "Path to \"sdktols \" folder");
// //
// pictureBoxVTools // pictureBoxVTools
// //
@ -420,7 +459,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(653, 502); this.ClientSize = new System.Drawing.Size(653, 502);
this.Controls.Add(this.groupBox5); this.Controls.Add(this.groupBoxVTools);
this.Controls.Add(this.groupBoxVContent); this.Controls.Add(this.groupBoxVContent);
this.Controls.Add(this.groupBoxVGame); this.Controls.Add(this.groupBoxVGame);
this.Controls.Add(this.groupBoxVProject); this.Controls.Add(this.groupBoxVProject);
@ -450,8 +489,8 @@
this.groupBoxVContent.ResumeLayout(false); this.groupBoxVContent.ResumeLayout(false);
this.groupBoxVContent.PerformLayout(); this.groupBoxVContent.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxVContent)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxVContent)).EndInit();
this.groupBox5.ResumeLayout(false); this.groupBoxVTools.ResumeLayout(false);
this.groupBox5.PerformLayout(); this.groupBoxVTools.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxVTools)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxVTools)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -489,12 +528,14 @@
private Button buttonApplyVContent; private Button buttonApplyVContent;
private TextBox textBoxVContent; private TextBox textBoxVContent;
private PictureBox pictureBoxVContent; private PictureBox pictureBoxVContent;
private GroupBox groupBox5; private GroupBox groupBoxVTools;
private Button buttonBrowseVTools; private Button buttonBrowseVTools;
private Button buttonResetVTools; private Button buttonResetVTools;
private Button buttonApplyVTools; private Button buttonApplyVTools;
private TextBox textBoxVTools; private TextBox textBoxVTools;
private PictureBox pictureBoxVTools; private PictureBox pictureBoxVTools;
private ToolTip toolTip; private ToolTip toolTip;
private ToolStripMenuItem resetAllToolStripMenuItem;
private ToolStripSeparator toolStripSeparator1;
} }
} }

View File

@ -14,21 +14,24 @@ namespace SourceSDK.ENV.Editor.UI
{ {
public FormMain() public FormMain()
{ {
InitializeComponent(); InitializeComponent();
this.Text = String.Format("{0} ({1})", Application.ProductName, Application.ProductVersion); ; this.Text = String.Format("{0} ({1})", Application.ProductName, Application.ProductVersion); ;
} }
#region checks
private void checkAll() private void checkAll()
{ {
checkVMod(); checkVMod();
checkVProject(); checkVProject();
checkVGame();
checkVContent();
checkVTools();
} }
private void checkVMod() private void checkVMod()
{ {
var value = Environment.GetEnvironmentVariable("VMod", EnvironmentVariableTarget.User); var value = Environment.GetEnvironmentVariable("VMod", EnvironmentVariableTarget.User);
if (value == null) if (value == null)
{ {
textBoxVMod.Text = value;
pictureBoxVMod.Image = Properties.Resources.cancel; pictureBoxVMod.Image = Properties.Resources.cancel;
} }
else else
@ -42,6 +45,7 @@ namespace SourceSDK.ENV.Editor.UI
var value = Environment.GetEnvironmentVariable("VProject", EnvironmentVariableTarget.User); var value = Environment.GetEnvironmentVariable("VProject", EnvironmentVariableTarget.User);
if (value == null) if (value == null)
{ {
textBoxVProject.Text = value;
pictureBoxVProject.Image = Properties.Resources.cancel; pictureBoxVProject.Image = Properties.Resources.cancel;
} }
else else
@ -50,6 +54,137 @@ namespace SourceSDK.ENV.Editor.UI
pictureBoxVProject.Image = Properties.Resources.done; pictureBoxVProject.Image = Properties.Resources.done;
} }
} }
private void checkVGame()
{
var value = Environment.GetEnvironmentVariable("VGame", EnvironmentVariableTarget.User);
if (value == null)
{
textBoxVGame.Text = value;
pictureBoxVGame.Image = Properties.Resources.cancel;
}
else
{
textBoxVGame.Text = value;
pictureBoxVGame.Image = Properties.Resources.done;
}
}
private void checkVContent()
{
var value = Environment.GetEnvironmentVariable("VContent", EnvironmentVariableTarget.User);
if (value == null)
{
textBoxVContent.Text = value;
pictureBoxVContent.Image = Properties.Resources.cancel;
}
else
{
textBoxVContent.Text = value;
pictureBoxVContent.Image = Properties.Resources.done;
}
}
private void checkVTools()
{
var value = Environment.GetEnvironmentVariable("VTools", EnvironmentVariableTarget.User);
if (value == null)
{
textBoxVTools.Text = value;
pictureBoxVTools.Image = Properties.Resources.cancel;
}
else
{
textBoxVTools.Text = value;
pictureBoxVTools.Image = Properties.Resources.done;
}
}
#endregion
#region reset
private void resetAll()
{
resetVMod();
resetVProject();
resetVGame();
}
private void resetVMod()
{
try
{
pictureBoxVMod.Image = Properties.Resources.wait;
Cursor.Current = Cursors.WaitCursor;
try
{
Environment.SetEnvironmentVariable("VMod", null, EnvironmentVariableTarget.User);
checkVMod();
}
catch
{
checkVMod();
}
MessageBox.Show("VMod successfully cleared and Information updated!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Cursor.Current = Cursors.Default;
}
catch
{
MessageBox.Show("Something went wrong and VMod was not successfully deleted", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Cursor.Current = Cursors.Default;
}
}
private void resetVProject()
{
try
{
pictureBoxVMod.Image = Properties.Resources.wait;
Cursor.Current = Cursors.WaitCursor;
try
{
Environment.SetEnvironmentVariable("VProject", null, EnvironmentVariableTarget.User);
checkVProject();
}
catch
{
checkVProject();
}
MessageBox.Show("VProject successfully cleared and Information updated!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Cursor.Current = Cursors.Default;
}
catch
{
MessageBox.Show("Something went wrong and VProject was not successfully deleted", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Cursor.Current = Cursors.Default;
}
}
private void resetVGame()
{
try
{
pictureBoxVMod.Image = Properties.Resources.wait;
Cursor.Current = Cursors.WaitCursor;
try
{
Environment.SetEnvironmentVariable("VGame", null, EnvironmentVariableTarget.User);
checkVGame();
}
catch
{
checkVGame();
}
MessageBox.Show("VGame successfully cleared and Information updated!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Cursor.Current = Cursors.Default;
}
catch
{
MessageBox.Show("Something went wrong and VGame was not successfully deleted", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Cursor.Current = Cursors.Default;
}
}
#endregion
private void FormMain_Load(object sender, EventArgs e) private void FormMain_Load(object sender, EventArgs e)
{ {
@ -59,6 +194,45 @@ namespace SourceSDK.ENV.Editor.UI
private void refreshToolStripMenuItem_Click(object sender, EventArgs e) private void refreshToolStripMenuItem_Click(object sender, EventArgs e)
{ {
checkAll(); checkAll();
MessageBox.Show("Information updated!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void resetAllToolStripMenuItem_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure to reset all envs?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
resetAll();
}
}
private void buttonResetVMod_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
resetVMod();
}
}
private void buttonResetVProject_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
resetVProject();
}
}
private void buttonResetVGame_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
resetVGame();
}
} }
} }
} }