Use actions in resource browser.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Cryville.Common.Unity;
|
||||
using Cryville.Common.Unity.UI;
|
||||
using Cryville.Crtr.Browsing.Actions;
|
||||
using Cryville.Crtr.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -19,6 +20,7 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
GameObject m_actionBar;
|
||||
|
||||
IPathedResourceManager<ChartDetail> _manager;
|
||||
IResourceAction _importAction;
|
||||
|
||||
readonly HashSet<int> _selectedItems = new HashSet<int>();
|
||||
readonly Dictionary<int, BrowserItem> _items = new Dictionary<int, BrowserItem>();
|
||||
@@ -34,6 +36,7 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
UnregisterManager();
|
||||
}
|
||||
void UnregisterManager() {
|
||||
Master.Actions.Unregister(_importAction);
|
||||
_manager.ItemChanged -= OnItemChanged;
|
||||
_manager.DirectoryChanged -= OnDirectoryChanged;
|
||||
}
|
||||
@@ -53,6 +56,7 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
_manager = manager;
|
||||
_manager.ItemChanged += OnItemChanged;
|
||||
_manager.DirectoryChanged += OnDirectoryChanged;
|
||||
Master.Actions.Register(_importAction = new ImportResourceAction(_manager));
|
||||
|
||||
OnItemChanged();
|
||||
OnDirectoryChanged();
|
||||
|
Reference in New Issue
Block a user