working dialog
This commit is contained in:
parent
e948a1964a
commit
bc83f16ab2
1
OWTrack/Form1.Designer.cs
generated
1
OWTrack/Form1.Designer.cs
generated
@ -221,7 +221,6 @@
|
|||||||
this.openFileDialog1.FileName = "Overwatch.exe";
|
this.openFileDialog1.FileName = "Overwatch.exe";
|
||||||
this.openFileDialog1.InitialDirectory = "C:\\";
|
this.openFileDialog1.InitialDirectory = "C:\\";
|
||||||
this.openFileDialog1.RestoreDirectory = true;
|
this.openFileDialog1.RestoreDirectory = true;
|
||||||
this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk);
|
|
||||||
//
|
//
|
||||||
// Form1
|
// Form1
|
||||||
//
|
//
|
||||||
|
@ -48,11 +48,10 @@ namespace OWTrack
|
|||||||
tr.wins = savedTracker().wins;
|
tr.wins = savedTracker().wins;
|
||||||
tr.losses = savedTracker().losses;
|
tr.losses = savedTracker().losses;
|
||||||
tr.gamePath = savedTracker().gamePath;
|
tr.gamePath = savedTracker().gamePath;
|
||||||
if (tr.gamePath == "" || tr.gamePath == null)
|
//if (tr.gamePath == "" || tr.gamePath == null)
|
||||||
{
|
//{
|
||||||
openFileDialog1.Title = "Select Overwatch.exe";
|
|
||||||
openFileDialog1.ShowDialog();
|
//}
|
||||||
}
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
else MessageBox.Show("no save");
|
else MessageBox.Show("no save");
|
||||||
@ -63,7 +62,11 @@ namespace OWTrack
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (File.Exists(Directory.GetCurrentDirectory() + "/data.json")) { return true; }
|
if (File.Exists(Directory.GetCurrentDirectory() + "/data.json")) { return true; }
|
||||||
else return false;
|
else
|
||||||
|
{
|
||||||
|
getGamePath();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@ -72,6 +75,21 @@ namespace OWTrack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void getGamePath()
|
||||||
|
{
|
||||||
|
openFileDialog1.Title = "Select Overwatch.exe";
|
||||||
|
openFileDialog1.DefaultExt = "exe";
|
||||||
|
openFileDialog1.Filter = "exe Files (*.exe)|*.exe|All files (*.*)|*.*";
|
||||||
|
openFileDialog1.CheckFileExists = true;
|
||||||
|
openFileDialog1.CheckPathExists = true;
|
||||||
|
|
||||||
|
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
tr.gamePath = openFileDialog1.FileName;
|
||||||
|
MessageBox.Show(openFileDialog1.FileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Tracker savedTracker()
|
private Tracker savedTracker()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -162,10 +180,5 @@ namespace OWTrack
|
|||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openFileDialog1_FileOk(object sender, System.ComponentModel.CancelEventArgs e)
|
|
||||||
{
|
|
||||||
MessageBox.Show("ok");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user