mirror of
https://github.com/Siccity/xNode.git
synced 2026-02-10 17:18:44 +08:00
Merge pull request #80 from Siccity/revert-79-TriggerRenameViaKeyboard
Revert "Allow to trigger renames via F2 key"
This commit is contained in:
commit
e2549808cc
@ -40,20 +40,9 @@ namespace XNodeEditor {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GUILayout.Label(title, NodeEditorResources.styles.nodeHeader, GUILayout.Height(30));
|
GUILayout.Label(title, NodeEditorResources.styles.nodeHeader, GUILayout.Height(30));
|
||||||
if (HasFocus() && IsRenameKeyPressed()) {
|
|
||||||
InitiateRename();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasFocus() {
|
|
||||||
return Selection.activeObject == this.target;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsRenameKeyPressed() {
|
|
||||||
return (Event.current != null && Event.current.isKey && Event.current.keyCode == KeyCode.F2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary> Draws standard field editors for all public fields </summary>
|
/// <summary> Draws standard field editors for all public fields </summary>
|
||||||
public virtual void OnBodyGUI() {
|
public virtual void OnBodyGUI() {
|
||||||
// Unity specifically requires this to save/update any serial object.
|
// Unity specifically requires this to save/update any serial object.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user