Skip to content

Commit

Permalink
allow examining and modifying SoftObjectPathList
Browse files Browse the repository at this point in the history
  • Loading branch information
atenfyr committed Jan 30, 2025
1 parent 6b5bb89 commit c662a76
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion UAssetAPI
3 changes: 3 additions & 0 deletions UAssetGUI/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,9 @@ public void UpdateModeFromSelectedNode(TreeNode e)
case "Name Map":
tableEditor.mode = TableHandlerMode.NameMap;
break;
case "Soft Object Paths":
tableEditor.mode = TableHandlerMode.SoftObjectPathList;
break;
case "Import Data":
tableEditor.mode = TableHandlerMode.Imports;
break;
Expand Down
35 changes: 35 additions & 0 deletions UAssetGUI/TableHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public enum TableHandlerMode
None = -1,
GeneralInformation,
NameMap,
SoftObjectPathList,
Imports,
ExportInformation,
SoftPackageReferences,
Expand Down Expand Up @@ -213,6 +214,7 @@ public void FillOutTree(bool fillAllSubNodes)
treeView1.Nodes.Clear();
treeView1.BackColor = UAGPalette.BackColor;
treeView1.Nodes.Add(new PointingTreeNode("General Information", null));
if (asset.SoftObjectPathList != null && (asset.SoftObjectPathList.Count > 0 || !asset.IsFilterEditorOnly)) treeView1.Nodes.Add(new PointingTreeNode("Soft Object Paths", null));
treeView1.Nodes.Add(new PointingTreeNode("Name Map", null));
treeView1.Nodes.Add(new PointingTreeNode("Import Data", null));
treeView1.Nodes.Add(new PointingTreeNode("Export Information", null));
Expand Down Expand Up @@ -1265,6 +1267,18 @@ public void Load() // Updates the table with selected asset data
}
//((Form1)dataGridView1.Parent).CurrentDataGridViewStrip = ((Form1)dataGridView1.Parent).nameMapContext;
break;
case TableHandlerMode.SoftObjectPathList:
AddColumns(new string[] { "PackageName", "AssetName", "SubPathString", "" });

for (int num = 0; num < asset.SoftObjectPathList.Count; num++)
{
string a = asset.SoftObjectPathList[num].AssetPath.PackageName == null ? FString.NullCase : asset.SoftObjectPathList[num].AssetPath.PackageName.ToString();
string b = asset.SoftObjectPathList[num].AssetPath.AssetName == null ? FString.NullCase : asset.SoftObjectPathList[num].AssetPath.AssetName.ToString();
string c = asset.SoftObjectPathList[num].SubPathString == null ? FString.NullCase : asset.SoftObjectPathList[num].SubPathString.ToString();
dataGridView1.Rows.Add(a, b, c);
dataGridView1.Rows[num].HeaderCell.Value = Convert.ToString(num);
}
break;
case TableHandlerMode.Imports:
AddColumns(new string[] { "ClassPackage", "ClassName", "OuterIndex", "ObjectName", "bImportOptional", "" });

Expand Down Expand Up @@ -2066,6 +2080,27 @@ public void Save(bool forceNewLoad) // Reads from the table and updates the asse
}
}
break;
case TableHandlerMode.SoftObjectPathList:
if (asset.SoftObjectPathList == null) asset.SoftObjectPathList = new List<FSoftObjectPath>();

asset.SoftObjectPathList.Clear();
foreach (DataGridViewRow row in dataGridView1.Rows)
{
string a = row.Cells[0].Value as string;
string b = row.Cells[1].Value as string;
string c = row.Cells[2].Value as string;

if (a == FString.NullCase) a = null;
if (b == FString.NullCase) b = null;
if (c == FString.NullCase) c = null;

// if all empty, then remove (invalid, probably just the last row)
if (a == null && b == null && c == null) continue;

FSoftObjectPath nuevo = new FSoftObjectPath(FName.FromString(asset, a), FName.FromString(asset, b), FString.FromString(c));
asset.SoftObjectPathList.Add(nuevo);
}
break;
case TableHandlerMode.Imports:
asset.Imports = new List<Import>();
foreach (DataGridViewRow row in dataGridView1.Rows)
Expand Down

0 comments on commit c662a76

Please sign in to comment.