Transfer detail panel to resource browser.
This commit is contained in:
@@ -7,8 +7,14 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace Cryville.Crtr.Browsing.UI {
|
namespace Cryville.Crtr.Browsing.UI {
|
||||||
public class PathedResourceBrowser : ResourceBrowser {
|
public class PathedResourceBrowser : ResourceBrowser {
|
||||||
|
[SerializeField]
|
||||||
|
ScrollableItemGrid m_itemContainer;
|
||||||
|
[SerializeField]
|
||||||
|
DetailPanel m_detailPanel;
|
||||||
|
[SerializeField]
|
||||||
|
GameObject m_actionBar;
|
||||||
|
|
||||||
public IPathedResourceManager<ChartDetail> ResourceManager;
|
public IPathedResourceManager<ChartDetail> ResourceManager;
|
||||||
public ScrollableItemGrid ItemContainer;
|
|
||||||
|
|
||||||
readonly HashSet<int> _selectedItems = new HashSet<int>();
|
readonly HashSet<int> _selectedItems = new HashSet<int>();
|
||||||
readonly Dictionary<int, BrowserItem> _items = new Dictionary<int, BrowserItem>();
|
readonly Dictionary<int, BrowserItem> _items = new Dictionary<int, BrowserItem>();
|
||||||
@@ -17,7 +23,7 @@ namespace Cryville.Crtr.Browsing.UI {
|
|||||||
FileDialog _dialog;
|
FileDialog _dialog;
|
||||||
|
|
||||||
protected virtual void Start() {
|
protected virtual void Start() {
|
||||||
ItemContainer.LoadItem = LoadItem;
|
m_itemContainer.LoadItem = LoadItem;
|
||||||
ResourceManager.ItemChanged += OnItemChanged;
|
ResourceManager.ItemChanged += OnItemChanged;
|
||||||
ResourceManager.ChangeDirectory(new string[] { "" });
|
ResourceManager.ChangeDirectory(new string[] { "" });
|
||||||
InitDialog();
|
InitDialog();
|
||||||
@@ -47,7 +53,7 @@ namespace Cryville.Crtr.Browsing.UI {
|
|||||||
_itemChanged = false;
|
_itemChanged = false;
|
||||||
_selectedItems.Clear();
|
_selectedItems.Clear();
|
||||||
_items.Clear();
|
_items.Clear();
|
||||||
ItemContainer.ItemCount = ResourceManager.Count;
|
m_itemContainer.ItemCount = ResourceManager.Count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +79,8 @@ namespace Cryville.Crtr.Browsing.UI {
|
|||||||
_selectedItems.Clear();
|
_selectedItems.Clear();
|
||||||
_items[id].OnSelect();
|
_items[id].OnSelect();
|
||||||
_selectedItems.Add(id);
|
_selectedItems.Add(id);
|
||||||
Master.ShowDetail(id, ResourceManager[id]);
|
m_detailPanel.Load(id, ResourceManager[id]);
|
||||||
|
m_actionBar.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPathClicked(int index) {
|
public void OnPathClicked(int index) {
|
||||||
|
|||||||
@@ -4,14 +4,9 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
using UnityEngine.UI;
|
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing.UI {
|
namespace Cryville.Crtr.Browsing.UI {
|
||||||
public class ResourceBrowserMaster : MonoBehaviour {
|
public class ResourceBrowserMaster : MonoBehaviour {
|
||||||
[SerializeField]
|
|
||||||
Button m_playButton;
|
|
||||||
[SerializeField]
|
|
||||||
Button m_configButton;
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
ConfigPanelMaster m_configPanel;
|
ConfigPanelMaster m_configPanel;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
@@ -22,8 +17,6 @@ namespace Cryville.Crtr.Browsing.UI {
|
|||||||
PathedResourceBrowser m_mainBrowser;
|
PathedResourceBrowser m_mainBrowser;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
SettingsBrowser m_settingsBrowser;
|
SettingsBrowser m_settingsBrowser;
|
||||||
[SerializeField]
|
|
||||||
DetailPanel m_detailPanel;
|
|
||||||
|
|
||||||
BrowserTab _currentTab;
|
BrowserTab _currentTab;
|
||||||
readonly Dictionary<BrowserTab, ResourceBrowser> _tabs = new Dictionary<BrowserTab, ResourceBrowser>();
|
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() {
|
public bool Back() {
|
||||||
// if (_slideDest == 0) return false;
|
return true; // TODO
|
||||||
// SlideIntoView(_slideDest - 1);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Open(int id, ChartDetail detail) {
|
public void Open(int id, ChartDetail detail) {
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0.5, y: 0.000017056373}
|
m_AnchoredPosition: {x: 0.5, y: 0.000040507814}
|
||||||
m_SizeDelta: {x: 1, y: 560}
|
m_SizeDelta: {x: 1, y: 560}
|
||||||
m_Pivot: {x: 0.5, y: 1}
|
m_Pivot: {x: 0.5, y: 1}
|
||||||
--- !u!114 &17676803
|
--- !u!114 &17676803
|
||||||
@@ -234,7 +234,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!224 &92937984
|
--- !u!224 &92937984
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -254,7 +254,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 1, y: 0}
|
m_AnchorMin: {x: 1, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 193.78482, y: 0}
|
m_SizeDelta: {x: 198.26378, y: 0}
|
||||||
m_Pivot: {x: 1, y: 0.5}
|
m_Pivot: {x: 1, y: 0.5}
|
||||||
--- !u!114 &92937985
|
--- !u!114 &92937985
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -395,7 +395,7 @@ RectTransform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 685305717}
|
m_Father: {fileID: 1159030050}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0.45}
|
m_AnchorMin: {x: 0.5, y: 0.45}
|
||||||
@@ -491,8 +491,8 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 187.952, y: -65.587204}
|
m_AnchoredPosition: {x: 187.76016, y: -62.336044}
|
||||||
m_SizeDelta: {x: 359.904, y: 91.1744}
|
m_SizeDelta: {x: 359.52032, y: 92.67209}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!114 &155473692
|
--- !u!114 &155473692
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -656,15 +656,12 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 1c6c8bc301408004a904079721302722, type: 3}
|
m_Script: {fileID: 11500000, guid: 1c6c8bc301408004a904079721302722, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_playButton: {fileID: 92937986}
|
|
||||||
m_configButton: {fileID: 92937986}
|
|
||||||
m_configPanel: {fileID: 0}
|
m_configPanel: {fileID: 0}
|
||||||
m_tabContainer: {fileID: 1748260183}
|
m_tabContainer: {fileID: 1748260183}
|
||||||
m_tabPrefab: {fileID: 1950821458490172551, guid: 21929f2cd75aeaf4190f37571e8e5ff0,
|
m_tabPrefab: {fileID: 1950821458490172551, guid: 21929f2cd75aeaf4190f37571e8e5ff0,
|
||||||
type: 3}
|
type: 3}
|
||||||
m_mainBrowser: {fileID: 995942989}
|
m_mainBrowser: {fileID: 995942989}
|
||||||
m_settingsBrowser: {fileID: 1605906482}
|
m_settingsBrowser: {fileID: 1605906482}
|
||||||
m_detailPanel: {fileID: 1177404488}
|
|
||||||
--- !u!1 &166455782
|
--- !u!1 &166455782
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1076,7 +1073,7 @@ RectTransform:
|
|||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1679145018}
|
- {fileID: 1679145018}
|
||||||
m_Father: {fileID: 685305717}
|
m_Father: {fileID: 685305717}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
@@ -1885,12 +1882,11 @@ RectTransform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 142941876}
|
|
||||||
- {fileID: 261332917}
|
- {fileID: 261332917}
|
||||||
m_Father: {fileID: 1159030050}
|
m_Father: {fileID: 1159030050}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0.1}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
@@ -2465,7 +2461,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: -599.2}
|
||||||
m_Pivot: {x: 0.5, y: 1}
|
m_Pivot: {x: 0.5, y: 1}
|
||||||
--- !u!114 &820038725
|
--- !u!114 &820038725
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -2729,7 +2725,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0.4, y: 1}
|
m_AnchorMin: {x: 0.4, y: 1}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 255.93599}
|
m_SizeDelta: {x: 0, y: 255.68022}
|
||||||
m_Pivot: {x: 0.5, y: 1}
|
m_Pivot: {x: 0.5, y: 1}
|
||||||
--- !u!114 &969586384
|
--- !u!114 &969586384
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -2898,7 +2894,9 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_icon: {fileID: 21300000, guid: faee4ec2120f8a142b33d1a2956c39ca, type: 3}
|
m_icon: {fileID: 21300000, guid: faee4ec2120f8a142b33d1a2956c39ca, type: 3}
|
||||||
ItemContainer: {fileID: 17676803}
|
m_itemContainer: {fileID: 17676803}
|
||||||
|
m_detailPanel: {fileID: 1177404488}
|
||||||
|
m_actionBar: {fileID: 1514109545}
|
||||||
--- !u!1 &1040642968
|
--- !u!1 &1040642968
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -3003,8 +3001,8 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 187.952, y: -179.5552}
|
m_AnchoredPosition: {x: 187.76016, y: -178.17615}
|
||||||
m_SizeDelta: {x: 359.904, y: 136.7616}
|
m_SizeDelta: {x: 359.52032, y: 139.00813}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!114 &1058086875
|
--- !u!114 &1058086875
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -3476,6 +3474,7 @@ RectTransform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
|
- {fileID: 142941876}
|
||||||
- {fileID: 685305717}
|
- {fileID: 685305717}
|
||||||
- {fileID: 1514109546}
|
- {fileID: 1514109546}
|
||||||
m_Father: {fileID: 1177404487}
|
m_Father: {fileID: 1177404487}
|
||||||
@@ -3971,7 +3970,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!224 &1514109546
|
--- !u!224 &1514109546
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -3986,7 +3985,7 @@ RectTransform:
|
|||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 92937984}
|
- {fileID: 92937984}
|
||||||
m_Father: {fileID: 1159030050}
|
m_Father: {fileID: 1159030050}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 2
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 0.1}
|
m_AnchorMax: {x: 1, y: 0.1}
|
||||||
@@ -4562,7 +4561,7 @@ MonoBehaviour:
|
|||||||
m_faceColor:
|
m_faceColor:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
rgba: 4294967295
|
rgba: 4294967295
|
||||||
m_fontSize: 28.9
|
m_fontSize: 29.55
|
||||||
m_fontSizeBase: 14
|
m_fontSizeBase: 14
|
||||||
m_fontWeight: 400
|
m_fontWeight: 400
|
||||||
m_enableAutoSizing: 1
|
m_enableAutoSizing: 1
|
||||||
@@ -4831,7 +4830,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0.4, y: 1}
|
m_AnchorMax: {x: 0.4, y: 1}
|
||||||
m_AnchoredPosition: {x: 16, y: -16}
|
m_AnchoredPosition: {x: 16, y: -16}
|
||||||
m_SizeDelta: {x: -24, y: 231.93599}
|
m_SizeDelta: {x: -24, y: 231.68022}
|
||||||
m_Pivot: {x: 0, y: 1}
|
m_Pivot: {x: 0, y: 1}
|
||||||
--- !u!114 &2023419203
|
--- !u!114 &2023419203
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -4922,7 +4921,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 1279.9999, y: 720}
|
m_SizeDelta: {x: 1278.7499, y: 720}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!114 &2025096960
|
--- !u!114 &2025096960
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|||||||
Reference in New Issue
Block a user