- [GUI] fix bug when building CABMap with stripped version.
- [CLI] add option to set unity version when stripped.
This commit is contained in:
@@ -31,6 +31,7 @@ namespace AssetStudioCLI
|
||||
optionsBinder.MapOp,
|
||||
optionsBinder.MapType,
|
||||
optionsBinder.MapName,
|
||||
optionsBinder.UnityVersion,
|
||||
optionsBinder.GroupAssetsType,
|
||||
optionsBinder.Model,
|
||||
optionsBinder.Key,
|
||||
@@ -57,6 +58,7 @@ namespace AssetStudioCLI
|
||||
public MapOpType MapOp { get; set; }
|
||||
public ExportListType MapType { get; set; }
|
||||
public string MapName { get; set; }
|
||||
public string UnityVersion { get; set; }
|
||||
public AssetGroupOption GroupAssetsType { get; set; }
|
||||
public bool Model { get; set; }
|
||||
public byte Key { get; set; }
|
||||
@@ -78,6 +80,7 @@ namespace AssetStudioCLI
|
||||
public readonly Option<MapOpType> MapOp;
|
||||
public readonly Option<ExportListType> MapType;
|
||||
public readonly Option<string> MapName;
|
||||
public readonly Option<string> UnityVersion;
|
||||
public readonly Option<AssetGroupOption> GroupAssetsType;
|
||||
public readonly Option<bool> Model;
|
||||
public readonly Option<byte> Key;
|
||||
@@ -99,6 +102,7 @@ namespace AssetStudioCLI
|
||||
MapOp = new Option<MapOpType>("--map_op", "Specify which map to build.");
|
||||
MapType = new Option<ExportListType>("--map_type", "AssetMap output type.");
|
||||
MapName = new Option<string>("--map_name", () => "assets_map", "Specify AssetMap file name.");
|
||||
UnityVersion = new Option<string>("--version", "Specify Unity version.");
|
||||
GroupAssetsType = new Option<AssetGroupOption>("--group_assets", "Specify how exported assets should be grouped.");
|
||||
Model = new Option<bool>("--models", "Enable to export models only");
|
||||
AIFile = new Option<FileInfo>("--ai_file", "Specify asset_index json file path (to recover GI containers).").LegalFilePathsOnly();
|
||||
@@ -188,6 +192,7 @@ namespace AssetStudioCLI
|
||||
MapOp = bindingContext.ParseResult.GetValueForOption(MapOp),
|
||||
MapType = bindingContext.ParseResult.GetValueForOption(MapType),
|
||||
MapName = bindingContext.ParseResult.GetValueForOption(MapName),
|
||||
UnityVersion = bindingContext.ParseResult.GetValueForOption(UnityVersion),
|
||||
GroupAssetsType = bindingContext.ParseResult.GetValueForOption(GroupAssetsType),
|
||||
Model = bindingContext.ParseResult.GetValueForOption(Model),
|
||||
Key = bindingContext.ParseResult.GetValueForOption(Key),
|
||||
|
||||
@@ -47,8 +47,11 @@ namespace AssetStudioCLI
|
||||
Shader.Parsable = !Settings.Default.disableShader;
|
||||
Renderer.Parsable = !Settings.Default.disableRenderer;
|
||||
AnimationClip.Parsable = !Settings.Default.disableAnimationClip;
|
||||
AssetsHelper.SetUnityVersion(o.UnityVersion);
|
||||
|
||||
assetsManager.Silent = o.Silent;
|
||||
assetsManager.Game = game;
|
||||
assetsManager.SpecifyUnityVersion = o.UnityVersion;
|
||||
ModelOnly = o.Model;
|
||||
o.Output.Create();
|
||||
|
||||
|
||||
@@ -2110,6 +2110,7 @@ namespace AssetStudioGUI
|
||||
}
|
||||
}
|
||||
|
||||
var version = assetsManager.SpecifyUnityVersion;
|
||||
var openFolderDialog = new OpenFolderDialog();
|
||||
openFolderDialog.Title = "Select Game Folder";
|
||||
if (openFolderDialog.ShowDialog(this) == DialogResult.OK)
|
||||
@@ -2117,6 +2118,7 @@ namespace AssetStudioGUI
|
||||
Logger.Info("Scanning for files...");
|
||||
var files = Directory.GetFiles(openFolderDialog.Folder, "*.*", SearchOption.AllDirectories).ToArray();
|
||||
Logger.Info($"Found {files.Length} files");
|
||||
AssetsHelper.SetUnityVersion(version);
|
||||
await Task.Run(() => AssetsHelper.BuildCABMap(files, name, openFolderDialog.Folder, Studio.Game));
|
||||
}
|
||||
InvokeUpdate(miscToolStripMenuItem, true);
|
||||
@@ -2164,6 +2166,7 @@ namespace AssetStudioGUI
|
||||
}
|
||||
}
|
||||
|
||||
var version = assetsManager.SpecifyUnityVersion;
|
||||
var openFolderDialog = new OpenFolderDialog();
|
||||
openFolderDialog.Title = "Select Game Folder";
|
||||
if (openFolderDialog.ShowDialog(this) == DialogResult.OK)
|
||||
@@ -2187,6 +2190,7 @@ namespace AssetStudioGUI
|
||||
}
|
||||
}
|
||||
saveDirectoryBackup = saveFolderDialog.Folder;
|
||||
AssetsHelper.SetUnityVersion(version);
|
||||
await Task.Run(() => AssetsHelper.BuildBoth(files, name, openFolderDialog.Folder, Studio.Game, saveFolderDialog.Folder, exportListType));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user