From 77fefa6812e5d7d219c140e6867cdb35b9a2b464 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Thu, 16 Aug 2018 07:50:08 +0300 Subject: [PATCH 1/9] optimize OW status --- OWTrack/Form1.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/OWTrack/Form1.cs b/OWTrack/Form1.cs index f00e742..d59616c 100644 --- a/OWTrack/Form1.cs +++ b/OWTrack/Form1.cs @@ -23,20 +23,17 @@ namespace OWTrack } private void checkStatus() - { + { + Time.Text = DateTime.Now.ToString("h:mm tt"); + status.Text = NOT_RUNNING; + status.ForeColor = Color.Red; try - { - Time.Text = DateTime.Now.ToString("h:mm tt"); + { if (tr.owRunning()) { status.Text = IS_RUNNING; status.ForeColor = Color.FromArgb(128, 255, 128); - } - else - { - status.Text = NOT_RUNNING; - status.ForeColor = Color.Red; - } + } } catch (Exception e) { -- 2.39.5 From 790e1325d61de655a0df9aeb156919024494dbd5 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Thu, 16 Aug 2018 07:52:12 +0300 Subject: [PATCH 2/9] changes timer interval --- OWTrack/Form1.Designer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OWTrack/Form1.Designer.cs b/OWTrack/Form1.Designer.cs index 7058f7e..a125286 100644 --- a/OWTrack/Form1.Designer.cs +++ b/OWTrack/Form1.Designer.cs @@ -70,7 +70,7 @@ // timer1 // this.timer1.Enabled = true; - this.timer1.Interval = 3000; + this.timer1.Interval = 6000; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // Time -- 2.39.5 From 25d0789e766b95f2d55fccd4806df10f074339ec Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Thu, 16 Aug 2018 08:34:30 +0300 Subject: [PATCH 3/9] Assembly info --- OWTrack/Form1.cs | 4 ++-- OWTrack/OWTrack.csproj | 20 +++++++++++++++++--- OWTrack/Program.cs | 17 ++++++++++++++--- OWTrack/Properties/AssemblyInfo.cs | 8 +++++--- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/OWTrack/Form1.cs b/OWTrack/Form1.cs index d59616c..a940c78 100644 --- a/OWTrack/Form1.cs +++ b/OWTrack/Form1.cs @@ -18,8 +18,8 @@ namespace OWTrack InitializeComponent(); loadSave(); checkStatus(); - label4.Text = Program.Version; - Text = "OWTrack " + Program.Version; + label4.Text = Program.Version.ToString(); + Text = "OWTrack " + Program.Version.ToString(); } private void checkStatus() diff --git a/OWTrack/OWTrack.csproj b/OWTrack/OWTrack.csproj index 91f8bc3..15c722e 100644 --- a/OWTrack/OWTrack.csproj +++ b/OWTrack/OWTrack.csproj @@ -11,6 +11,7 @@ v4.6.1 512 true + false publish\ true Disk @@ -21,10 +22,10 @@ false false true - 0 - 1.0.0.%2a - false + 12 + 1.2.3.%2a false + true true @@ -67,6 +68,18 @@ MinimumRecommendedRules.ruleset true + + 120F37EDC91FF77172D31673046260B265C70C5D + + + OWTrack_TemporaryKey.pfx + + + true + + + true + ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll @@ -105,6 +118,7 @@ True Resources.resx + SettingsSingleFileGenerator diff --git a/OWTrack/Program.cs b/OWTrack/Program.cs index 9dfd33f..5f9eea6 100644 --- a/OWTrack/Program.cs +++ b/OWTrack/Program.cs @@ -1,14 +1,17 @@ using System; using System.Collections.Generic; +using System.Deployment.Application; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; +using System.Deployment.Application; + namespace OWTrack { static class Program - { - public static string Version = "1.2.3"; + { + //public static string Version = Application.ProductVersion; /// /// The main entry point for the application. /// @@ -19,6 +22,14 @@ namespace OWTrack Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } - + private static Version version = new Version(Application.ProductVersion); + + public static Version Version + { + get + { + return version; + } + } } } diff --git a/OWTrack/Properties/AssemblyInfo.cs b/OWTrack/Properties/AssemblyInfo.cs index b13bdd9..e95da8b 100644 --- a/OWTrack/Properties/AssemblyInfo.cs +++ b/OWTrack/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("OWTrack")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("Hesham Systems LLC")] [assembly: AssemblyProduct("OWTrack")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] @@ -33,7 +33,9 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +//[assembly: AssemblyVersion("1.0.0.0")] +//[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: NeutralResourcesLanguage("")] +[assembly: AssemblyVersion("1.2.3")] +[assembly: AssemblyFileVersion("1.2.3")] -- 2.39.5 From e5b0fcf173cd456a9cdc0a84f7fe4fc8ab243e40 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Fri, 31 Aug 2018 19:32:44 +0300 Subject: [PATCH 4/9] Assembly info 2 --- OWTrack/Form1.cs | 4 ++-- OWTrack/Program.cs | 10 +--------- OWTrack/Properties/AssemblyInfo.cs | 5 +++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/OWTrack/Form1.cs b/OWTrack/Form1.cs index a940c78..c5cedea 100644 --- a/OWTrack/Form1.cs +++ b/OWTrack/Form1.cs @@ -18,8 +18,8 @@ namespace OWTrack InitializeComponent(); loadSave(); checkStatus(); - label4.Text = Program.Version.ToString(); - Text = "OWTrack " + Program.Version.ToString(); + label4.Text = Program.version.ToString(); + Text = "OWTrack " + Program.version.ToString(); } private void checkStatus() diff --git a/OWTrack/Program.cs b/OWTrack/Program.cs index 5f9eea6..845a11e 100644 --- a/OWTrack/Program.cs +++ b/OWTrack/Program.cs @@ -22,14 +22,6 @@ namespace OWTrack Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } - private static Version version = new Version(Application.ProductVersion); - - public static Version Version - { - get - { - return version; - } - } + public static Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; } } diff --git a/OWTrack/Properties/AssemblyInfo.cs b/OWTrack/Properties/AssemblyInfo.cs index e95da8b..657d72d 100644 --- a/OWTrack/Properties/AssemblyInfo.cs +++ b/OWTrack/Properties/AssemblyInfo.cs @@ -35,7 +35,8 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] //[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("2.0.*")] +[assembly: AssemblyFileVersion("1.0.*")] [assembly: NeutralResourcesLanguage("")] -[assembly: AssemblyVersion("1.2.3")] -[assembly: AssemblyFileVersion("1.2.3")] + -- 2.39.5 From e948a1964a07625169e98979987c6949d40a4408 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Fri, 31 Aug 2018 20:17:26 +0300 Subject: [PATCH 5/9] openFileDialog --- OWTrack/Form1.Designer.cs | 9 +++++++++ OWTrack/Form1.cs | 11 +++++++++++ OWTrack/Form1.resx | 3 +++ OWTrack/Tracker.cs | 4 +++- 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/OWTrack/Form1.Designer.cs b/OWTrack/Form1.Designer.cs index a125286..39a2946 100644 --- a/OWTrack/Form1.Designer.cs +++ b/OWTrack/Form1.Designer.cs @@ -46,6 +46,7 @@ this.srTextBox = new System.Windows.Forms.TextBox(); this.srBut = new System.Windows.Forms.Button(); this.srLabel = new System.Windows.Forms.Label(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.SuspendLayout(); // // label1 @@ -215,6 +216,13 @@ this.srLabel.TabIndex = 13; this.srLabel.Text = "0"; // + // openFileDialog1 + // + this.openFileDialog1.FileName = "Overwatch.exe"; + this.openFileDialog1.InitialDirectory = "C:\\"; + this.openFileDialog1.RestoreDirectory = true; + this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -265,6 +273,7 @@ private System.Windows.Forms.TextBox srTextBox; private System.Windows.Forms.Button srBut; private System.Windows.Forms.Label srLabel; + private System.Windows.Forms.OpenFileDialog openFileDialog1; } } diff --git a/OWTrack/Form1.cs b/OWTrack/Form1.cs index c5cedea..237cfed 100644 --- a/OWTrack/Form1.cs +++ b/OWTrack/Form1.cs @@ -47,6 +47,12 @@ namespace OWTrack { tr.wins = savedTracker().wins; tr.losses = savedTracker().losses; + tr.gamePath = savedTracker().gamePath; + if (tr.gamePath == "" || tr.gamePath == null) + { + openFileDialog1.Title = "Select Overwatch.exe"; + openFileDialog1.ShowDialog(); + } update(); } else MessageBox.Show("no save"); @@ -156,5 +162,10 @@ namespace OWTrack } update(); } + + private void openFileDialog1_FileOk(object sender, System.ComponentModel.CancelEventArgs e) + { + MessageBox.Show("ok"); + } } } diff --git a/OWTrack/Form1.resx b/OWTrack/Form1.resx index 1f666f2..5ec8f10 100644 --- a/OWTrack/Form1.resx +++ b/OWTrack/Form1.resx @@ -120,4 +120,7 @@ 17, 17 + + 104, 17 + \ No newline at end of file diff --git a/OWTrack/Tracker.cs b/OWTrack/Tracker.cs index afdfe43..5f3ca97 100644 --- a/OWTrack/Tracker.cs +++ b/OWTrack/Tracker.cs @@ -8,6 +8,7 @@ namespace OWTrack class Tracker { public int wins, losses, startSR, newSR = 0; + public string gamePath; public void Track() { } public void reset() { wins = 0; losses = 0; startSR = 0; newSR = 0; } @@ -20,12 +21,13 @@ namespace OWTrack public void setNewSR(int SR) { newSR = SR; } public int srDiff() { return newSR - startSR; } + public bool owRunning() { try { bool isRunning = Process.GetProcessesByName("Overwatch") - .FirstOrDefault(p => p.MainModule.FileName.StartsWith(@"D:\Hesham\installed Games\Overwatch")) != default(Process); + .FirstOrDefault(p => p.MainModule.FileName.StartsWith(gamePath)) != default(Process); return isRunning; } catch (Exception e) -- 2.39.5 From bc83f16ab231ac9a775eea90f6c67821a0d1978c Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Fri, 31 Aug 2018 20:56:47 +0300 Subject: [PATCH 6/9] working dialog --- OWTrack/Form1.Designer.cs | 1 - OWTrack/Form1.cs | 39 ++++++++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/OWTrack/Form1.Designer.cs b/OWTrack/Form1.Designer.cs index 39a2946..e7c457c 100644 --- a/OWTrack/Form1.Designer.cs +++ b/OWTrack/Form1.Designer.cs @@ -221,7 +221,6 @@ this.openFileDialog1.FileName = "Overwatch.exe"; this.openFileDialog1.InitialDirectory = "C:\\"; this.openFileDialog1.RestoreDirectory = true; - this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk); // // Form1 // diff --git a/OWTrack/Form1.cs b/OWTrack/Form1.cs index 237cfed..6224511 100644 --- a/OWTrack/Form1.cs +++ b/OWTrack/Form1.cs @@ -48,22 +48,25 @@ namespace OWTrack tr.wins = savedTracker().wins; tr.losses = savedTracker().losses; tr.gamePath = savedTracker().gamePath; - if (tr.gamePath == "" || tr.gamePath == null) - { - openFileDialog1.Title = "Select Overwatch.exe"; - openFileDialog1.ShowDialog(); - } + //if (tr.gamePath == "" || tr.gamePath == null) + //{ + + //} update(); } else MessageBox.Show("no save"); - } + } private bool saveExist() { try { if (File.Exists(Directory.GetCurrentDirectory() + "/data.json")) { return true; } - else return false; + else + { + getGamePath(); + return false; + } } 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() { try @@ -161,11 +179,6 @@ namespace OWTrack else tr.newSR = sr; } update(); - } - - private void openFileDialog1_FileOk(object sender, System.ComponentModel.CancelEventArgs e) - { - MessageBox.Show("ok"); - } + } } } -- 2.39.5 From d6c9b23f19b8355ce368bed2910862aa93d6d019 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Sat, 1 Sep 2018 14:11:08 +0300 Subject: [PATCH 7/9] finalized exe Track --- OWTrack/Form1.cs | 16 ++++++++-------- OWTrack/OWTrack.csproj | 2 +- OWTrack/Program.cs | 7 +++++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/OWTrack/Form1.cs b/OWTrack/Form1.cs index 6224511..6e598b1 100644 --- a/OWTrack/Form1.cs +++ b/OWTrack/Form1.cs @@ -18,17 +18,18 @@ namespace OWTrack InitializeComponent(); loadSave(); checkStatus(); - label4.Text = Program.version.ToString(); - Text = "OWTrack " + Program.version.ToString(); + update(); + label4.Text = Program.Version.ToString(); + Text = "OWTrack " + Program.Version.ToString(); } private void checkStatus() - { - Time.Text = DateTime.Now.ToString("h:mm tt"); - status.Text = NOT_RUNNING; - status.ForeColor = Color.Red; + { try { + Time.Text = DateTime.Now.ToString("h:mm tt"); + status.Text = NOT_RUNNING; + status.ForeColor = Color.Red; if (tr.owRunning()) { status.Text = IS_RUNNING; @@ -75,7 +76,7 @@ namespace OWTrack } } - void getGamePath() + private void getGamePath() { openFileDialog1.Title = "Select Overwatch.exe"; openFileDialog1.DefaultExt = "exe"; @@ -86,7 +87,6 @@ namespace OWTrack if (openFileDialog1.ShowDialog() == DialogResult.OK) { tr.gamePath = openFileDialog1.FileName; - MessageBox.Show(openFileDialog1.FileName); } } diff --git a/OWTrack/OWTrack.csproj b/OWTrack/OWTrack.csproj index 15c722e..e87106e 100644 --- a/OWTrack/OWTrack.csproj +++ b/OWTrack/OWTrack.csproj @@ -22,7 +22,7 @@ false false true - 12 + 13 1.2.3.%2a false true diff --git a/OWTrack/Program.cs b/OWTrack/Program.cs index 845a11e..13aad28 100644 --- a/OWTrack/Program.cs +++ b/OWTrack/Program.cs @@ -11,7 +11,6 @@ namespace OWTrack { static class Program { - //public static string Version = Application.ProductVersion; /// /// The main entry point for the application. /// @@ -22,6 +21,10 @@ namespace OWTrack Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } - public static Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + + public static string Version = "1.2.3"; + //public static string Version = Application.ProductVersion; + //public static Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + } } -- 2.39.5 From 36018b35dac91f1c095d21e293b067c05733dfee Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Sat, 1 Sep 2018 14:14:31 +0300 Subject: [PATCH 8/9] load SR from JSON --- OWTrack/Form1.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OWTrack/Form1.cs b/OWTrack/Form1.cs index c5cedea..2ea0ef3 100644 --- a/OWTrack/Form1.cs +++ b/OWTrack/Form1.cs @@ -47,6 +47,8 @@ namespace OWTrack { tr.wins = savedTracker().wins; tr.losses = savedTracker().losses; + tr.newSR = savedTracker().newSR; + tr.startSR = savedTracker().startSR; update(); } else MessageBox.Show("no save"); -- 2.39.5 From f4e8ca73cf7994c7e4187fb3c859691fe781a359 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Sat, 1 Sep 2018 14:25:19 +0300 Subject: [PATCH 9/9] Version bump --- OWTrack/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OWTrack/Program.cs b/OWTrack/Program.cs index 13aad28..12db818 100644 --- a/OWTrack/Program.cs +++ b/OWTrack/Program.cs @@ -22,7 +22,7 @@ namespace OWTrack Application.Run(new Form1()); } - public static string Version = "1.2.3"; + public static string Version = "1.2.4"; //public static string Version = Application.ProductVersion; //public static Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; -- 2.39.5