Fix '+' being drawn on icons that don't have UserFacingFlags

This commit is contained in:
GMatrixGames
2021-05-31 19:40:45 -04:00
parent d613ade489
commit 459d8a523f

View File

@@ -1,4 +1,5 @@
using CUE4Parse.UE4.Assets.Exports; using System.Linq;
using CUE4Parse.UE4.Assets.Exports;
using CUE4Parse.UE4.Objects.GameplayTags; using CUE4Parse.UE4.Objects.GameplayTags;
using CUE4Parse.UE4.Objects.UObject; using CUE4Parse.UE4.Objects.UObject;
using CUE4Parse.UE4.Versions; using CUE4Parse.UE4.Versions;
@@ -20,6 +21,7 @@ namespace FModel.Creator.Bases.FN
private string _source; private string _source;
private string _season; private string _season;
private bool _lowerDrawn; private bool _lowerDrawn;
private bool _hasStyle;
public BaseCommunity(UObject uObject, EIconStyle style, string designName) : base(uObject, style) public BaseCommunity(UObject uObject, EIconStyle style, string designName) : base(uObject, style)
{ {
@@ -87,9 +89,8 @@ namespace FModel.Creator.Bases.FN
Description += GetCosmeticSet(set.Text, _design.DrawSetShort); Description += GetCosmeticSet(set.Text, _design.DrawSetShort);
if (_design.DrawSeason && gameplayTags.TryGetGameplayTag("Cosmetics.Filter.Season.", out var season)) if (_design.DrawSeason && gameplayTags.TryGetGameplayTag("Cosmetics.Filter.Season.", out var season))
_season = GetCosmeticSeason(season.Text, _design.DrawSeasonShort); _season = GetCosmeticSeason(season.Text, _design.DrawSeasonShort);
if (gameplayTags.Any(x => x.Text.StartsWith("Cosmetics.UserFacingFlags.")))
GetUserFacingFlags(gameplayTags.GetAllGameplayTags( _hasStyle = true;
"Cosmetics.UserFacingFlags.", "Homebase.Class.", "NPC.CharacterType.Survivor.Defender."));
} }
private string GetCosmeticSet(string setName, bool bShort) private string GetCosmeticSet(string setName, bool bShort)
@@ -290,7 +291,7 @@ namespace FModel.Creator.Bases.FN
private void DrawUserFacingFlags(SKCanvas c, bool customOnly) private void DrawUserFacingFlags(SKCanvas c, bool customOnly)
{ {
if (UserFacingFlags == null || UserFacingFlags.Length < 1) return; if (!_hasStyle) return;
if (customOnly) if (customOnly)
{ {
c.DrawBitmap(_design.GameplayTags.Custom, 0, 0, ImagePaint); c.DrawBitmap(_design.GameplayTags.Custom, 0, 0, ImagePaint);