public static void ShowDialog(string caption, List<UTAutomationPlan> allItems, List<UTAutomationPlan> visibleItems, AutomationPlanSelected selectionCallback) { UTAutomationPlanPopup popup = Instance; popup.caption = caption; popup.allItems = allItems; popup.visibleItems = visibleItems; popup.currentItems = visibleItems; popup.showAllItems = false; popup.selectionCallback = selectionCallback; popup.listData = new CUListData(false); popup.listData.ExecutionListener = popup; if (popup.currentItems.Count > 0) { // select first entry popup.listData[0] = true; } if (!visible) { requestFocus = true; visible = true; wasGuiPaintedAtLeastOnce = false; forceDelayedClose = false; popup.itemRenderer = new UTAutomationPlanListItemRenderer(); popup.position = new Rect(Mathf.Max(0, (Screen.width - Width) / 2), Mathf.Max(0, (Screen.height - Height) / 2), Width, Height); popup.ShowPopup(); popup.Focus(); } }
private void CloseDialog() { allItems = null; visibleItems = null; currentItems = null; selectionCallback = null; visible = false; forceDelayedClose = false; Close(); if (Event.current != null) { Event.current.Use(); } }
public static void ShowDialog(string caption, List <UTAutomationPlan> allItems, List <UTAutomationPlan> visibleItems, AutomationPlanSelected selectionCallback) { UTAutomationPlanPopup popup = Instance; popup.caption = caption; popup.allItems = allItems; popup.visibleItems = visibleItems; popup.currentItems = visibleItems; popup.showAllItems = false; popup.selectionCallback = selectionCallback; popup.listData = new CUListData(false); popup.listData.ExecutionListener = popup; if (popup.currentItems.Count > 0) { // select first entry popup.listData[0] = true; } if (!visible) { requestFocus = true; visible = true; wasGuiPaintedAtLeastOnce = false; forceDelayedClose = false; popup.itemRenderer = new UTAutomationPlanListItemRenderer(); popup.position = new Rect(Mathf.Max(0, (Screen.width - Width) / 2), Mathf.Max(0, (Screen.height - Height) / 2), Width, Height); popup.ShowPopup(); popup.Focus(); } }