mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
minor fixes
This commit is contained in:
parent
0a764c74d6
commit
19534ebb4d
@ -186,6 +186,7 @@ namespace AssetStudio
|
|||||||
|
|
||||||
public void SetVersion(string stringVersion)
|
public void SetVersion(string stringVersion)
|
||||||
{
|
{
|
||||||
|
unityVersion = stringVersion;
|
||||||
var buildSplit = Regex.Replace(stringVersion, @"\d", "").Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries);
|
var buildSplit = Regex.Replace(stringVersion, @"\d", "").Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
buildType = new BuildType(buildSplit[0]);
|
buildType = new BuildType(buildSplit[0]);
|
||||||
var versionSplit = Regex.Replace(stringVersion, @"\D", ".").Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries);
|
var versionSplit = Regex.Replace(stringVersion, @"\D", ".").Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
@ -148,9 +148,11 @@ namespace AssetStudioGUI
|
|||||||
treeNodeCollection = BuildTreeStructure(tempDic);
|
treeNodeCollection = BuildTreeStructure(tempDic);
|
||||||
}
|
}
|
||||||
tempDic.Clear();
|
tempDic.Clear();
|
||||||
|
|
||||||
|
Dictionary<string, SortedDictionary<int, TypeTreeItem>> typeMap = null;
|
||||||
if (buildClassStructuresMenuItem.Checked)
|
if (buildClassStructuresMenuItem.Checked)
|
||||||
{
|
{
|
||||||
BuildClassStructure();
|
typeMap = BuildClassStructure();
|
||||||
}
|
}
|
||||||
|
|
||||||
BeginInvoke(new Action(() =>
|
BeginInvoke(new Action(() =>
|
||||||
@ -182,7 +184,7 @@ namespace AssetStudioGUI
|
|||||||
if (buildClassStructuresMenuItem.Checked)
|
if (buildClassStructuresMenuItem.Checked)
|
||||||
{
|
{
|
||||||
classesListView.BeginUpdate();
|
classesListView.BeginUpdate();
|
||||||
foreach (var version in AllTypeMap)
|
foreach (var version in typeMap)
|
||||||
{
|
{
|
||||||
var versionGroup = new ListViewGroup(version.Key);
|
var versionGroup = new ListViewGroup(version.Key);
|
||||||
classesListView.Groups.Add(versionGroup);
|
classesListView.Groups.Add(versionGroup);
|
||||||
@ -193,6 +195,7 @@ namespace AssetStudioGUI
|
|||||||
classesListView.Items.Add(uclass.Value);
|
classesListView.Items.Add(uclass.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
typeMap.Clear();
|
||||||
classesListView.EndUpdate();
|
classesListView.EndUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,31 +302,22 @@ namespace AssetStudioGUI
|
|||||||
|
|
||||||
private void exportClassStructuresMenuItem_Click(object sender, EventArgs e)
|
private void exportClassStructuresMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (AllTypeMap.Count > 0)
|
if (classesListView.Items.Count > 0)
|
||||||
{
|
{
|
||||||
var saveFolderDialog = new OpenFolderDialog();
|
var saveFolderDialog = new OpenFolderDialog();
|
||||||
if (saveFolderDialog.ShowDialog(this) == DialogResult.OK)
|
if (saveFolderDialog.ShowDialog(this) == DialogResult.OK)
|
||||||
{
|
{
|
||||||
var count = AllTypeMap.Count;
|
var savePath = saveFolderDialog.Folder;
|
||||||
|
var count = classesListView.Items.Count;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
Progress.Reset();
|
Progress.Reset();
|
||||||
foreach (var version in AllTypeMap)
|
foreach (TypeTreeItem item in classesListView.Items)
|
||||||
{
|
{
|
||||||
var savePath = saveFolderDialog.Folder;
|
var versionPath = savePath + "\\" + item.Group.Header;
|
||||||
if (version.Value.Count > 0)
|
Directory.CreateDirectory(versionPath);
|
||||||
{
|
|
||||||
string versionPath = savePath + "\\" + version.Key;
|
|
||||||
Directory.CreateDirectory(versionPath);
|
|
||||||
|
|
||||||
foreach (var uclass in version.Value)
|
var saveFile = $"{versionPath}\\{item.SubItems[1].Text} {item.Text}.txt";
|
||||||
{
|
File.WriteAllText(saveFile, item.ToString());
|
||||||
string saveFile = $"{versionPath}\\{uclass.Key} {uclass.Value.Text}.txt";
|
|
||||||
using (var writer = new StreamWriter(saveFile))
|
|
||||||
{
|
|
||||||
writer.Write(uclass.Value.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Progress.Report(++i, count);
|
Progress.Report(++i, count);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ namespace AssetStudioGUI
|
|||||||
public static AssetsManager assetsManager = new AssetsManager();
|
public static AssetsManager assetsManager = new AssetsManager();
|
||||||
public static List<AssetItem> exportableAssets = new List<AssetItem>();
|
public static List<AssetItem> exportableAssets = new List<AssetItem>();
|
||||||
public static List<AssetItem> visibleAssets = new List<AssetItem>();
|
public static List<AssetItem> visibleAssets = new List<AssetItem>();
|
||||||
public static Dictionary<string, SortedDictionary<int, TypeTreeItem>> AllTypeMap = new Dictionary<string, SortedDictionary<int, TypeTreeItem>>(); //TODO Delete it
|
|
||||||
public static bool ModuleLoaded;
|
public static bool ModuleLoaded;
|
||||||
public static Dictionary<string, ModuleDef> LoadedModuleDic = new Dictionary<string, ModuleDef>();
|
public static Dictionary<string, ModuleDef> LoadedModuleDic = new Dictionary<string, ModuleDef>();
|
||||||
|
|
||||||
@ -38,7 +37,7 @@ namespace AssetStudioGUI
|
|||||||
extractedCount += ExtractWebDataFile(fileName, reader);
|
extractedCount += ExtractWebDataFile(fileName, reader);
|
||||||
else
|
else
|
||||||
reader.Dispose();
|
reader.Dispose();
|
||||||
Progress.Report(i + 1, fileName.Length);
|
Progress.Report(++i, fileNames.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Info($"Finished extracting {extractedCount} files.");
|
Logger.Info($"Finished extracting {extractedCount} files.");
|
||||||
@ -53,7 +52,6 @@ namespace AssetStudioGUI
|
|||||||
if (bundleFile.fileList.Count > 0)
|
if (bundleFile.fileList.Count > 0)
|
||||||
{
|
{
|
||||||
var extractPath = bundleFileName + "_unpacked\\";
|
var extractPath = bundleFileName + "_unpacked\\";
|
||||||
Directory.CreateDirectory(extractPath);
|
|
||||||
return ExtractStreamFile(extractPath, bundleFile.fileList);
|
return ExtractStreamFile(extractPath, bundleFile.fileList);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -67,7 +65,6 @@ namespace AssetStudioGUI
|
|||||||
if (webFile.fileList.Count > 0)
|
if (webFile.fileList.Count > 0)
|
||||||
{
|
{
|
||||||
var extractPath = webFileName + "_unpacked\\";
|
var extractPath = webFileName + "_unpacked\\";
|
||||||
Directory.CreateDirectory(extractPath);
|
|
||||||
return ExtractStreamFile(extractPath, webFile.fileList);
|
return ExtractStreamFile(extractPath, webFile.fileList);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -300,11 +297,12 @@ namespace AssetStudioGUI
|
|||||||
return treeNodeCollection;
|
return treeNodeCollection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BuildClassStructure()
|
public static Dictionary<string, SortedDictionary<int, TypeTreeItem>> BuildClassStructure()
|
||||||
{
|
{
|
||||||
|
var typeMap = new Dictionary<string, SortedDictionary<int, TypeTreeItem>>();
|
||||||
foreach (var assetsFile in assetsManager.assetsFileList)
|
foreach (var assetsFile in assetsManager.assetsFileList)
|
||||||
{
|
{
|
||||||
if (AllTypeMap.TryGetValue(assetsFile.unityVersion, out var curVer))
|
if (typeMap.TryGetValue(assetsFile.unityVersion, out var curVer))
|
||||||
{
|
{
|
||||||
foreach (var type in assetsFile.m_Types.Where(x => x.m_Nodes != null))
|
foreach (var type in assetsFile.m_Types.Where(x => x.m_Nodes != null))
|
||||||
{
|
{
|
||||||
@ -328,9 +326,11 @@ namespace AssetStudioGUI
|
|||||||
}
|
}
|
||||||
items.Add(key, new TypeTreeItem(key, type.m_Nodes));
|
items.Add(key, new TypeTreeItem(key, type.m_Nodes));
|
||||||
}
|
}
|
||||||
AllTypeMap.Add(assetsFile.unityVersion, items);
|
typeMap.Add(assetsFile.unityVersion, items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return typeMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string FixFileName(string str)
|
public static string FixFileName(string str)
|
||||||
|
Loading…
Reference in New Issue
Block a user