From bb0ca985cda6670ad8f68f91cda379d69181fdea Mon Sep 17 00:00:00 2001 From: PopSlime Date: Wed, 29 Nov 2023 22:24:06 +0800 Subject: [PATCH] Fix import resource action registered for read-only browsers. --- Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs b/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs index efbaec2..ff5ed49 100644 --- a/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs +++ b/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs @@ -57,8 +57,10 @@ namespace Cryville.Crtr.Browsing.UI { _manager = manager; _manager.ItemChanged += OnItemChanged; _manager.DirectoryChanged += OnDirectoryChanged; - Master.Actions.Register(_importAction = new ImportResourceAction(_manager)); - _importActionArray[0] = _importAction; + if (!_manager.IsReadOnly) { + Master.Actions.Register(_importAction = new ImportResourceAction(_manager)); + _importActionArray[0] = _importAction; + } foreach (var tool in m_writeTools) tool.interactable = !_manager.IsReadOnly; OnEnable();