Add path text and write tools in pathed resource browser.
This commit is contained in:
@@ -12,6 +12,10 @@ using UnityEngine.UI;
|
||||
|
||||
namespace Cryville.Crtr.Browsing.UI {
|
||||
public class PathedResourceBrowser : ResourceBrowser {
|
||||
[SerializeField]
|
||||
Button[] m_writeTools;
|
||||
[SerializeField]
|
||||
TextMeshProUGUI m_pathText;
|
||||
[SerializeField]
|
||||
ScrollableItemGrid m_itemContainer;
|
||||
[SerializeField]
|
||||
@@ -57,6 +61,7 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
_manager.ItemChanged += OnItemChanged;
|
||||
_manager.DirectoryChanged += OnDirectoryChanged;
|
||||
Master.Actions.Register(_importAction = new ImportResourceAction(_manager));
|
||||
foreach (var tool in m_writeTools) tool.interactable = !_manager.IsReadOnly;
|
||||
|
||||
OnItemChanged();
|
||||
OnDirectoryChanged();
|
||||
@@ -67,6 +72,8 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
_itemChanged = true;
|
||||
}
|
||||
void OnDirectoryChanged() {
|
||||
if (_manager.CurrentDirectory.Count == 0) m_pathText.text = "(Home)";
|
||||
else m_pathText.text = string.Join(Path.DirectorySeparatorChar, _manager.CurrentDirectory);
|
||||
}
|
||||
void Update() {
|
||||
if (_itemChanged) {
|
||||
|
Reference in New Issue
Block a user