Skip to content

Commit

Permalink
gameobject viewer improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nesrak1 committed Sep 20, 2020
1 parent fedca41 commit b22fe7d
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 173 deletions.
24 changes: 21 additions & 3 deletions AssetTools.NET/Extra/AssetsManager/AssetsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public AssetExternal GetExtAsset(AssetsFileInstance relativeTo, int fileId, long
AssetsFileInstance dep = relativeTo.dependencies[fileId - 1];
ext.info = dep.table.GetAssetInfo(pathId);
if (!onlyGetInfo)
ext.instance = GetATI(dep.file, ext.info, forceFromCldb);
ext.instance = GetTypeInstance(dep.file, ext.info, forceFromCldb);
else
ext.instance = null;
ext.file = dep;
Expand All @@ -165,7 +165,7 @@ public AssetExternal GetExtAsset(AssetsFileInstance relativeTo, int fileId, long
{
ext.info = relativeTo.table.GetAssetInfo(pathId);
if (!onlyGetInfo)
ext.instance = GetATI(relativeTo.file, ext.info, forceFromCldb);
ext.instance = GetTypeInstance(relativeTo.file, ext.info, forceFromCldb);
else
ext.instance = null;
ext.file = relativeTo;
Expand All @@ -180,7 +180,25 @@ public AssetExternal GetExtAsset(AssetsFileInstance relativeTo, AssetTypeValueFi
return GetExtAsset(relativeTo, fileId, pathId, onlyGetInfo, forceFromCldb);
}

public AssetTypeInstance GetTypeInstance(AssetsFileInstance inst, AssetFileInfoEx info, bool forceFromCldb = false)
{
return GetTypeInstance(inst.file, info, forceFromCldb);
}

public AssetTypeInstance GetTypeInstance(AssetsFile file, AssetFileInfoEx info, bool forceFromCldb = false)
{
return new AssetTypeInstance(GetTemplateBaseField(file, info, forceFromCldb), file.reader, info.absoluteFilePos);
}

//this method was renamed for consistency/clarity
//because it's used so much, I don't want to deprecate it right away
//so I'll keep the old method here for a while
public AssetTypeInstance GetATI(AssetsFile file, AssetFileInfoEx info, bool forceFromCldb = false)
{
return GetTypeInstance(file, info, forceFromCldb);
}

public AssetTypeTemplateField GetTemplateBaseField(AssetsFile file, AssetFileInfoEx info, bool forceFromCldb = false)
{
ushort scriptIndex = AssetHelper.GetScriptIndex(file, info);
uint fixedId = AssetHelper.FixAudioID(info.curFileType);
Expand Down Expand Up @@ -219,7 +237,7 @@ public AssetTypeInstance GetATI(AssetsFile file, AssetFileInfoEx info, bool forc
}
}

return new AssetTypeInstance(baseField, file.reader, info.absoluteFilePos);
return baseField;
}

public AssetTypeValueField GetMonoBaseFieldCached(AssetsFileInstance inst, AssetFileInfoEx info, string managedPath)
Expand Down
48 changes: 24 additions & 24 deletions AssetsView/Winforms/GameObjectViewer.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b22fe7d

Please sign in to comment.