Finished?

This commit is contained in:
Krowe Moh 2025-07-30 12:55:13 +10:00
parent a49dddaec3
commit b51983a36a
4 changed files with 17 additions and 27 deletions

View File

@ -3,7 +3,6 @@ using CUE4Parse.FileProvider;
using CUE4Parse.FileProvider.Objects;
using CUE4Parse.UE4.Assets;
using CUE4Parse.UE4.Objects.UObject;
using CUE4Parse.Utils;
using FModel.Settings;
namespace FModel.Extensions;
@ -68,19 +67,4 @@ public static class CUE4ParseExtensions
return result;
}
public static LoadPackageResult GetLoadPackageResult(this IFileProvider provider, string file, string objectName = null)
{
var result = new LoadPackageResult { Package = provider.LoadPackage(file) };
if (result.IsPaginated || (result.Package.HasFlags(EPackageFlags.PKG_ContainsMap) && UserSettings.Default.PreviewWorlds)) // focus on UWorld if it's a map we want to preview
{
result.RequestedIndex = result.Package.GetExportIndex(file.SubstringBeforeLast('.'));
if (objectName != null)
{
result.RequestedIndex = int.TryParse(objectName, out var index) ? index : result.Package.GetExportIndex(objectName);
}
}
return result;
}
}

View File

@ -665,6 +665,7 @@ public class CUE4ParseViewModel : ViewModel
case "udn":
case "doc":
case "lua":
case "vdf":
case "js":
case "po":
case "md":
@ -798,6 +799,14 @@ public class CUE4ParseViewModel : ViewModel
break;
}
case "stinfo":
{
var archive = entry.CreateReader();
var ar = new FPipelineCacheFile(archive);
TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(ar, Formatting.Indented), saveProperties, updateUi);
break;
}
case "res": // just skip
case "luac": // compiled lua
case "bytes": // wuthering waves
@ -1014,16 +1023,14 @@ public class CUE4ParseViewModel : ViewModel
var pkg = Provider.LoadPackage(entry);
string mypathisapathrealwhathowPath = Path.Combine(
Path.GetDirectoryName(entry.Path)!,
$"{Path.GetFileNameWithoutExtension(entry.Path)}.o.uasset"
);
string editorPath = Path.Combine(Path.GetDirectoryName(entry.Path)!, $"{Path.GetFileNameWithoutExtension(entry.Path)}.o.uasset");
string idkhowtogetitwithoutthis = string.Empty;
UObject meta = null;
try
{
var whatisthisforealreal = Provider.GetLoadPackageResult(mypathisapathrealwhathowPath);
idkhowtogetitwithoutthis = JsonConvert.SerializeObject(whatisthisforealreal.GetDisplayData(false), Formatting.Indented);
Provider.TryGetGameFile(editorPath, out var metaGame);
var editorPkg = Provider.LoadPackage(metaGame);
meta = editorPkg.GetExport("CookedClassMetaData", StringComparison.InvariantCultureIgnoreCase);
}
catch (Exception e) {}
@ -1039,7 +1046,7 @@ public class CUE4ParseViewModel : ViewModel
if (dummy is not UClass || pointer.Object.Value is not UClass blueprint)
continue;
cpp += blueprint.DecompileBlueprintToPseudo(idkhowtogetitwithoutthis);
cpp += blueprint.DecompileBlueprintToPseudo(meta);
}
TabControl.SelectedTab.SetDocumentText(cpp, false, false);

View File

@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using FModel.Extensions;
using ICSharpCode.AvalonEdit.Rendering;
namespace FModel.Views.Resources.Controls;
@ -7,7 +6,7 @@ namespace FModel.Views.Resources.Controls;
public class JumpElementGenerator : VisualLineElementGenerator
{
private readonly Regex _JumpRegex = new(
@"\b(?:goto\s+Label_(?'target'\d+);|ExecuteUbergraph_(?'target'\d+)\(10\);)",
@"\b(?:goto\s+Label_(?'target'\d+);)",
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
private Match FindMatch(int startOffset)

View File

@ -61,7 +61,7 @@ public class JumpVisualLineText : VisualLineText
var a = new JumpVisualLineText(_jump, ParentVisualLine, length);
a.OnJumpClicked += jump =>
{
var lineNumber = a.ParentVisualLine.Document.Text.GetNameLineNumberText($"\t\tLabel_{jump}:");
var lineNumber = a.ParentVisualLine.Document.Text.GetNameLineNumberText($" Label_{jump}:"); // impossible for different indentation
if (lineNumber > -1)
{
var line = a.ParentVisualLine.Document.GetLineByNumber(lineNumber);