diff --git a/FModel/MainWindow.cs b/FModel/MainWindow.cs index c36a4344..7955bfb9 100644 --- a/FModel/MainWindow.cs +++ b/FModel/MainWindow.cs @@ -969,6 +969,7 @@ namespace FModel case "FortConditionalResourceItemDefinition": case "FortAwardItemDefinition": case "FortChallengeBundleScheduleDefinition": + case "FortAbilityKit": CreateItemIcon(AssetArray[0]); break; case "FortChallengeBundleItemDefinition": diff --git a/FModel/Methods/IconGenerator/ItemGenerator/DrawText.cs b/FModel/Methods/IconGenerator/ItemGenerator/DrawText.cs index fc750486..9fba0fb8 100644 --- a/FModel/Methods/IconGenerator/ItemGenerator/DrawText.cs +++ b/FModel/Methods/IconGenerator/ItemGenerator/DrawText.cs @@ -309,25 +309,48 @@ namespace FModel JToken description = theItem["Description"]; if (description != null) { - JToken key = description["key"]; - JToken sourceString = description["source_string"]; - if (key != null && sourceString != null) + string descriptionText = string.Empty; + + if (theItem["export_type"].Value().Equals("FortAbilityKit")) { - //myGraphic.DrawRectangle(new Pen(new SolidBrush(Color.Pink)), new Rectangle(5, 455, 512, 42)); - - string text = SearchResource.getTextByKey(key.Value(), sourceString.Value()); - - if (!string.IsNullOrEmpty(CosmeticSet)) + JArray descriptionArray = theItem["Description"].Value(); + foreach (JToken token in descriptionArray) { - string theSet = DrawCosmeticSet(CosmeticSet); - if (!string.IsNullOrEmpty(theSet)) + JToken key = token["key"]; + JToken sourceString = token["source_string"]; + if (key != null && sourceString != null) { - text += theSet; + string text = SearchResource.getTextByKey(key.Value(), sourceString.Value()); + descriptionText += text; } } + } + else + { + JToken key = description["key"]; + JToken sourceString = description["source_string"]; + if (key != null && sourceString != null) + { + //myGraphic.DrawRectangle(new Pen(new SolidBrush(Color.Pink)), new Rectangle(5, 455, 512, 42)); + string text = SearchResource.getTextByKey(key.Value(), sourceString.Value()); + descriptionText = text; + + if (!string.IsNullOrEmpty(CosmeticSet)) + { + string theSet = DrawCosmeticSet(CosmeticSet); + if (!string.IsNullOrEmpty(theSet)) + { + descriptionText += theSet; + } + } + } + } + + if (!string.IsNullOrEmpty(descriptionText)) + { myGraphic.DrawString( - text, + descriptionText, new Font("Arial", Settings.Default.rarityNew ? 9 : 10), new SolidBrush(Color.White), new RectangleF(5, Settings.Default.rarityNew ? 455 : 441, 512, Settings.Default.rarityNew ? 42 : 49), diff --git a/FModel/Methods/IconGenerator/ItemGenerator/ItemIcon.cs b/FModel/Methods/IconGenerator/ItemGenerator/ItemIcon.cs index be2b306f..9777958f 100644 --- a/FModel/Methods/IconGenerator/ItemGenerator/ItemIcon.cs +++ b/FModel/Methods/IconGenerator/ItemGenerator/ItemIcon.cs @@ -148,6 +148,7 @@ namespace FModel { JToken largePreviewImage = theItem["LargePreviewImage"]; JToken smallPreviewImage = theItem["SmallPreviewImage"]; + JToken iconBrush = theItem["IconBrush"]; if (largePreviewImage != null) { JToken assetPathName = largePreviewImage["asset_path_name"]; @@ -165,6 +166,16 @@ namespace FModel { string textureFile = Path.GetFileName(assetPathName.Value()).Substring(0, Path.GetFileName(assetPathName.Value()).LastIndexOf('.')); + ItemIconPath = JohnWick.AssetToTexture2D(textureFile); + } + } + else if (iconBrush != null) + { + JToken resourceObject = iconBrush["ResourceObject"]; + if (resourceObject != null) + { + string textureFile = resourceObject.Value(); + ItemIconPath = JohnWick.AssetToTexture2D(textureFile); } } diff --git a/README.md b/README.md index b990bab5..e0511768 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,9 @@ I'd highly suggest you to use [UModel](https://github.com/gildor2/UModel) if you ## TODO - [ ] Code refactoring - - [ ] Schematics icon with weapon icon and ingredients + - [ ] Special Schematics icon design with weapon icon and ingredients + - [ ] New Heroes icon design with perks and more + - [ ] New Defenders icon design with useful infos - [x] Translation support - [x] AES Manager - [x] Display support for .locres files