Transfer detail panel to resource browser.
This commit is contained in:
@@ -7,8 +7,14 @@ using UnityEngine;
|
||||
|
||||
namespace Cryville.Crtr.Browsing.UI {
|
||||
public class PathedResourceBrowser : ResourceBrowser {
|
||||
[SerializeField]
|
||||
ScrollableItemGrid m_itemContainer;
|
||||
[SerializeField]
|
||||
DetailPanel m_detailPanel;
|
||||
[SerializeField]
|
||||
GameObject m_actionBar;
|
||||
|
||||
public IPathedResourceManager<ChartDetail> ResourceManager;
|
||||
public ScrollableItemGrid ItemContainer;
|
||||
|
||||
readonly HashSet<int> _selectedItems = new HashSet<int>();
|
||||
readonly Dictionary<int, BrowserItem> _items = new Dictionary<int, BrowserItem>();
|
||||
@@ -17,7 +23,7 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
FileDialog _dialog;
|
||||
|
||||
protected virtual void Start() {
|
||||
ItemContainer.LoadItem = LoadItem;
|
||||
m_itemContainer.LoadItem = LoadItem;
|
||||
ResourceManager.ItemChanged += OnItemChanged;
|
||||
ResourceManager.ChangeDirectory(new string[] { "" });
|
||||
InitDialog();
|
||||
@@ -47,7 +53,7 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
_itemChanged = false;
|
||||
_selectedItems.Clear();
|
||||
_items.Clear();
|
||||
ItemContainer.ItemCount = ResourceManager.Count;
|
||||
m_itemContainer.ItemCount = ResourceManager.Count;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +79,8 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
_selectedItems.Clear();
|
||||
_items[id].OnSelect();
|
||||
_selectedItems.Add(id);
|
||||
Master.ShowDetail(id, ResourceManager[id]);
|
||||
m_detailPanel.Load(id, ResourceManager[id]);
|
||||
m_actionBar.SetActive(true);
|
||||
}
|
||||
|
||||
public void OnPathClicked(int index) {
|
||||
|
@@ -4,14 +4,9 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Cryville.Crtr.Browsing.UI {
|
||||
public class ResourceBrowserMaster : MonoBehaviour {
|
||||
[SerializeField]
|
||||
Button m_playButton;
|
||||
[SerializeField]
|
||||
Button m_configButton;
|
||||
[SerializeField]
|
||||
ConfigPanelMaster m_configPanel;
|
||||
[SerializeField]
|
||||
@@ -22,8 +17,6 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
PathedResourceBrowser m_mainBrowser;
|
||||
[SerializeField]
|
||||
SettingsBrowser m_settingsBrowser;
|
||||
[SerializeField]
|
||||
DetailPanel m_detailPanel;
|
||||
|
||||
BrowserTab _currentTab;
|
||||
readonly Dictionary<BrowserTab, ResourceBrowser> _tabs = new Dictionary<BrowserTab, ResourceBrowser>();
|
||||
@@ -57,17 +50,8 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowDetail(int id, ChartDetail detail) {
|
||||
// SlideIntoView(1);
|
||||
m_detailPanel.Load(id, detail);
|
||||
m_playButton.gameObject.SetActive(true);
|
||||
m_configButton.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public bool Back() {
|
||||
// if (_slideDest == 0) return false;
|
||||
// SlideIntoView(_slideDest - 1);
|
||||
return true;
|
||||
return true; // TODO
|
||||
}
|
||||
|
||||
public void Open(int id, ChartDetail detail) {
|
||||
|
Reference in New Issue
Block a user