Ejemplo n.º 1
0
    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();
        }
    }
Ejemplo n.º 2
0
    static void SelectAutomationPlan(string caption, UTAutomationPlanPopup.AutomationPlanSelected callback)
    {
        List <UTAutomationPlan> plans;
        List <UTAutomationPlan> visiblePlans;

        LoadAutomationPlans(out plans, out visiblePlans);
        UTAutomationPlanPopup.ShowDialog(caption, plans, visiblePlans, callback);
    }
 static void SelectAutomationPlan(string caption, UTAutomationPlanPopup.AutomationPlanSelected callback)
 {
     List<UTAutomationPlan> plans;
     List<UTAutomationPlan> visiblePlans;
     LoadAutomationPlans (out plans, out visiblePlans);
     UTAutomationPlanPopup.ShowDialog (caption, plans, visiblePlans, callback);
 }