Solving #29 & #28 #30

Merged
Hesham merged 3 commits from release/1.4.2 into master 2018-11-24 01:34:44 +01:00
3 changed files with 11 additions and 19 deletions

View File

@ -28,19 +28,21 @@ namespace OWTrack
{ {
public partial class MainForm : Form public partial class MainForm : Form
{ {
Tracker tr = new Tracker(); Tracker tr;
private const string IS_RUNNING = "Running"; private const string IS_RUNNING = "Running";
private const string NOT_RUNNING = " Not running"; private const string NOT_RUNNING = " Not running";
private bool SRonce = false; private bool SRonce = false;
int dummy = 0;
public MainForm() public MainForm()
{ {
InitializeComponent(); InitializeComponent();
tr = new Tracker();
loadSave(); loadSave();
checkStatus(); checkStatus();
update(); update();
label4.Text = Program.Version.ToString(); label4.Text = Program.Version.ToString();
Text = "OWTrack " + Program.Version.ToString(); Text = "OWTrack " + Program.Version.ToString();
} }
private void checkStatus() private void checkStatus()
@ -90,17 +92,16 @@ namespace OWTrack
if (line.Contains("Overwatch.exe")) if (line.Contains("Overwatch.exe"))
{ {
tr = saveManeger.GetSavedTracker(); tr = saveManeger.GetSavedTracker();
st.Close(); if (tr.startSR > 0) SRonce = true;
} }
else else
{ {
if (!tr.LoacteOW()) if (!tr.LoacteOW())
{ {
tr.gamePath = getGamePath(); tr.gamePath = getGamePath();
} }
st.Close();
} }
st.Close();
} }
} }
catch (Exception e) catch (Exception e)
@ -123,16 +124,12 @@ namespace OWTrack
openFileDialog1.DefaultExt = "exe"; openFileDialog1.DefaultExt = "exe";
openFileDialog1.Filter = "exe Files (*.exe)|*.exe|All files (*.*)|*.*"; openFileDialog1.Filter = "exe Files (*.exe)|*.exe|All files (*.*)|*.*";
DialogResult result = openFileDialog1.ShowDialog(); DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK) if (result == DialogResult.OK)
{ {
MessageBox.Show("Saved Overwatch.exe location.\nPress Clear to rest"); MessageBox.Show("Saved Overwatch.exe location.\nPress Clear to rest");
return openFileDialog1.FileName; return openFileDialog1.FileName;
} }
else else return null;
{
return null;
}
} }
private void SRSystem(bool state) private void SRSystem(bool state)
@ -246,9 +243,6 @@ namespace OWTrack
tr.gamePath = getGamePath(); tr.gamePath = getGamePath();
update(); update();
} }
#endregion #endregion
} }
} }

View File

@ -18,7 +18,7 @@ namespace OWTrack
Application.Run(new MainForm()); Application.Run(new MainForm());
} }
public static string Version { get; } = "1.4.1"; public static string Version { get; } = "1.4.2-a0";
//public static string Version = Application.ProductVersion; //public static string Version = Application.ProductVersion;
//public static Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; //public static Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

View File

@ -109,9 +109,7 @@ namespace OWTrack
gamePath = paths[0]; gamePath = paths[0];
return true; return true;
} }
else return false;
else return false;
} }
catch (Exception e) catch (Exception e)
{ {