Skip to content

Commit

Permalink
Minor UI improvments & bugfixes
Browse files Browse the repository at this point in the history
- improved "Copy text" option in right click menu, to display what exactly to copy
- added "Dump selected assets" option to right click menu
- added 'selected assets count' info to status strip when you select assets
- added 'exported count / total export count` info to status strip during export
- "Show error message" option on the "Debug" tab renamed to "Show all error messages" and is now disabled by default
- "fixed" an issue with getting stuck during the "Building tree structure" step
- fixed a bug with listSearch that could make it not work in some conditions
- fixed a rare bug for resource files with the same name, that caused their data to be overwritten and become incorrect
  • Loading branch information
aelurum committed Nov 24, 2021
1 parent 792850d commit 19c6c5f
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 176 deletions.
4 changes: 2 additions & 2 deletions AssetStudio/AssetsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ private void LoadBundleFile(FileReader reader, string originalPath = null)
{
LoadAssetsFromMemory(subReader, originalPath ?? reader.FullPath, bundleFile.m_Header.unityRevision);
}
else
else if (!resourceFileReaders.ContainsKey(file.fileName))
{
resourceFileReaders[file.fileName] = subReader; //TODO
resourceFileReaders.Add(file.fileName, subReader);
}
}
}
Expand Down
216 changes: 113 additions & 103 deletions AssetStudioGUI/AssetStudioGUIForm.Designer.cs

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion AssetStudioGUI/AssetStudioGUIForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,8 @@ private void ResetForm()
reverseSort = false;
enableFiltering = false;
listSearch.Text = " Filter ";
if (tabControl1.SelectedIndex == 1)
assetListView.Select();

var count = filterTypeToolStripMenuItem.DropDownItems.Count;
for (var i = 1; i < count; i++)
Expand Down Expand Up @@ -1275,7 +1277,10 @@ private void assetListView_MouseClick(object sender, MouseEventArgs e)
}
}

tempClipboard = assetListView.HitTest(new Point(e.X, e.Y)).SubItem.Text;
var selectedElement = assetListView.HitTest(new Point(e.X, e.Y));
var subItemIndex = selectedElement.Item.SubItems.IndexOf(selectedElement.SubItem);
tempClipboard = selectedElement.SubItem.Text;
copyToolStripMenuItem.Text = $"Copy {assetListView.Columns[subItemIndex].Text}";
contextMenuStrip1.Show(assetListView, e.X, e.Y);
}
}
Expand All @@ -1290,6 +1295,11 @@ private void exportSelectedAssetsToolStripMenuItem_Click(object sender, EventArg
ExportAssets(ExportFilter.Selected, ExportType.Convert);
}

private void dumpSelectedAssetsToolStripMenuItem_Click(object sender, EventArgs e)
{
ExportAssets(ExportFilter.Selected, ExportType.Dump);
}

private void showOriginalFileToolStripMenuItem_Click(object sender, EventArgs e)
{
var selectasset = (AssetItem)assetListView.Items[assetListView.SelectedIndices[0]];
Expand Down Expand Up @@ -1494,6 +1504,18 @@ private void exportAllObjectssplitToolStripMenuItem1_Click(object sender, EventA
}
}

private void assetListView_SelectedIndexChanged(object sender, EventArgs e)
{
if (assetListView.SelectedIndices.Count > 1)
StatusStripUpdate($"Selected {assetListView.SelectedIndices.Count} assets.");
}

private void assetListView_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e)
{
if (assetListView.SelectedIndices.Count > 1)
StatusStripUpdate($"Selected {assetListView.SelectedIndices.Count} assets.");
}

private List<AssetItem> GetSelectedAssets()
{
var selectedAssets = new List<AssetItem>(assetListView.SelectedIndices.Count);
Expand Down
2 changes: 1 addition & 1 deletion AssetStudioGUI/Components/TreeViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void HideCheckBox(this TreeNode node)
hItem = node.Handle,
mask = TVIF_STATE,
stateMask = TVIS_STATEIMAGEMASK,
state = 0
state = TVIS_STATEIMAGEMASK //temp bugfix for an issue with getting stuck during the "Building tree structure" step
};
SendMessage(node.TreeView.Handle, TVM_SETITEM, IntPtr.Zero, ref tvi);
}
Expand Down
134 changes: 67 additions & 67 deletions AssetStudioGUI/ExportOptions.Designer.cs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions AssetStudioGUI/ExportOptions.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,7 @@
<metadata name="exportUvsTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="exportUvsTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
2 changes: 1 addition & 1 deletion AssetStudioGUI/GUILogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace AssetStudioGUI
{
class GUILogger : ILogger
{
public bool ShowErrorMessage = true;
public bool ShowErrorMessage = false;
private Action<string> action;

public GUILogger(Action<string> action)
Expand Down
2 changes: 1 addition & 1 deletion AssetStudioGUI/Studio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public static void ExportAssets(string savePath, List<AssetItem> toExportAssets,
break;
}
exportPath += Path.DirectorySeparatorChar;
StatusStripUpdate($"Exporting {asset.TypeString}: {asset.Text}");
StatusStripUpdate($"[{exportedCount}/{toExportCount}] Exporting {asset.TypeString}: {asset.Text}");
try
{
switch (exportType)
Expand Down

0 comments on commit 19c6c5f

Please sign in to comment.