mirror of
https://github.com/4sval/FModel.git
synced 2026-09-13 12:06:39 -05:00
done
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using CUE4Parse.UE4.Assets.Exports;
|
||||
using CUE4Parse.UE4.Assets.Exports.Engine;
|
||||
using CUE4Parse.UE4.Assets.Exports.Material;
|
||||
using CUE4Parse.UE4.Assets.Objects;
|
||||
using CUE4Parse.UE4.Objects.Core.i18N;
|
||||
using CUE4Parse.UE4.Objects.Core.Math;
|
||||
using CUE4Parse.UE4.Objects.UObject;
|
||||
@@ -18,8 +19,14 @@ public class BaseFighter : UCreator
|
||||
private float _zoom;
|
||||
|
||||
private readonly SKBitmap _pattern;
|
||||
private readonly SKBitmap _perk;
|
||||
private readonly SKBitmap _emote;
|
||||
private readonly SKBitmap _skin;
|
||||
|
||||
private (SKBitmap, List<string>) _fighterType;
|
||||
private readonly List<SKBitmap> _recommendedPerks;
|
||||
private readonly List<SKBitmap> _availableTaunts;
|
||||
private readonly List<SKBitmap> _skins;
|
||||
|
||||
public BaseFighter(UObject uObject, EIconStyle style) : base(uObject, style)
|
||||
{
|
||||
@@ -31,7 +38,13 @@ public class BaseFighter : UCreator
|
||||
DefaultPreview = Utils.GetBitmap("MultiVersus/Content/Panda_Main/UI/PreMatch/Images/DiamondPortraits/0010_Random.0010_Random");
|
||||
|
||||
_pattern = Utils.GetBitmap("MultiVersus/Content/Panda_Main/UI/Assets/UI_Textures/halftone_jagged.halftone_jagged");
|
||||
_perk = Utils.GetBitmap("MultiVersus/Content/Panda_Main/UI/Assets/Icons/ui_icons_perks.ui_icons_perks");
|
||||
_emote = Utils.GetBitmap("MultiVersus/Content/Panda_Main/UI/Assets/Icons/ui_icons_emote.ui_icons_emote");
|
||||
_skin = Utils.GetBitmap("MultiVersus/Content/Panda_Main/UI/Assets/Icons/ui_icons_skins.ui_icons_skins");
|
||||
_fighterType.Item2 = new List<string>();
|
||||
_recommendedPerks = new List<SKBitmap>();
|
||||
_availableTaunts = new List<SKBitmap>();
|
||||
_skins = new List<SKBitmap>();
|
||||
}
|
||||
|
||||
public override void ParseForInfo()
|
||||
@@ -54,6 +67,43 @@ public class BaseFighter : UCreator
|
||||
GetFighterClassInfo(Object.GetOrDefault("Class", EFighterClass.Support));
|
||||
if (Object.TryGetValue(out FText property, "Property"))
|
||||
_fighterType.Item2.Add(property.Text);
|
||||
|
||||
if (Object.TryGetValue(out UScriptSet recommendedPerks, "RecommendedPerkDatas")) // PORCO DIO WB USE ARRAYS!!!!!!
|
||||
{
|
||||
foreach (var recommendedPerk in recommendedPerks.Properties)
|
||||
{
|
||||
if (recommendedPerk.GenericValue is not FPackageIndex packageIndex ||
|
||||
!Utils.TryGetPackageIndexExport(packageIndex, out UObject export) ||
|
||||
!export.TryGetValue(out FSoftObjectPath rewardThumbnail, "RewardThumbnail"))
|
||||
continue;
|
||||
|
||||
_recommendedPerks.Add(Utils.GetBitmap(rewardThumbnail));
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.TryGetValue(out FSoftObjectPath[] availableTaunts, "AvailableTauntData"))
|
||||
{
|
||||
foreach (var taunt in availableTaunts)
|
||||
{
|
||||
if (!Utils.TryLoadObject(taunt.AssetPathName.Text, out UObject export) ||
|
||||
!export.TryGetValue(out FSoftObjectPath rewardThumbnail, "RewardThumbnail"))
|
||||
continue;
|
||||
|
||||
_availableTaunts.Add(Utils.GetBitmap(rewardThumbnail));
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.TryGetValue(out FSoftObjectPath[] skins, "Skins"))
|
||||
{
|
||||
foreach (var skin in skins)
|
||||
{
|
||||
if (!Utils.TryLoadObject(skin.AssetPathName.Text, out UObject export) ||
|
||||
!export.TryGetValue(out FSoftObjectPath rewardThumbnail, "RewardThumbnail"))
|
||||
continue;
|
||||
|
||||
_skins.Add(Utils.GetBitmap(rewardThumbnail));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override SKBitmap[] Draw()
|
||||
@@ -65,6 +115,9 @@ public class BaseFighter : UCreator
|
||||
DrawPreview(c);
|
||||
DrawDisplayName(c);
|
||||
DrawFighterInfo(c);
|
||||
DrawRecommendedPerks(c);
|
||||
DrawAvailableTaunts(c);
|
||||
DrawSkins(c);
|
||||
|
||||
return new[] { ret };
|
||||
}
|
||||
@@ -139,6 +192,65 @@ public class BaseFighter : UCreator
|
||||
c.DrawBitmap(_fighterType.Item1, new SKRect(50, 112.5f, 98, 160.5f), ImagePaint);
|
||||
c.DrawText(string.Join(" | ", _fighterType.Item2), 98, 145, DescriptionPaint);
|
||||
}
|
||||
|
||||
private void DrawRecommendedPerks(SKCanvas c)
|
||||
{
|
||||
const int x = 50;
|
||||
const int y = 200;
|
||||
const int size = 64;
|
||||
|
||||
ImagePaint.ImageFilter = null;
|
||||
ImagePaint.BlendMode = SKBlendMode.SoftLight;
|
||||
c.DrawBitmap(_perk, new SKRect(x, y, x + size / 2, y + size / 2), ImagePaint);
|
||||
|
||||
ImagePaint.BlendMode = SKBlendMode.SrcOver;
|
||||
ImagePaint.ImageFilter = SKImageFilter.CreateDropShadow(0, 0, 2.5f, 2.5f, SKColors.Black);
|
||||
c.DrawBitmap(_recommendedPerks[1], new SKRect(161, y, 225, y + size), ImagePaint);
|
||||
c.DrawBitmap(_recommendedPerks[2], new SKRect(193, y + size / 2, 257, y + size * 1.5f), ImagePaint);
|
||||
c.DrawBitmap(_recommendedPerks[3], new SKRect(161, y + size, 225, y + size * 2), ImagePaint);
|
||||
|
||||
ImagePaint.ImageFilter = SKImageFilter.CreateDropShadow(0, 0, 5, 5, SKColors.Black.WithAlpha(150));
|
||||
c.DrawBitmap(_recommendedPerks[0], new SKRect(x, y, x + size * 2, y + size * 2), ImagePaint);
|
||||
}
|
||||
|
||||
private void DrawAvailableTaunts(SKCanvas c)
|
||||
{
|
||||
var x = 300;
|
||||
const int y = 232;
|
||||
const int size = 64;
|
||||
|
||||
ImagePaint.ImageFilter = null;
|
||||
ImagePaint.BlendMode = SKBlendMode.SoftLight;
|
||||
c.DrawBitmap(_emote, new SKRect(x, y - size / 2, x + size / 2, y), ImagePaint);
|
||||
|
||||
ImagePaint.BlendMode = SKBlendMode.SrcOver;
|
||||
ImagePaint.ImageFilter = SKImageFilter.CreateDropShadow(0, 0, 1.5f, 1.5f, SKColors.Black);
|
||||
|
||||
foreach (var taunt in _availableTaunts)
|
||||
{
|
||||
c.DrawBitmap(taunt, new SKRect(x, y, x + size, y + size), ImagePaint);
|
||||
x += size;
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawSkins(SKCanvas c)
|
||||
{
|
||||
var x = 50;
|
||||
const int y = 333;
|
||||
const int size = 128;
|
||||
|
||||
ImagePaint.ImageFilter = null;
|
||||
ImagePaint.BlendMode = SKBlendMode.SoftLight;
|
||||
c.DrawBitmap(_skin, new SKRect(x, y, x + size / 4, y + size / 4), ImagePaint);
|
||||
|
||||
ImagePaint.BlendMode = SKBlendMode.SrcOver;
|
||||
ImagePaint.ImageFilter = SKImageFilter.CreateDropShadow(0, 0, 1.5f, 1.5f, SKColors.Black);
|
||||
foreach (var skin in _skins)
|
||||
{
|
||||
c.DrawBitmap(skin, new SKRect(x, y, x + size, y + size), ImagePaint);
|
||||
x += size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum EFighterClass : byte
|
||||
|
||||
Reference in New Issue
Block a user