1.8.5: Marking history elements as favorites will move them to the top of the list
This commit is contained in:
parent
5a2dcf3619
commit
959f012d80
7 changed files with 148 additions and 29 deletions
|
|
@ -48,33 +48,47 @@ namespace Module.NavigationTool.Editor.History
|
|||
viewSearchList.Draw(this, rectList, styles);
|
||||
|
||||
HandleClickEvent();
|
||||
|
||||
if (Event.current.type == EventType.Repaint && position.Contains(Event.current.mousePosition))
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void HandleClickEvent()
|
||||
{
|
||||
if (!EditorHistoryGUIUtility.isClicked)
|
||||
return;
|
||||
|
||||
|
||||
EditorHistoryList editorHistoryList = EditorHistoryUtility.GetHistoryList();
|
||||
Object obj = editorHistoryList.GetObject(EditorHistoryGUIUtility.currentEntry);
|
||||
|
||||
if (obj != null)
|
||||
|
||||
if (EditorHistoryGUIUtility.isPinClicked)
|
||||
{
|
||||
if (EditorHistoryGUIUtility.isDoubleClick)
|
||||
{
|
||||
AssetDatabase.OpenAsset(obj);
|
||||
}
|
||||
if (EditorHistoryGUIUtility.isCurrentEntryPinned)
|
||||
editorHistoryList.Unpin(EditorHistoryGUIUtility.currentEntry);
|
||||
else
|
||||
editorHistoryList.Pin(EditorHistoryGUIUtility.currentEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
Object obj = editorHistoryList.GetObject(EditorHistoryGUIUtility.currentEntry);
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
EditorHistoryListPostProcess.IgnoreNextSelectionChange();
|
||||
if (EditorHistoryGUIUtility.isDoubleClick)
|
||||
{
|
||||
AssetDatabase.OpenAsset(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorHistoryListPostProcess.IgnoreNextSelectionChange();
|
||||
|
||||
if (EditorHistoryPrefs.IsSetAsActiveObjectEnabled)
|
||||
Selection.activeObject = obj;
|
||||
if (EditorHistoryPrefs.IsSetAsActiveObjectEnabled)
|
||||
Selection.activeObject = obj;
|
||||
|
||||
EditorGUIUtility.PingObject(obj);
|
||||
EditorGUIUtility.PingObject(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EditorHistoryGUIUtility.Used();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue