mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-15 19:28:48 -05:00
[GUI] Add "Show parent Texture2D asset" option for sprites in Asset List
This commit is contained in:
+12
-1
@@ -177,6 +177,7 @@
|
|||||||
this.exportL2DWithFadeLstToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.exportL2DWithFadeLstToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.exportL2DWithFadeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.exportL2DWithFadeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.exportL2DWithClipsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.exportL2DWithClipsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.showParentTexture2DToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.goToSceneHierarchyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.goToSceneHierarchyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.showOriginalFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.showOriginalFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.dumpTreeViewContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
this.dumpTreeViewContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
@@ -1611,10 +1612,11 @@
|
|||||||
this.exportL2DWithFadeLstToolStripMenuItem,
|
this.exportL2DWithFadeLstToolStripMenuItem,
|
||||||
this.exportL2DWithFadeToolStripMenuItem,
|
this.exportL2DWithFadeToolStripMenuItem,
|
||||||
this.exportL2DWithClipsToolStripMenuItem,
|
this.exportL2DWithClipsToolStripMenuItem,
|
||||||
|
this.showParentTexture2DToolStripMenuItem,
|
||||||
this.goToSceneHierarchyToolStripMenuItem,
|
this.goToSceneHierarchyToolStripMenuItem,
|
||||||
this.showOriginalFileToolStripMenuItem});
|
this.showOriginalFileToolStripMenuItem});
|
||||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||||
this.contextMenuStrip1.Size = new System.Drawing.Size(332, 224);
|
this.contextMenuStrip1.Size = new System.Drawing.Size(332, 246);
|
||||||
//
|
//
|
||||||
// copyToolStripMenuItem
|
// copyToolStripMenuItem
|
||||||
//
|
//
|
||||||
@@ -1677,6 +1679,14 @@
|
|||||||
this.exportL2DWithClipsToolStripMenuItem.Visible = false;
|
this.exportL2DWithClipsToolStripMenuItem.Visible = false;
|
||||||
this.exportL2DWithClipsToolStripMenuItem.Click += new System.EventHandler(this.exportSelectedL2DWithClips_Click);
|
this.exportL2DWithClipsToolStripMenuItem.Click += new System.EventHandler(this.exportSelectedL2DWithClips_Click);
|
||||||
//
|
//
|
||||||
|
// showParentTexture2DToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.showParentTexture2DToolStripMenuItem.Name = "showParentTexture2DToolStripMenuItem";
|
||||||
|
this.showParentTexture2DToolStripMenuItem.Size = new System.Drawing.Size(331, 22);
|
||||||
|
this.showParentTexture2DToolStripMenuItem.Text = "Show parent Texture2D asset";
|
||||||
|
this.showParentTexture2DToolStripMenuItem.Visible = false;
|
||||||
|
this.showParentTexture2DToolStripMenuItem.Click += new System.EventHandler(this.showParentTexture2DToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// goToSceneHierarchyToolStripMenuItem
|
// goToSceneHierarchyToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.goToSceneHierarchyToolStripMenuItem.Name = "goToSceneHierarchyToolStripMenuItem";
|
this.goToSceneHierarchyToolStripMenuItem.Name = "goToSceneHierarchyToolStripMenuItem";
|
||||||
@@ -1953,6 +1963,7 @@
|
|||||||
private System.Windows.Forms.ToolStripMenuItem jsonDumpSelectToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem jsonDumpSelectToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem jsonDumpFilterToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem jsonDumpFilterToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem showAssetDebugInfoToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem showAssetDebugInfoToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem showParentTexture2DToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1668,6 +1668,7 @@ namespace AssetStudioGUI
|
|||||||
if (e.Button == MouseButtons.Right && assetListView.SelectedIndices.Count > 0)
|
if (e.Button == MouseButtons.Right && assetListView.SelectedIndices.Count > 0)
|
||||||
{
|
{
|
||||||
goToSceneHierarchyToolStripMenuItem.Visible = false;
|
goToSceneHierarchyToolStripMenuItem.Visible = false;
|
||||||
|
showParentTexture2DToolStripMenuItem.Visible = false;
|
||||||
showOriginalFileToolStripMenuItem.Visible = false;
|
showOriginalFileToolStripMenuItem.Visible = false;
|
||||||
exportAnimatorWithSelectedAnimationClipMenuItem.Visible = false;
|
exportAnimatorWithSelectedAnimationClipMenuItem.Visible = false;
|
||||||
exportAsLive2DModelToolStripMenuItem.Visible = false;
|
exportAsLive2DModelToolStripMenuItem.Visible = false;
|
||||||
@@ -1689,6 +1690,9 @@ namespace AssetStudioGUI
|
|||||||
{
|
{
|
||||||
switch (asset.Asset)
|
switch (asset.Asset)
|
||||||
{
|
{
|
||||||
|
case Sprite _ when assetListView.SelectedIndices.Count == 1:
|
||||||
|
showParentTexture2DToolStripMenuItem.Visible = true;
|
||||||
|
break;
|
||||||
case MonoBehaviour m_MonoBehaviour:
|
case MonoBehaviour m_MonoBehaviour:
|
||||||
if (Studio.l2dAssetsManager.ModelDict.Count > 0)
|
if (Studio.l2dAssetsManager.ModelDict.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -1884,14 +1888,28 @@ namespace AssetStudioGUI
|
|||||||
|
|
||||||
private void goToSceneHierarchyToolStripMenuItem_Click(object sender, EventArgs e)
|
private void goToSceneHierarchyToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var selectAsset = (AssetItem)assetListView.Items[assetListView.SelectedIndices[0]];
|
var selectedAsset = (AssetItem)assetListView.Items[assetListView.SelectedIndices[0]];
|
||||||
if (selectAsset.TreeNode != null)
|
if (selectedAsset.TreeNode != null)
|
||||||
{
|
{
|
||||||
sceneTreeView.SelectedNode = selectAsset.TreeNode;
|
sceneTreeView.SelectedNode = selectedAsset.TreeNode;
|
||||||
tabControl1.SelectedTab = tabPage1;
|
tabControl1.SelectedTab = tabPage1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showParentTexture2DToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var selectedAsset = (AssetItem)assetListView.Items[assetListView.SelectedIndices[0]];
|
||||||
|
var spriteConverter = new SpriteConverter((Sprite)selectedAsset.Asset);
|
||||||
|
var textureAsset = visibleAssets.Find(x => x.Type == ClassIDType.Texture2D && x.m_PathID == spriteConverter.m_Texture2D.m_PathID);
|
||||||
|
if (textureAsset != null)
|
||||||
|
{
|
||||||
|
var listViewItem = assetListView.Items[assetListView.Items.IndexOf(textureAsset)];
|
||||||
|
assetListView.SelectedIndices.Clear();
|
||||||
|
listViewItem.Selected = true;
|
||||||
|
listViewItem.EnsureVisible();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static ExportFilter GetExportFilterFromTag(string tag)
|
private static ExportFilter GetExportFilterFromTag(string tag)
|
||||||
{
|
{
|
||||||
switch (tag)
|
switch (tag)
|
||||||
|
|||||||
Reference in New Issue
Block a user