mirror of
https://github.com/4sval/FModel.git
synced 2026-03-22 01:34:37 -05:00
add support for ComponentContainer (#454)
This commit is contained in:
parent
53bb6e1f90
commit
f64151b0ee
|
|
@ -31,6 +31,7 @@ public class BaseIcon : UCreator
|
|||
{
|
||||
// rarity
|
||||
if (Object.TryGetValue(out FPackageIndex series, "Series")) GetSeries(series);
|
||||
else if (Object.TryGetValue(out FStructFallback componentContainer, "ComponentContainer")) GetSeries(componentContainer);
|
||||
else GetRarity(Object.GetOrDefault("Rarity", EFortRarity.Uncommon)); // default is uncommon
|
||||
|
||||
// preview
|
||||
|
|
@ -127,6 +128,21 @@ public class BaseIcon : UCreator
|
|||
GetSeries(export);
|
||||
}
|
||||
|
||||
private void GetSeries(FStructFallback s)
|
||||
{
|
||||
if (!s.TryGetValue(out FPackageIndex[] components, "Components")) return;
|
||||
|
||||
foreach (var component in components)
|
||||
{
|
||||
if (!component.TryLoad(out var componentObj) ||
|
||||
!componentObj!.TryGetValue(out UObject componentSeriesDef, "Series"))
|
||||
continue;
|
||||
|
||||
GetSeries(componentSeriesDef);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected void GetSeries(UObject uObject)
|
||||
{
|
||||
if (uObject is UTexture2D texture2D)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user