Example #1
0
        private void OnSelect(int index)
        {
            Location       location = LocationDatabase.GetLocationFromSearch(index);
            LocationMarker marker   = new LocationMarker(location);

            if (marker == null)
            {
                return;
            }

            SetMarker(marker, currentContext);
        }
Example #2
0
        private void OnResult(int count)
        {
            if (count == 0)
            {
                SearchMenu.SetContents(null);
                return;
            }

            MenuContent[] contents = new MenuContent[count];

            for (int i = 0; i < count; i++)
            {
                Location location = LocationDatabase.GetLocationFromSearch(i);
                contents[i] = new MenuContent(null, location.displayedName);
            }

            SearchMenu.SetContents(contents);
        }
        private void OnContentClicked(int index)
        {
            if (!visible)
            {
                return;
            }

            Location location = LocationDatabase.GetLocationFromSearch(index);

            if (LocationSelectCallback != null)
            {
                LocationSelectCallback(location);
            }

            LocationSelectCallback = null;

            if (focusOnSelectedLocation)
            {
                FocusOnSelectedLocation(location);
            }

            Close();
        }
        private void OnResult(int count)
        {
            MenuContent[] contents = null;

            if (count > 0)
            {
                contents = new MenuContent[count];
                for (int i = 0; i < count; i++)
                {
                    Location location  = LocationDatabase.GetLocationFromSearch(i);
                    Sprite   thumbnail = null;

                    if (location is Place)
                    {
                        Place building = location as Place;
                        thumbnail = building.thumbnail;
                    }

                    contents[i] = new MenuContent(thumbnail, location.displayedName);
                }
            }

            SetContents(contents);
        }