mirror of
https://github.com/4sval/FModel.git
synced 2026-03-21 17:24:26 -05:00
Try to figure out this TryLoadObject issue
This commit is contained in:
parent
df807b0421
commit
2d1c20df3a
|
|
@ -1 +1 @@
|
|||
Subproject commit 6236e941673053858f212af85d0b0d45ecd39ab6
|
||||
Subproject commit 038f373650a2e7b05506d10060fe79e136b23eb8
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
using CUE4Parse.UE4.Assets.Exports;
|
||||
using CUE4Parse.UE4.Assets.Objects;
|
||||
using CUE4Parse.UE4.Objects.Core.i18N;
|
||||
using FModel.Creator.Bases.FN;
|
||||
using FModel.Extensions;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace FModel.Creator.Bases.SOD2
|
||||
|
|
@ -9,7 +12,28 @@ namespace FModel.Creator.Bases.SOD2
|
|||
public BaseDecayIcon(UObject uObject, EIconStyle style) : base(uObject, style)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void ParseForInfo()
|
||||
{
|
||||
if (Object.TryGetValue(out FStructFallback displayInfo, "DisplayInfo"))
|
||||
{
|
||||
if (displayInfo.TryGetValue(out FText displayName, "DisplayName"))
|
||||
DisplayName = displayName.Text;
|
||||
if (displayInfo.TryGetValue(out FText displayDescription, "DisplayDescription"))
|
||||
Description = displayDescription.Text;
|
||||
|
||||
if (displayInfo.TryGetValue(out string iconFills, "IconFills"))
|
||||
{
|
||||
if (Utils.TryLoadObject("StateOfDecay2/Content/Art/UI/common_art_assets/common_weapons_ammo/icon_weapon_ammo_DLC4_bloater_gas_round_fills.icon_weapon_ammo_DLC4_bloater_gas_round_fills", out UObject a)) // UTexture2D fails too
|
||||
{
|
||||
// FAILS
|
||||
}
|
||||
|
||||
Preview = Utils.GetBitmap(iconFills.Replace("/Game/", "StateOfDecay2/Content/")); // FAILS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
//
|
||||
// ExtraLargeBackpackBase - for extra large
|
||||
|
|
@ -23,8 +47,7 @@ namespace FModel.Creator.Bases.SOD2
|
|||
using var ret = new SKBitmap(Width, Height, SKColorType.Rgba8888, SKAlphaType.Premul);
|
||||
using var c = new SKCanvas(ret);
|
||||
|
||||
var bit = SKBitmap.Decode(@"C:\Users\GMatrixGames\Downloads\443546551013343242.png");
|
||||
c.DrawBitmap(bit, 0, 0);
|
||||
DrawPreview(c);
|
||||
|
||||
return SKImage.FromBitmap(ret);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user