// toggles whether a given category is selected or not and updates search results public void ToggleSelected(string category) { if (selectedCategories.Contains(category)) { selectedCategories.Remove(category); } else { selectedCategories.Add(category); } string[] tags = selectedCategories.ToArray(); List <PlanetData> searchResults = new List <PlanetData>(); if (tags.Length > 0) // perform logical AND search if there are categories selected { searchResults = database.Select(tags); } else // return all planets if no categories selected { searchResults = database.SelectAllPlanets(); } // update the result display ResultDisplay.GetInstance().DisplaySearchResults(searchResults); }
// reset so no categories are selected public void ResetAll() { for (int i = 0; i < categoryButtons.Length; i++) { categoryButtons[i].Deselect(); } selectedCategories.Clear(); //clear selected planets //update results display ResultDisplay.GetInstance().DisplaySearchResults(database.SelectAllPlanets()); }
// called when user pulls trigger while pointing at this button public void PointerClick() { //shifts the list of search results up or down one switch (shiftDir) { case ResultShiftAmount.ShiftUpOne: ResultDisplay.GetInstance().ShiftDisplayedResults(-1); break; case ResultShiftAmount.ShiftDownOne: ResultDisplay.GetInstance().ShiftDisplayedResults(1); break; } }
// called when user pulls trigger while pointing at this button public void PointerClick() { //turns off canvas and buttons detailedEntryCanvas.enabled = false; foreach (BoxCollider col in buttonColliders) { col.enabled = false; } //highlight.enabled = false; // enables the Category panel and Search Results panel CategoryManager.GetInstance().SetVisible(true); ResultDisplay.GetInstance().SetVisible(true); }
// called when user pulls trigger while pointing at this button public void PointerClick() { // switch to detailed entry view if (!data.title.Equals("")) { // get detailed entry canvas, pass it data, enable it DetailedEntry infoPanel = DetailedEntry.GetInstance(); infoPanel.UpdateInfo(data.title, data.creator, data.description, data.year, data.des_tag, data.image); infoPanel.GetTravelButton().SetExeString(ExecutableSwitch.GetFullPath(data.executable + ".exe", data.executable, data.year)); infoPanel.SetVisible(true); // disable search results and category panel ResultDisplay.GetInstance().SetVisible(false); CategoryManager.GetInstance().SetVisible(false); detailedEntryCallback = infoPanel.ReceiveSprite; // pass on sprite if a sprite is received } }
// after all the start functions have been called, search for all planets and display them private IEnumerator EndOfStartFrame() { yield return(new WaitForEndOfFrame()); ResultDisplay.GetInstance().DisplaySearchResults(database.SelectAllPlanets()); }