Excludes import action in self browser.

This commit is contained in:
2023-11-29 22:07:23 +08:00
parent 700af29e43
commit b39428aa39

View File

@@ -24,6 +24,7 @@ namespace Cryville.Crtr.Browsing.UI {
IPathedResourceManager<IResourceMeta> _manager;
IResourceAction _importAction;
readonly IResourceAction[] _importActionArray = new IResourceAction[1];
readonly HashSet<int> _selectedItems = new HashSet<int>();
readonly Dictionary<int, BrowserItem> _items = new Dictionary<int, BrowserItem>();
@@ -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) {