Inheritance: CLRScriptFramework.CLRScriptBase, IGeneratedScriptProgram
        public static void WaitForSearch(CLRScriptBase script, User currentUser, ACR_ChooserCreator.ACR_CreatorCommand currentTab, CreatorSearch awaitedSearch)
        {
            if (awaitedSearch == null)
            {
                // Search has been removed. Abort.
                return;
            }
            if (awaitedSearch.CancellationPending)
            {
                // Search has been canceled. Abort.
                return;
            }
            if (currentUser.openCommand != currentTab)
            {
                // User has switched tabs. Kill the search.
                return;
            }
            if (currentUser.CreatorSearchResponse != null)
            {
                // Looks like we've finished. Draw a list!
                CreatorSearch oldSearch = currentUser.CurrentSearch;
                currentUser.CurrentSearch = null;
                oldSearch.Dispose();

                Waiter.DrawNavigatorCategory(script, currentUser.CreatorSearchResponse);
                switch (currentUser.openCommand)
                {
                    case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_CREATURE_TAB:
                        currentUser.CurrentCreatureCategory = currentUser.CreatorSearchResponse;
                        break;
                    case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_ITEM_TAB:
                        currentUser.CurrentItemCategory = currentUser.CreatorSearchResponse;
                        break;
                    case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_LIGHTS_TAB:
                        currentUser.CurrentLightCategory = currentUser.CreatorSearchResponse;
                        break;
                    case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_PLACEABLE_TAB:
                        currentUser.CurrentPlaceableCategory = currentUser.CreatorSearchResponse;
                        break;
                    case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_TRAP_TAB:
                        currentUser.CurrentTrapCategory = currentUser.CreatorSearchResponse;
                        break;
                    case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_VFX_TAB:
                        currentUser.CurrentVisualEffectCategory = currentUser.CreatorSearchResponse;
                        break;
                    case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_WAYPOINT_TAB:
                        currentUser.CurrentWaypointCategory = currentUser.CreatorSearchResponse;
                        break;
                }
                return;
            }
            script.DelayCommand(1.0f, delegate { WaitForSearch(script, currentUser, currentTab, awaitedSearch); });
        }
 public static void FocusTabs(CLRScriptBase script, User currentUser, ACR_ChooserCreator.ACR_CreatorCommand command)
 {
     switch (command)
     {
         case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_CREATURE_TAB:
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", FALSE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", FALSE);
             currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_CREATURE_TAB;
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, "Fac");
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, "CR");
             if (currentUser.CurrentCreatureCategory == Navigators.CreatureNavigator.bottomCategory)
             {
                 Waiter.WaitForNavigator(script, Navigators.CreatureNavigator);
             }
             else
             {
                 if (currentUser.CurrentCreatureCategory == null)
                 {
                     currentUser.CurrentCreatureCategory = Navigators.CreatureNavigator.bottomCategory;
                 }
                 Waiter.DrawNavigatorCategory(script, currentUser.CurrentCreatureCategory);
             }
             break;
         case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_ITEM_TAB:
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", FALSE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", FALSE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE);
             currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_ITEM_TAB;
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, "Value");
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, "Lvl");
             if (currentUser.CurrentItemCategory == Navigators.ItemNavigator.bottomCategory)
             {
                 Waiter.WaitForNavigator(script, Navigators.ItemNavigator);
             }
             else
             {
                 if (currentUser.CurrentItemCategory == null)
                 {
                     currentUser.CurrentItemCategory = Navigators.ItemNavigator.bottomCategory;
                 }
                 Waiter.DrawNavigatorCategory(script, currentUser.CurrentItemCategory);
             }
             break;
         case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_PLACEABLE_TAB:
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", FALSE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE);
             currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_PLACEABLE_TAB;
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, "Lck/Trp");
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, "Inv?");
             if (currentUser.CurrentPlaceableCategory == Navigators.PlaceableNavigator.bottomCategory)
             {
                 Waiter.WaitForNavigator(script, Navigators.PlaceableNavigator);
             }
             else
             {
                 if (currentUser.CurrentPlaceableCategory == null)
                 {
                     currentUser.CurrentPlaceableCategory = Navigators.PlaceableNavigator.bottomCategory;
                 }
                 Waiter.DrawNavigatorCategory(script, currentUser.CurrentPlaceableCategory);
             }
             break;
         case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_TRAP_TAB:
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", FALSE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE);
             currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_TRAP_TAB;
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, "DC");
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, "CR");
             if (currentUser.CurrentTrapCategory == Navigators.TrapNavigator.bottomCategory)
             {
                 Waiter.WaitForNavigator(script, Navigators.TrapNavigator);
             }
             else
             {
                 if (currentUser.CurrentTrapCategory == null)
                 {
                     currentUser.CurrentTrapCategory = Navigators.TrapNavigator.bottomCategory;
                 }
                 Waiter.DrawNavigatorCategory(script, currentUser.CurrentTrapCategory);
             }
             break;
         case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_VFX_TAB:
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", FALSE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE);
             currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_VFX_TAB;
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, " ");
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, " ");
             if (currentUser.CurrentVisualEffectCategory == Navigators.VisualEffectNavigator.bottomCategory)
             {
                 Waiter.WaitForNavigator(script, Navigators.VisualEffectNavigator);
             }
             else
             {
                 if (currentUser.CurrentVisualEffectCategory == null)
                 {
                     currentUser.CurrentVisualEffectCategory = Navigators.VisualEffectNavigator.bottomCategory;
                 }
                 Waiter.DrawNavigatorCategory(script, currentUser.CurrentVisualEffectCategory);
             }
             break;
         case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_WAYPOINT_TAB:
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", FALSE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE);
             currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_WAYPOINT_TAB;
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, " ");
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, " ");
             if (currentUser.CurrentWaypointCategory == Navigators.WaypointNavigator.bottomCategory)
             {
                 Waiter.WaitForNavigator(script, Navigators.WaypointNavigator);
             }
             else
             {
                 if (currentUser.CurrentWaypointCategory == null)
                 {
                     currentUser.CurrentWaypointCategory = Navigators.WaypointNavigator.bottomCategory;
                 }
                 Waiter.DrawNavigatorCategory(script, currentUser.CurrentWaypointCategory);
             }
             break;
         case ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_LIGHTS_TAB:
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "PlaceableActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "TrapActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "VfxActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "WaypointActive", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "LightActive", FALSE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "ItemButtons", TRUE);
             script.SetGUIObjectHidden(currentUser.Id, "SCREEN_DMC_CREATOR", "CreatureButtons", TRUE);
             currentUser.openCommand = ACR_ChooserCreator.ACR_CreatorCommand.ACR_CHOOSERCREATOR_FOCUS_LIGHTS_TAB;
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column2", -1, "Brt/Rd");
             script.SetGUIObjectText(currentUser.Id, "SCREEN_DMC_CREATOR", "Column3", -1, "Shd");
             if (currentUser.CurrentWaypointCategory == Navigators.LightNavigator.bottomCategory)
             {
                 Waiter.WaitForNavigator(script, Navigators.LightNavigator);
             }
             else
             {
                 if (currentUser.CurrentLightCategory == null)
                 {
                     currentUser.CurrentLightCategory = Navigators.LightNavigator.bottomCategory;
                 }
                 Waiter.DrawNavigatorCategory(script, currentUser.CurrentLightCategory);
             }
             break;
     }
 }