static public void DoAddVariable(Rect position, string currentHandlerName, Flowchart flowchart) { curFlowchart = flowchart; if (!FungusEditorPreferences.useLegacyMenus) { //new method VariableSelectPopupWindowContent win = new VariableSelectPopupWindowContent(currentHandlerName, POPUP_WIDTH, POPUP_HEIGHT); PopupWindow.Show(position, win); } //old method DoOlderMenu(flowchart); }
private void DoRightClickMenu(int index) { var v = GetVarAt(index); GenericMenu commandMenu = new GenericMenu(); commandMenu.AddItem(new GUIContent("Remove"), false, () => { list.index = index; RemoveItem(list); }); commandMenu.AddItem(new GUIContent("Duplicate"), false, () => VariableSelectPopupWindowContent.AddVariable(v.GetType(), v.Key)); commandMenu.AddItem(new GUIContent("Find References"), false, () => FindUsage(GetVarAt(index))); commandMenu.AddSeparator(""); commandMenu.AddItem(new GUIContent("Sort by Name"), false, () => SortBy(x => x.Key)); commandMenu.AddItem(new GUIContent("Sort by Type"), false, () => SortBy(x => x.GetType().Name)); commandMenu.AddItem(new GUIContent("Sort by Value"), false, () => SortBy(x => x.GetValue())); commandMenu.ShowAsContext(); }
private void AddDropDown(Rect buttonRect, ReorderableList list) { Event.current.Use(); VariableSelectPopupWindowContent.DoAddVariable(buttonRect, "", TargetFlowchart); }