From 76f3c0098a2d0e67675e8e5521776a2ee869d9f2 Mon Sep 17 00:00:00 2001 From: cadon Date: Mon, 18 Jul 2022 22:00:13 +0200 Subject: [PATCH 1/3] fix for species with no color information (fixes #1278) --- ARKBreedingStats/species/CreatureColored.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ARKBreedingStats/species/CreatureColored.cs b/ARKBreedingStats/species/CreatureColored.cs index 3bb3aec4..0866015b 100644 --- a/ARKBreedingStats/species/CreatureColored.cs +++ b/ARKBreedingStats/species/CreatureColored.cs @@ -35,7 +35,7 @@ internal static string SpeciesImageName(string speciesName, bool replacePolar = /// Returns the image file path to the image with the according colorization. /// private static string ColoredCreatureCacheFilePath(string speciesName, byte[] colorIds, bool listView = false) - => Path.Combine(_imgCacheFolderPath, speciesName.Substring(0, Math.Min(speciesName.Length, 5)) + "_" + Convert.ToBase64String(colorIds.Select(ci => (byte)ci).Concat(Encoding.UTF8.GetBytes(speciesName)).ToArray()).Replace('/', '-') + (listView ? "_lv" : string.Empty) + Extension); + => Path.Combine(_imgCacheFolderPath, speciesName.Substring(0, Math.Min(speciesName.Length, 5)) + "_" + Convert.ToBase64String(colorIds.Select(ci => ci).Concat(Encoding.UTF8.GetBytes(speciesName)).ToArray()).Replace('/', '-') + (listView ? "_lv" : string.Empty) + Extension); /// /// Checks if an according species image exists in the cache folder, if not it tries to creates one. Returns false if there's no image. @@ -79,7 +79,7 @@ public static Bitmap GetColoredCreature(byte[] colorIds, Species species, bool[] if (string.IsNullOrEmpty(species?.name)) onlyColors = true; else - speciesName = SpeciesImageName(species?.name); + speciesName = SpeciesImageName(species.name); if (onlyColors || string.IsNullOrEmpty(ImageFolder)) return DrawPieChart(colorIds, enabledColorRegions, size, pieSize); @@ -461,7 +461,7 @@ private static bool ApplyColorsUnsafe(byte[][] rgb, bool[] enabledColorRegions, public static string RegionColorInfo(Species species, byte[] colorIds) { - if (species == null || colorIds == null) return null; + if (species?.colors == null || colorIds == null) return null; var creatureRegionColors = new StringBuilder("Colors:"); var cs = species.colors; From 04362892b316c3b93d6ed2e842d841ee26fa7bbe Mon Sep 17 00:00:00 2001 From: cadon Date: Mon, 18 Jul 2022 22:53:18 +0200 Subject: [PATCH 2/3] fix infographic vertical text alignment of wild level --- ARKBreedingStats/library/CreatureInfoGraphic.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ARKBreedingStats/library/CreatureInfoGraphic.cs b/ARKBreedingStats/library/CreatureInfoGraphic.cs index 5c17ad2e..b4051849 100644 --- a/ARKBreedingStats/library/CreatureInfoGraphic.cs +++ b/ARKBreedingStats/library/CreatureInfoGraphic.cs @@ -73,6 +73,7 @@ public static Bitmap InfoGraphic(this Creature creature, CreatureCollection cc, using (var fontBrush = new SolidBrush(foreColor)) using (var borderAroundColors = new Pen(Utils.ForeColor(backColor), 1)) using (var stringFormatRight = new StringFormat { Alignment = StringAlignment.Far }) + using (var stringFormatRightUp = new StringFormat { Alignment = StringAlignment.Far, LineAlignment = StringAlignment.Far }) { g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; int currentYPosition = frameThickness * 3; @@ -288,7 +289,7 @@ public static Bitmap InfoGraphic(this Creature creature, CreatureCollection cc, if (cc != null && displayMaxWildLevel) { g.DrawString($"{Loc.S("max wild level")}: {cc.maxWildLevel}", - fontSmall, fontBrush, width - 2 * frameThickness, height - fontSizeSmall - 4 * frameThickness, stringFormatRight); + fontSmall, fontBrush, width - 2 * frameThickness, height - frameThickness, stringFormatRightUp); } // frame From 7cfadd687ee5f281b65b135113b265fa9371461f Mon Sep 17 00:00:00 2001 From: cadon Date: Mon, 18 Jul 2022 23:04:20 +0200 Subject: [PATCH 3/3] ver --- ARKBreedingStats/Properties/AssemblyInfo.cs | 2 +- ARKBreedingStats/_manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index accc1dca..541076c0 100644 --- a/ARKBreedingStats/Properties/AssemblyInfo.cs +++ b/ARKBreedingStats/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // Revision // [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.50.1.1")] +[assembly: AssemblyFileVersion("0.50.1.2")] [assembly: NeutralResourcesLanguage("en")] diff --git a/ARKBreedingStats/_manifest.json b/ARKBreedingStats/_manifest.json index d9a51759..fe3c9d81 100644 --- a/ARKBreedingStats/_manifest.json +++ b/ARKBreedingStats/_manifest.json @@ -4,7 +4,7 @@ "ARK Smart Breeding": { "Id": "ARK Smart Breeding", "Category": "main", - "version": "0.50.1.1" + "version": "0.50.1.2" }, "SpeciesColorImages": { "Id": "SpeciesColorImages",