AshtonBoardwalk MI fix

This commit is contained in:
GMatrixGames
2021-07-07 19:50:46 -04:00
parent 73e2211cca
commit 8d263b6f84
3 changed files with 18 additions and 3 deletions

View File

@@ -19,6 +19,8 @@ namespace FModel.Creator.Bases.FN
{
if (Object is not UMaterialInstanceConstant material) return;
// MY ONLY GOTO
texture_finding:
foreach (var textureParameter in material.TextureParameterValues) // get texture from base material
{
if (textureParameter.ParameterValue is not UTexture2D texture || Preview != null) continue;
@@ -45,6 +47,9 @@ namespace FModel.Creator.Bases.FN
if (material == null) return;
}
if (Preview == null)
goto texture_finding;
foreach (var vectorParameter in material.VectorParameterValues)
{
if (vectorParameter.ParameterValue == null) continue;

View File

@@ -24,6 +24,7 @@ using CUE4Parse.UE4.Assets.Exports.Wwise;
using CUE4Parse.UE4.Localization;
using CUE4Parse.UE4.Objects.UObject;
using CUE4Parse.UE4.Oodle.Objects;
using CUE4Parse.UE4.Shaders;
using CUE4Parse.UE4.Wwise;
using CUE4Parse_Conversion;
using CUE4Parse_Conversion.Materials;
@@ -87,7 +88,7 @@ namespace FModel.ViewModels
}
default:
{
Game = gameDirectory.SubstringBeforeLast("\\Content\\").SubstringAfterLast("\\").ToEnum(FGame.Unknown);
Game = gameDirectory.SubstringBeforeLast("\\Content").SubstringAfterLast("\\").ToEnum(FGame.Unknown);
if (Game == FGame.StateOfDecay2)
Provider = new DefaultFileProvider(new DirectoryInfo(gameDirectory), new List<DirectoryInfo>
@@ -482,7 +483,7 @@ namespace FModel.ViewModels
TabControl.SelectedTab.Image = null;
if (Provider.TryCreateReader(fullPath, out var archive))
{
var header = new FDictionaryHeader(archive);
var header = new FOodleDictionaryArchive(archive).Header;
TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(header, Formatting.Indented), bulkSave);
}
@@ -506,8 +507,17 @@ namespace FModel.ViewModels
break;
case "ushaderbytecode":
case "ushadercode":
{
TabControl.SelectedTab.Image = null;
if (Provider.TryCreateReader(fullPath, out var archive))
{
var ar = new FShaderCodeArchive(archive);
TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(ar, Formatting.Indented), bulkSave);
}
break;
}
default:
{
var exports = Provider.LoadObjectExports(fullPath);