diff --git a/FModel/Creator/Bases/BaseBBDefinition.cs b/FModel/Creator/Bases/BaseBBDefinition.cs index 254c7b8b..5293bd63 100644 --- a/FModel/Creator/Bases/BaseBBDefinition.cs +++ b/FModel/Creator/Bases/BaseBBDefinition.cs @@ -12,6 +12,7 @@ namespace FModel.Creator.Bases { public SKBitmap FallbackImage; public SKBitmap IconImage; + public SKBitmap RarityBackgroundImage; public SKColor[] RarityBackgroundColors; public SKColor[] RarityBorderColor; public string DisplayName; @@ -23,6 +24,7 @@ namespace FModel.Creator.Bases public BaseBBDefinition(string exportType) { FallbackImage = SKBitmap.Decode(Application.GetResourceStream(new Uri("pack://application:,,,/Resources/T_Placeholder_Item_Image.png"))?.Stream); + RarityBackgroundImage = null; IconImage = FallbackImage; RarityBackgroundColors = new[] { SKColor.Parse("D0D0D0"), SKColor.Parse("636363") }; RarityBorderColor = new[] { SKColor.Parse("D0D0D0"), SKColor.Parse("FFFFFF") }; @@ -32,8 +34,6 @@ namespace FModel.Creator.Bases public BaseBBDefinition(IUExport export, string exportType) : this(exportType) { - // Not sure how to handle rarity for this. From what I can see, there is no data for colors - if (export.GetExport("IconTextureAssetData") is {} previewImage) IconImage = Utils.GetSoftObjectTexture(previewImage); else if (export.GetExport("IconTextureAssetData") is {} iconTexture) @@ -43,6 +43,8 @@ namespace FModel.Creator.Bases DisplayName = Text.GetTextPropertyBase(displayName); if (export.GetExport("Description") is {} description) Description = Text.GetTextPropertyBase(description); + + RarityBackgroundImage = SKBitmap.Decode(Application.GetResourceStream(new Uri("pack://application:,,,/Resources/battle-breakers-item-background.png"))?.Stream); } SKBitmap IBase.FallbackImage => FallbackImage; diff --git a/FModel/Creator/Creator.cs b/FModel/Creator/Creator.cs index ffc6d1a4..c9f2f52c 100644 --- a/FModel/Creator/Creator.cs +++ b/FModel/Creator/Creator.cs @@ -462,7 +462,15 @@ namespace FModel.Creator { if ((EIconDesign) Properties.Settings.Default.AssetsIconDesign != EIconDesign.NoBackground) { - Rarity.DrawRarity(c, icon); + if (icon.RarityBackgroundImage != null) + { + c.DrawBitmap(icon.RarityBackgroundImage, new SKRect(icon.Margin, icon.Margin, icon.Width - icon.Margin, icon.Height - icon.Margin), + new SKPaint { FilterQuality = SKFilterQuality.High, IsAntialias = true }); + } + else + { + Rarity.DrawRarity(c, icon); + } } LargeSmallImage.DrawPreviewImage(c, icon); diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index 04e88c80..040b17e8 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -108,6 +108,7 @@ + @@ -227,6 +228,7 @@ + diff --git a/FModel/Resources/battle-breakers-item-background.png b/FModel/Resources/battle-breakers-item-background.png new file mode 100644 index 00000000..1647e095 Binary files /dev/null and b/FModel/Resources/battle-breakers-item-background.png differ