Skip to content

Commit c662a76

Browse files
committed
allow examining and modifying SoftObjectPathList
1 parent 6b5bb89 commit c662a76

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

UAssetGUI/Form1.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,9 @@ public void UpdateModeFromSelectedNode(TreeNode e)
13591359
case "Name Map":
13601360
tableEditor.mode = TableHandlerMode.NameMap;
13611361
break;
1362+
case "Soft Object Paths":
1363+
tableEditor.mode = TableHandlerMode.SoftObjectPathList;
1364+
break;
13621365
case "Import Data":
13631366
tableEditor.mode = TableHandlerMode.Imports;
13641367
break;

UAssetGUI/TableHandler.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public enum TableHandlerMode
2222
None = -1,
2323
GeneralInformation,
2424
NameMap,
25+
SoftObjectPathList,
2526
Imports,
2627
ExportInformation,
2728
SoftPackageReferences,
@@ -213,6 +214,7 @@ public void FillOutTree(bool fillAllSubNodes)
213214
treeView1.Nodes.Clear();
214215
treeView1.BackColor = UAGPalette.BackColor;
215216
treeView1.Nodes.Add(new PointingTreeNode("General Information", null));
217+
if (asset.SoftObjectPathList != null && (asset.SoftObjectPathList.Count > 0 || !asset.IsFilterEditorOnly)) treeView1.Nodes.Add(new PointingTreeNode("Soft Object Paths", null));
216218
treeView1.Nodes.Add(new PointingTreeNode("Name Map", null));
217219
treeView1.Nodes.Add(new PointingTreeNode("Import Data", null));
218220
treeView1.Nodes.Add(new PointingTreeNode("Export Information", null));
@@ -1265,6 +1267,18 @@ public void Load() // Updates the table with selected asset data
12651267
}
12661268
//((Form1)dataGridView1.Parent).CurrentDataGridViewStrip = ((Form1)dataGridView1.Parent).nameMapContext;
12671269
break;
1270+
case TableHandlerMode.SoftObjectPathList:
1271+
AddColumns(new string[] { "PackageName", "AssetName", "SubPathString", "" });
1272+
1273+
for (int num = 0; num < asset.SoftObjectPathList.Count; num++)
1274+
{
1275+
string a = asset.SoftObjectPathList[num].AssetPath.PackageName == null ? FString.NullCase : asset.SoftObjectPathList[num].AssetPath.PackageName.ToString();
1276+
string b = asset.SoftObjectPathList[num].AssetPath.AssetName == null ? FString.NullCase : asset.SoftObjectPathList[num].AssetPath.AssetName.ToString();
1277+
string c = asset.SoftObjectPathList[num].SubPathString == null ? FString.NullCase : asset.SoftObjectPathList[num].SubPathString.ToString();
1278+
dataGridView1.Rows.Add(a, b, c);
1279+
dataGridView1.Rows[num].HeaderCell.Value = Convert.ToString(num);
1280+
}
1281+
break;
12681282
case TableHandlerMode.Imports:
12691283
AddColumns(new string[] { "ClassPackage", "ClassName", "OuterIndex", "ObjectName", "bImportOptional", "" });
12701284

@@ -2066,6 +2080,27 @@ public void Save(bool forceNewLoad) // Reads from the table and updates the asse
20662080
}
20672081
}
20682082
break;
2083+
case TableHandlerMode.SoftObjectPathList:
2084+
if (asset.SoftObjectPathList == null) asset.SoftObjectPathList = new List<FSoftObjectPath>();
2085+
2086+
asset.SoftObjectPathList.Clear();
2087+
foreach (DataGridViewRow row in dataGridView1.Rows)
2088+
{
2089+
string a = row.Cells[0].Value as string;
2090+
string b = row.Cells[1].Value as string;
2091+
string c = row.Cells[2].Value as string;
2092+
2093+
if (a == FString.NullCase) a = null;
2094+
if (b == FString.NullCase) b = null;
2095+
if (c == FString.NullCase) c = null;
2096+
2097+
// if all empty, then remove (invalid, probably just the last row)
2098+
if (a == null && b == null && c == null) continue;
2099+
2100+
FSoftObjectPath nuevo = new FSoftObjectPath(FName.FromString(asset, a), FName.FromString(asset, b), FString.FromString(c));
2101+
asset.SoftObjectPathList.Add(nuevo);
2102+
}
2103+
break;
20692104
case TableHandlerMode.Imports:
20702105
asset.Imports = new List<Import>();
20712106
foreach (DataGridViewRow row in dataGridView1.Rows)

0 commit comments

Comments
 (0)