mirror of
https://github.com/4sval/FModel.git
synced 2026-03-21 17:24:26 -05:00
FModel 3.1.2
This commit is contained in:
parent
37131d1885
commit
efc5b598db
|
|
@ -100,7 +100,7 @@ namespace FModel.Creator.Bases
|
|||
|
||||
// image
|
||||
if (Settings.Default.UseItemShopIcon &&
|
||||
DisplayAssetImage.GetDisplayAssetImage(this, export.GetExport<SoftObjectProperty>("DisplayAssetPath"), ref assetName))
|
||||
DisplayAssetImage.GetDisplayAssetImage(this, export, ref assetName))
|
||||
{ } // ^^^^ will return false if image not found, if so, we try to get the normal icon
|
||||
else if (export.GetExport<ObjectProperty>("HeroDefinition", "WeaponDefinition") is { } itemDef)
|
||||
LargeSmallImage.GetPreviewImage(this, itemDef, assetName);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace FModel.Creator.Bases
|
|||
public BaseOfferMaterial()
|
||||
{
|
||||
FallbackImage = SKBitmap.Decode(Application.GetResourceStream(new Uri("pack://application:,,,/Resources/T_Placeholder_Item_Image.png")).Stream);
|
||||
IconImage = FallbackImage;
|
||||
IconImage = null;
|
||||
RarityBackgroundImage = null;
|
||||
RarityBackgroundColors = new SKColor[2] { SKColor.Parse("4F4F69"), SKColor.Parse("4F4F69") };
|
||||
RarityBorderColor = SKColor.Parse("9092AB");
|
||||
|
|
@ -59,17 +59,22 @@ namespace FModel.Creator.Bases
|
|||
parameter.TryGetValue("ParameterInfo", out var i1) && i1 is StructProperty i2 && i2.Value is UObject info &&
|
||||
info.TryGetValue("Name", out var j1) && j1 is NameProperty name)
|
||||
{
|
||||
if (name.Value.String.Equals("OfferImage") || name.Value.String.Equals("Texture"))
|
||||
{
|
||||
IconImage = Utils.GetObjectTexture(value);
|
||||
}
|
||||
else if (name.Value.String.Equals("SeriesTexture"))
|
||||
if (name.Value.String.Equals("SeriesTexture"))
|
||||
{
|
||||
RarityBackgroundImage = Utils.GetObjectTexture(value);
|
||||
}
|
||||
else if (IconImage == null && value.Value.Resource.OuterIndex.Resource != null && (name.Value.String.Equals("OfferImage") || name.Value.String.Contains("Texture")))
|
||||
{
|
||||
IconImage = Utils.GetObjectTexture(value);
|
||||
if (IconImage == null) IconImage = Utils.GetTexture($"{value.Value.Resource.OuterIndex.Resource.ObjectName.String}_1");
|
||||
if (IconImage == null) IconImage = Utils.GetTexture($"{value.Value.Resource.OuterIndex.Resource.ObjectName.String}_01");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (IconImage == null)
|
||||
IconImage = FallbackImage;
|
||||
}
|
||||
|
||||
public void DrawBackground(SKCanvas c)
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ namespace FModel.Creator
|
|||
}
|
||||
case "MaterialInstanceConstant":
|
||||
{
|
||||
if (assetFolder.Equals("MI_OfferImages"))
|
||||
if (assetFolder.Equals("MI_OfferImages") || assetFolder.Equals("RenderSwitch_Materials"))
|
||||
{
|
||||
BaseOfferMaterial icon = new BaseOfferMaterial(exports[index]);
|
||||
using (var ret = new SKBitmap(icon.Size, icon.Size, SKColorType.Rgba8888, SKAlphaType.Premul))
|
||||
|
|
|
|||
|
|
@ -7,11 +7,17 @@ namespace FModel.Creator.Icons
|
|||
{
|
||||
static class DisplayAssetImage
|
||||
{
|
||||
public static bool GetDisplayAssetImage(BaseIcon icon, SoftObjectProperty o, ref string assetName)
|
||||
public static bool GetDisplayAssetImage(BaseIcon icon, IUExport o, ref string assetName)
|
||||
{
|
||||
string path = o?.Value.AssetPathName.String;
|
||||
if (string.IsNullOrEmpty(path))
|
||||
string path;
|
||||
if (o.TryGetValue("DisplayAssetPath", out var d) && d is SoftObjectProperty da)
|
||||
{
|
||||
path = da.Value.AssetPathName.String;
|
||||
}
|
||||
else
|
||||
{
|
||||
path = "/Game/Catalog/MI_OfferImages/MI_" + assetName.Substring(0, assetName.LastIndexOf(".")).Replace("Athena_Commando_", "");
|
||||
}
|
||||
|
||||
Package p = Utils.GetPropertyPakPackage(path);
|
||||
if (p != null && p.HasExport())
|
||||
|
|
@ -37,8 +43,57 @@ namespace FModel.Creator.Icons
|
|||
}
|
||||
}
|
||||
}
|
||||
return GenerateOldFormat(icon, obj, ref assetName);
|
||||
}
|
||||
}
|
||||
|
||||
return GenerateOldFormat(icon, ref assetName);
|
||||
}
|
||||
|
||||
private static bool GenerateOldFormat(BaseIcon icon, ref string assetName)
|
||||
{
|
||||
var p = Utils.GetPropertyPakPackage("/Game/Catalog/DisplayAssets/DA_Featured_" + assetName.Substring(0, assetName.LastIndexOf(".")));
|
||||
if (p != null && p.HasExport())
|
||||
{
|
||||
var obj = p.GetExport<UObject>();
|
||||
if (obj != null)
|
||||
{
|
||||
return GenerateOldFormat(icon, obj, ref assetName);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private static bool GenerateOldFormat(BaseIcon icon, UObject obj, ref string assetName)
|
||||
{
|
||||
string imageType = "DetailsImage";
|
||||
switch ("DA_Featured_" + assetName)
|
||||
{
|
||||
case "DA_Featured_Glider_ID_141_AshtonBoardwalk.uasset":
|
||||
case "DA_Featured_Glider_ID_150_TechOpsBlue.uasset":
|
||||
case "DA_Featured_Glider_ID_131_SpeedyMidnight.uasset":
|
||||
case "DA_Featured_Pickaxe_ID_178_SpeedyMidnight.uasset":
|
||||
case "DA_Featured_Glider_ID_015_Brite.uasset":
|
||||
case "DA_Featured_Glider_ID_016_Tactical.uasset":
|
||||
case "DA_Featured_Glider_ID_017_Assassin.uasset":
|
||||
case "DA_Featured_Pickaxe_ID_027_Scavenger.uasset":
|
||||
case "DA_Featured_Pickaxe_ID_028_Space.uasset":
|
||||
case "DA_Featured_Pickaxe_ID_029_Assassin.uasset":
|
||||
return false;
|
||||
case "DA_Featured_Glider_ID_070_DarkViking.uasset":
|
||||
case "DA_Featured_CID_319_Athena_Commando_F_Nautilus.uasset":
|
||||
imageType = "TileImage";
|
||||
break;
|
||||
}
|
||||
|
||||
if (obj.TryGetValue(imageType, out var v1) && v1 is StructProperty s && s.Value is UObject type &&
|
||||
type.TryGetValue("ResourceObject", out var v2) && v2 is ObjectProperty resourceObject &&
|
||||
resourceObject.Value.Resource.OuterIndex.Resource != null &&
|
||||
!resourceObject.Value.Resource.OuterIndex.Resource.ObjectName.String.Contains("/Game/Athena/Prototype/Textures/"))
|
||||
{
|
||||
icon.IconImage = Utils.GetObjectTexture(resourceObject);
|
||||
assetName = "DA_Featured_" + assetName;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ namespace FModel.Creator
|
|||
}
|
||||
|
||||
var p = GetPropertyPakPackage(s);
|
||||
if (p.HasExport() && !p.Equals(default))
|
||||
if (p != null && p.HasExport() && !p.Equals(default))
|
||||
{
|
||||
var i = p.GetExport<UTexture2D>();
|
||||
if (i != null)
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@
|
|||
<StartupObject>FModel.App</StartupObject>
|
||||
<Authors>Asval</Authors>
|
||||
<Company></Company>
|
||||
<AssemblyVersion>3.1.1.3</AssemblyVersion>
|
||||
<FileVersion>3.1.1.3</FileVersion>
|
||||
<AssemblyVersion>3.1.2.0</AssemblyVersion>
|
||||
<FileVersion>3.1.2.0</FileVersion>
|
||||
<PackageIcon>FModel.ico</PackageIcon>
|
||||
<PackageIconUrl />
|
||||
<PackageProjectUrl>https://github.com/iAmAsval/FModel</PackageProjectUrl>
|
||||
<Description></Description>
|
||||
<Version>3.1.1</Version>
|
||||
<Version>3.1.2</Version>
|
||||
<Platforms>x64</Platforms>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ namespace FModel.PakReader.Parsers
|
|||
var importedPackageId = new FPackageId(Loader);
|
||||
var arcs = Loader.ReadTArray(() => new FArc(Loader));
|
||||
graphData[i] = (importedPackageId, arcs);
|
||||
string importedPackageName = Transform(Creator.Utils.GetFullPath(importedPackageId));
|
||||
string importedPackageName = Transform(Creator.Utils.GetFullPath(importedPackageId) ?? "");
|
||||
if (!(Creator.Utils.GetPropertyPakPackage(importedPackageName) is IoPackage package)) continue;
|
||||
foreach (var export in package.Reader.ExportMap)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user