Dynamic title to display version

Brian [2016-08-16 16:56:52]
Dynamic title to display version
Filename
PokemonGo.RocketBot.Window/Forms/MainForm.cs
PokemonGo.RocketBot.Window/Forms/MainForm.designer.cs
diff --git a/PokemonGo.RocketBot.Window/Forms/MainForm.cs b/PokemonGo.RocketBot.Window/Forms/MainForm.cs
index c3f7e19..b468f88 100644
--- a/PokemonGo.RocketBot.Window/Forms/MainForm.cs
+++ b/PokemonGo.RocketBot.Window/Forms/MainForm.cs
@@ -57,7 +57,6 @@ namespace PokemonGo.RocketBot.Window.Forms
         private readonly GMapOverlay _searchAreaOverlay = new GMapOverlay("areas");
         private ConsoleLogger _logger;
         private StateMachine _machine;
-        private List<FortData> _pokeStops;
         private GlobalSettings _settings;

         public MainForm()
@@ -69,6 +68,7 @@ namespace PokemonGo.RocketBot.Window.Forms

         private void MainForm_Load(object sender, EventArgs e)
         {
+            Text = @"[RocketBot] " + Assembly.GetExecutingAssembly().GetName().Version;
             InitializeBot();
             InitializePokemonForm();
             InitializeMap();
@@ -152,26 +152,6 @@ namespace PokemonGo.RocketBot.Window.Forms
                 menuStrip1.ShowItemToolTips = true;
                 startStopBotToolStripMenuItem.ToolTipText = @"Please goto settings and enter your basic info";
                 return;
-                /** if (GlobalSettings.PromptForSetup(session.Translation) && !settings.isGui)
-                {
-                    session = GlobalSettings.SetupSettings(session, settings, configFile);
-
-                    if (!settings.isGui)
-                    {
-                        var fileName = Assembly.GetExecutingAssembly().Location;
-                        System.Diagnostics.Process.Start(fileName);
-                        Environment.Exit(0);
-                    }
-                }
-                else
-                {
-                    GlobalSettings.Load(subPath);
-
-                    Logger.Write("Press a Key to continue...",
-                        LogLevel.Warning);
-                    Console.ReadKey();
-                    return;
-                } **/
             }
             _session.Client.ApiFailure = new ApiFailureStrategy(_session);

@@ -217,15 +197,16 @@ namespace PokemonGo.RocketBot.Window.Forms
             RouteOptimizeUtil.RouteOptimizeEvent +=
                 optimizedroute =>
                     _session.EventDispatcher.Send(new OptimizeRouteEvent { OptimizedRoute = optimizedroute });
-            RouteOptimizeUtil.RouteOptimizeEvent += Visualize;
+            RouteOptimizeUtil.RouteOptimizeEvent += InitializePokestopsAndRoute;

             FarmPokestopsTask.LootPokestopEvent +=
                 pokestop => _session.EventDispatcher.Send(new LootPokestopEvent { Pokestop = pokestop });
-            FarmPokestopsTask.LootPokestopEvent += Update;
+            FarmPokestopsTask.LootPokestopEvent += UpdateMap;
         }

         private async Task StartBot()
         {
+            this.startStopBotToolStripMenuItem.Enabled = false;
             _machine.AsyncStart(new VersionCheckState(), _session);

             if (_settings.UseTelegramAPI)
@@ -238,7 +219,7 @@ namespace PokemonGo.RocketBot.Window.Forms
             QuitEvent.WaitOne();
         }

-        private async void Visualize(List<FortData> pokeStops)
+        private async void InitializePokestopsAndRoute(List<FortData> pokeStops)
         {
             _pokestopsOverlay.Markers.Clear();
             var routePoint =
@@ -260,7 +241,7 @@ namespace PokemonGo.RocketBot.Window.Forms

         }

-        private new void Update(FortData pokestop = null)
+        private new void UpdateMap(FortData pokestop = null)
         {
             SynchronizationContext.Post(o =>
             {
@@ -299,7 +280,7 @@ namespace PokemonGo.RocketBot.Window.Forms
             var latlng = new PointLatLng(lat, lng);
             _playerLocations.Add(latlng);
             _playerMarker.Position = latlng;
-            Update();
+            UpdateMap();
             SaveLocationToDisk(lat, lng);
         }

diff --git a/PokemonGo.RocketBot.Window/Forms/MainForm.designer.cs b/PokemonGo.RocketBot.Window/Forms/MainForm.designer.cs
index 589fa3b..3d8f6f5 100644
--- a/PokemonGo.RocketBot.Window/Forms/MainForm.designer.cs
+++ b/PokemonGo.RocketBot.Window/Forms/MainForm.designer.cs
@@ -132,9 +132,11 @@ namespace PokemonGo.RocketBot.Window.Forms
             //
             // todoToolStripMenuItem
             //
+            this.todoToolStripMenuItem.Enabled = false;
             this.todoToolStripMenuItem.Name = "todoToolStripMenuItem";
-            this.todoToolStripMenuItem.Size = new System.Drawing.Size(66, 21);
-            this.todoToolStripMenuItem.Text = "Settings";
+            this.todoToolStripMenuItem.Size = new System.Drawing.Size(540, 21);
+            this.todoToolStripMenuItem.Text = "Settings (Not finish yet, please go to the config folder and set your information" +
+    " manually)";
             this.todoToolStripMenuItem.Click += new System.EventHandler(this.todoToolStripMenuItem_Click);
             //
             // showAllToolStripMenuItem
@@ -439,7 +441,7 @@ namespace PokemonGo.RocketBot.Window.Forms
             this.MainMenuStrip = this.menuStrip1;
             this.Name = "MainForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "PokemonGo Rocket API";
+            this.Text = "RocketBot";
             this.Load += new System.EventHandler(this.MainForm_Load);
             this.statusStrip1.ResumeLayout(false);
             this.statusStrip1.PerformLayout();
You may download the files in Public Git.