diff --git a/OWTrack/MainForm.Designer.cs b/OWTrack/MainForm.Designer.cs index ee3c09e..1e31cf7 100644 --- a/OWTrack/MainForm.Designer.cs +++ b/OWTrack/MainForm.Designer.cs @@ -126,7 +126,7 @@ this.WinBut.TabIndex = 6; this.WinBut.Text = "win"; this.WinBut.UseVisualStyleBackColor = true; - this.WinBut.Click += new System.EventHandler(this.button1_Click); + this.WinBut.Click += new System.EventHandler(this.WinBtn_Click); // // button2 // @@ -136,7 +136,7 @@ this.button2.TabIndex = 6; this.button2.Text = "loss"; this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); + this.button2.Click += new System.EventHandler(this.LossBtn_Click); // // label2 // diff --git a/OWTrack/MainForm.cs b/OWTrack/MainForm.cs index f68d026..3e19ae7 100644 --- a/OWTrack/MainForm.cs +++ b/OWTrack/MainForm.cs @@ -87,7 +87,7 @@ namespace OWTrack { if (!tr.LoacteOW()) { - getGamePath(); + tr.gamePath = getGamePath(); } return false; } @@ -99,26 +99,28 @@ namespace OWTrack } } - private void getGamePath() + private string getGamePath() { openFileDialog1.Title = "Select Overwatch.exe"; openFileDialog1.DefaultExt = "exe"; openFileDialog1.Filter = "exe Files (*.exe)|*.exe|All files (*.*)|*.*"; - openFileDialog1.CheckFileExists = true; - openFileDialog1.CheckPathExists = true; + //openFileDialog1.CheckFileExists = true; + //openFileDialog1.CheckPathExists = true; DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) { - tr.gamePath = openFileDialog1.FileName; + //tr.gamePath = openFileDialog1.FileName; + return openFileDialog1.FileName; } - else if (result == DialogResult.Cancel) + else { - Close(); + return null; + //Close(); } - FindForm(); - update(); + //Show(); + //update(); } private Tracker savedTracker() @@ -133,19 +135,16 @@ namespace OWTrack return null; } } - - private void timer1_Tick(object sender, EventArgs e) - { - checkStatus(); - } - private void button1_Click(object sender, EventArgs e) + private void timer1_Tick(object sender, EventArgs e) => checkStatus(); + + private void WinBtn_Click(object sender, EventArgs e) { tr.addWin(); update(); } - private void button2_Click(object sender, EventArgs e) + private void LossBtn_Click(object sender, EventArgs e) { tr.addLoss(); update();