From b39428aa39fa9c40ecc60704ca433ec97b9fb148 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Wed, 29 Nov 2023 22:07:23 +0800 Subject: [PATCH] Excludes import action in self browser. --- Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs b/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs index 1fff293..8a6e26d 100644 --- a/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs +++ b/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs @@ -24,6 +24,7 @@ namespace Cryville.Crtr.Browsing.UI { IPathedResourceManager _manager; IResourceAction _importAction; + readonly IResourceAction[] _importActionArray = new IResourceAction[1]; readonly HashSet _selectedItems = new HashSet(); readonly Dictionary _items = new Dictionary(); @@ -56,6 +57,7 @@ namespace Cryville.Crtr.Browsing.UI { _manager.ItemChanged += OnItemChanged; _manager.DirectoryChanged += OnDirectoryChanged; Master.Actions.Register(_importAction = new ImportResourceAction(_manager)); + _importActionArray[0] = _importAction; foreach (var tool in m_writeTools) tool.interactable = !_manager.IsReadOnly; OnItemChanged(); @@ -101,7 +103,7 @@ namespace Cryville.Crtr.Browsing.UI { _selectedItems.Add(id); var res = _manager[id]; m_detailPanel.Load(res); - m_actionBar.Load(this, Master.Actions.GetActions(res.GetType())); + m_actionBar.Load(this, Master.Actions.GetActions(res.GetType()).Except(_importActionArray)); } public void OnPathClicked(int index) {