Added configurable PokeUi image size

Detective Squirrel [2016-07-29 12:57:30]
Added configurable PokeUi image size

Ranges from 1x1 - 96x96
Filename
PokemonGo/RocketAPI/Console/Settings.cs
PokemonGo/RocketAPI/ISettings.cs
PokemonGo/RocketAPI/Window/App.config
PokemonGo/RocketAPI/Window/PokeUi.cs
PokemonGo/RocketAPI/Window/Settings.cs
PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
PokemonGo/RocketAPI/Window/SettingsForm.cs
diff --git a/PokemonGo/RocketAPI/Console/Settings.cs b/PokemonGo/RocketAPI/Console/Settings.cs
index 78dddbb..b63ca69 100644
--- a/PokemonGo/RocketAPI/Console/Settings.cs
+++ b/PokemonGo/RocketAPI/Console/Settings.cs
@@ -21,6 +21,7 @@ namespace PokemonGo.RocketAPI.Console
         public int TransferCPThreshold => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 0;
         public int TransferIVThreshold => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 0;
         public int TravelSpeed => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 60;
+        public int ImageSize => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 50;
         public bool EvolveAllGivenPokemons => GetSetting() != string.Empty ? System.Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture) : false;
         public bool CatchPokemon => GetSetting() != string.Empty ? System.Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture) : false;

diff --git a/PokemonGo/RocketAPI/ISettings.cs b/PokemonGo/RocketAPI/ISettings.cs
index be51673..edec062 100644
--- a/PokemonGo/RocketAPI/ISettings.cs
+++ b/PokemonGo/RocketAPI/ISettings.cs
@@ -25,6 +25,7 @@ namespace PokemonGo.RocketAPI
         int TransferCPThreshold { get; }
         int TransferIVThreshold { get; }
         int TravelSpeed { get; }
+        int ImageSize { get; }
         bool Recycler { get; }
         ICollection<KeyValuePair<AllEnum.ItemId, int>> ItemRecycleFilter { get; }
         int RecycleItemsInterval { get; }
diff --git a/PokemonGo/RocketAPI/Window/App.config b/PokemonGo/RocketAPI/Window/App.config
index 754e03d..a3cf5c7 100644
--- a/PokemonGo/RocketAPI/Window/App.config
+++ b/PokemonGo/RocketAPI/Window/App.config
@@ -49,6 +49,8 @@
     <!--transfer pokemon with IV less than this value if iv transfer type is selected. Whitelist in Program.cs-->
     <add key="TravelSpeed" value="60"/>
     <!--The speed to travel in km/h-->
+    <add key="ImageSize" value="50"/>
+    <!--PokeUi image size-->
     <add key="CatchPokemon" value="true"/>
     <!--Only visit pokestop and collect items-->
     <add key="EvolveAllGivenPokemons" value="false" />
diff --git a/PokemonGo/RocketAPI/Window/PokeUi.cs b/PokemonGo/RocketAPI/Window/PokeUi.cs
index 5fda9aa..fd439ca 100644
--- a/PokemonGo/RocketAPI/Window/PokeUi.cs
+++ b/PokemonGo/RocketAPI/Window/PokeUi.cs
@@ -63,8 +63,13 @@ namespace PokemonGo.RocketAPI.Window



+                var imageSize = ClientSettings.ImageSize;

-                var imageList = new ImageList { ImageSize = new Size(50, 50) };
+                if ((imageSize > 96) || (imageSize < 1)) // no bigger than orig size and no smaller than 1x1
+                    imageSize = 50;
+
+                var imageList = new ImageList { ImageSize = new Size(imageSize, imageSize) };
+                //var imageList = new ImageList { ImageSize = new Size(96, 96) };
                 listView1.ShowItemToolTips = true;

                 foreach (var pokemon in pokemons)
diff --git a/PokemonGo/RocketAPI/Window/Settings.cs b/PokemonGo/RocketAPI/Window/Settings.cs
index 949297d..9f238c2 100644
--- a/PokemonGo/RocketAPI/Window/Settings.cs
+++ b/PokemonGo/RocketAPI/Window/Settings.cs
@@ -47,6 +47,7 @@ namespace PokemonGo.RocketAPI.Window
         public int TransferCPThreshold => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 0;
         public int TransferIVThreshold => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 0;
         public int TravelSpeed => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 60;
+        public int ImageSize => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 50;
         public bool EvolveAllGivenPokemons => GetSetting() != string.Empty && Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture);
         public bool CatchPokemon => GetSetting() != string.Empty && Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture);

diff --git a/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs b/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
index 0501dce..9d34f6d 100644
--- a/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
+++ b/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
@@ -65,6 +65,8 @@
             this.EmailPasswordText = new System.Windows.Forms.Label();
             this.EmailLoginBox = new System.Windows.Forms.TextBox();
             this.EmailPasswordBox = new System.Windows.Forms.TextBox();
+            this.label7 = new System.Windows.Forms.Label();
+            this.ImageSizeBox = new System.Windows.Forms.TextBox();
             this.groupBox1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
             this.panel1.SuspendLayout();
@@ -344,6 +346,8 @@
             //
             // panel1
             //
+            this.panel1.Controls.Add(this.label7);
+            this.panel1.Controls.Add(this.ImageSizeBox);
             this.panel1.Controls.Add(this.EmailLoginText);
             this.panel1.Controls.Add(this.CatchPokemonBox);
             this.panel1.Controls.Add(this.EmailPasswordText);
@@ -404,7 +408,7 @@
             //
             // transferIVThresText
             //
-            this.transferIVThresText.Location = new System.Drawing.Point(104, 246);
+            this.transferIVThresText.Location = new System.Drawing.Point(104, 220);
             this.transferIVThresText.Name = "transferIVThresText";
             this.transferIVThresText.Size = new System.Drawing.Size(100, 20);
             this.transferIVThresText.TabIndex = 24;
@@ -430,7 +434,7 @@
             // label6
             //
             this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(3, 246);
+            this.label6.Location = new System.Drawing.Point(3, 220);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(70, 13);
             this.label6.TabIndex = 21;
@@ -469,6 +473,22 @@
             this.EmailPasswordBox.Size = new System.Drawing.Size(136, 20);
             this.EmailPasswordBox.TabIndex = 30;
             //
+            // label7
+            //
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(3, 249);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(100, 13);
+            this.label7.TabIndex = 32;
+            this.label7.Text = "PokeUi Image Size:";
+            //
+            // ImageSizeBox
+            //
+            this.ImageSizeBox.Location = new System.Drawing.Point(104, 246);
+            this.ImageSizeBox.Name = "ImageSizeBox";
+            this.ImageSizeBox.Size = new System.Drawing.Size(100, 20);
+            this.ImageSizeBox.TabIndex = 31;
+            //
             // SettingsForm
             //
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -533,5 +553,7 @@
         private System.Windows.Forms.Label EmailPasswordText;
         private System.Windows.Forms.TextBox EmailLoginBox;
         private System.Windows.Forms.TextBox EmailPasswordBox;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.TextBox ImageSizeBox;
     }
 }
diff --git a/PokemonGo/RocketAPI/Window/SettingsForm.cs b/PokemonGo/RocketAPI/Window/SettingsForm.cs
index 70bc0f8..000e498 100644
--- a/PokemonGo/RocketAPI/Window/SettingsForm.cs
+++ b/PokemonGo/RocketAPI/Window/SettingsForm.cs
@@ -22,6 +22,7 @@ namespace PokemonGo.RocketAPI.Window

         private void SettingsForm_Load(object sender, EventArgs e)
         {
+
             authTypeCb.Text = Settings.Instance.AuthType.ToString();
             ptcUserText.Text = Settings.Instance.PtcUsername.ToString();
             ptcPassText.Text = Settings.Instance.PtcPassword.ToString();
@@ -37,6 +38,7 @@ namespace PokemonGo.RocketAPI.Window
             evolveAllChk.Checked = Settings.Instance.EvolveAllGivenPokemons;
             CatchPokemonBox.Checked = Settings.Instance.CatchPokemon;
             TravelSpeedBox.Text = Settings.Instance.TravelSpeed.ToString();
+            ImageSizeBox.Text = Settings.Instance.ImageSize.ToString();
             // Initialize map:
             //use google provider
             gMapControl1.MapProvider = GoogleMapProvider.Instance;
@@ -87,6 +89,7 @@ namespace PokemonGo.RocketAPI.Window
             Settings.Instance.SetSetting(transferCpThresText.Text, "TransferCPThreshold");
             Settings.Instance.SetSetting(transferIVThresText.Text, "TransferIVThreshold");
             Settings.Instance.SetSetting(TravelSpeedBox.Text, "TravelSpeed");
+            Settings.Instance.SetSetting(ImageSizeBox.Text, "ImageSize");
             Settings.Instance.SetSetting(evolveAllChk.Checked ? "true" : "false", "EvolveAllGivenPokemons");
             Settings.Instance.SetSetting(CatchPokemonBox.Checked ? "true" : "false", "CatchPokemon");
             Settings.Instance.Reload();
You may download the files in Public Git.