Esempio n. 1
0
 public void     DeleteListInterests(ListPointOfInterest list)
 {
     for (int i = 0; i < this.pointsOfInterest.Count; i++)
     {
         if (list == this.pointsOfInterest[i])
         {
             this.pointsOfInterest.RemoveAt(i);
             break;
         }
     }
 }
Esempio n. 2
0
        public void     AddListInterests(ListPointOfInterest list)
        {
            for (int i = 1; i < this.pointsOfInterest.Count; i++)
            {
                if (list.priority <= this.pointsOfInterest[i].priority)
                {
                    this.pointsOfInterest.Insert(i, list);
                    return;
                }
            }

            this.pointsOfInterest.Add(list);
        }
Esempio n. 3
0
        private void    DrawInterest()
        {
            float min = this.bgScrollRect.x - this.interestHalfSizeMargin;

            this.scrollRect.y      = this.bgScrollRect.y + this.bgScrollRect.height * .5F - this.interestHalfSizeMargin;
            this.scrollRect.width  = this.InterestSizeMargin;
            this.scrollRect.height = this.InterestSizeMargin;

            if (this.bgScrollRect.height <= this.realWidth)
            {
                float factor = this.bgScrollRect.width / this.realWidth;
                bool  first  = false;

                if (this.bgScrollRect.width * 4F <= this.realWidth)
                {
                    this.scrollRect.width = 16F * factor;
                }
                min = this.bgScrollRect.x - factor;

                this.cumulativeRect.height = this.interestSizeMargin;
                this.cumulativeColor.a     = 1F;

                for (int i = this.pointsOfInterest.Count - 1; i >= 0; --i)
                {
                    ListPointOfInterest list = this.pointsOfInterest[i];
                    double nextXMin          = min;
                    double xMin = 0F;
                    double xMax = 0F;

                    first = false;

                    if (list.offset != 0F)
                    {
                        this.cumulativeRect.y = this.scrollRect.y + list.offset;
                    }
                    else
                    {
                        this.cumulativeRect.y = this.scrollRect.y;
                    }

                    this.cumulativeRect.xMax = 0F;

                    for (int j = 0, max = list.Count; j < max; j++)
                    {
                        PointOfInterest poi = list[j];

                        nextXMin += poi.offset * factor;

                        if (xMax >= nextXMin &&
                            this.cumulativeColor.r == poi.color.r &&
                            this.cumulativeColor.g == poi.color.g &&
                            this.cumulativeColor.b == poi.color.b &&
                            this.cumulativeColor.a == poi.color.a)
                        {
                            xMax = nextXMin + this.scrollRect.width;
                        }
                        else
                        {
                            if (first == true)
                            {
                                this.cumulativeRect.x     = (float)xMin;
                                this.cumulativeRect.width = (float)(xMax - xMin);
                                if (this.cumulativeRect.width < 3F)
                                {
                                    this.cumulativeRect.x    -= 1.5F;
                                    this.cumulativeRect.width = 3F;
                                }

                                if (this.cumulativeColor.a > 0F)
                                {
                                    this.cumulativeColor.a = 1F;
                                    EditorGUI.DrawRect(this.cumulativeRect, this.cumulativeColor);
                                }
                            }

                            first = true;

                            xMin = nextXMin;
                            xMax = nextXMin + this.scrollRect.height;
                            this.cumulativeColor.r = poi.color.r;
                            this.cumulativeColor.g = poi.color.g;
                            this.cumulativeColor.b = poi.color.b;
                            this.cumulativeColor.a = poi.color.a;
                        }

                        if (Mathf.Approximately(poi.postOffset, 0F) == false)
                        {
                            nextXMin += poi.postOffset * factor;
                        }
                    }

                    if (first == true)
                    {
                        this.cumulativeRect.x     = (float)xMin;
                        this.cumulativeRect.width = (float)(xMax - xMin);
                        if (this.cumulativeRect.width < 3F)
                        {
                            this.cumulativeRect.x    -= 1.5F;
                            this.cumulativeRect.width = 3F;
                        }

                        if (this.cumulativeColor.a > 0F)
                        {
                            this.cumulativeColor.a = 1F;
                            EditorGUI.DrawRect(this.cumulativeRect, this.cumulativeColor);
                        }
                    }
                }
            }
            else
            {
                //for (int i = this.pointsOfInterest.Count - 1; i >= 0; --i)
                //{
                //	this.scrollRect.y += this.pointsOfInterest[i].offset;
                //	for (int j = 0; j < this.pointsOfInterest[i].Count; j++)
                //	{
                //		this.scrollRect.x = min + this.pointsOfInterest[i][j].offset;
                //		EditorGUI.DrawRect(this.scrollRect, this.pointsOfInterest[i][j].color);
                //	}
                //	this.scrollRect.y -= this.pointsOfInterest[i].offset;
                //}
            }
        }
Esempio n. 4
0
        private void    DrawInterest()
        {
            float min = this.bgScrollRect.y - this.interestHalfSizeMargin;

            this.scrollRect.x      = this.bgScrollRect.x + this.bgScrollRect.width * .5F - this.interestHalfSizeMargin;
            this.scrollRect.width  = this.interestSizeMargin;
            this.scrollRect.height = this.interestSizeMargin;

            if (this.bgScrollRect.height <= this.realHeight)
            {
                float factor = this.bgScrollRect.height / this.realHeight;
                bool  first  = false;

                if (this.bgScrollRect.height * 4F <= this.realHeight)
                {
                    this.scrollRect.height = 16F * factor;
                }
                min = this.bgScrollRect.y - factor;

                this.cumulativeRect.width = this.interestSizeMargin;
                this.cumulativeColor.a    = 1F;

                for (int i = this.pointsOfInterest.Count - 1; i >= 0; --i)
                {
                    ListPointOfInterest list = this.pointsOfInterest[i];
                    double nextYMin          = min;
                    double yMin = 0F;
                    double yMax = 0F;

                    first = false;

                    if (list.offset != 0F)
                    {
                        this.cumulativeRect.x = this.scrollRect.x + list.offset;
                    }
                    else
                    {
                        this.cumulativeRect.x = this.scrollRect.x;
                    }

                    this.cumulativeRect.yMax = 0F;

                    for (int j = 0, max = list.Count; j < max; j++)
                    {
                        PointOfInterest poi = list[j];

                        nextYMin += poi.offset * factor;

                        if (poi.icon != null)
                        {
                            this.cumulativeRect.y      = (float)nextYMin;
                            this.cumulativeRect.height = this.cumulativeRect.width;
                            GUI.DrawTexture(this.cumulativeRect, poi.icon, ScaleMode.ScaleToFit);
                            continue;
                        }

                        if (yMax >= nextYMin &&
                            this.cumulativeColor.r == poi.color.r &&
                            this.cumulativeColor.g == poi.color.g &&
                            this.cumulativeColor.b == poi.color.b &&
                            this.cumulativeColor.a == poi.color.a)
                        {
                            yMax = nextYMin + this.scrollRect.height;
                        }
                        else
                        {
                            if (first == true)
                            {
                                this.cumulativeRect.y      = (float)yMin;
                                this.cumulativeRect.height = (float)(yMax - yMin);
                                if (this.cumulativeRect.height < 3F)
                                {
                                    this.cumulativeRect.y     -= 1.5F;
                                    this.cumulativeRect.height = 3F;
                                }

                                if (this.cumulativeColor.a > 0F)
                                {
                                    this.cumulativeColor.a = 1F;
                                    EditorGUI.DrawRect(this.cumulativeRect, this.cumulativeColor);
                                }
                            }

                            first = true;

                            yMin = nextYMin;
                            yMax = nextYMin + this.scrollRect.height;
                            this.cumulativeColor.r = poi.color.r;
                            this.cumulativeColor.g = poi.color.g;
                            this.cumulativeColor.b = poi.color.b;
                            this.cumulativeColor.a = poi.color.a;
                        }

                        if (Mathf.Approximately(poi.postOffset, 0F) == false)
                        {
                            nextYMin += poi.postOffset * factor;
                        }
                    }

                    if (first == true)
                    {
                        this.cumulativeRect.y      = (float)yMin;
                        this.cumulativeRect.height = (float)(yMax - yMin);
                        if (this.cumulativeRect.height < 3F)
                        {
                            this.cumulativeRect.y     -= 1.5F;
                            this.cumulativeRect.height = 3F;
                        }

                        if (this.cumulativeColor.a > 0F)
                        {
                            this.cumulativeColor.a = 1F;
                            EditorGUI.DrawRect(this.cumulativeRect, this.cumulativeColor);
                        }
                    }
                }
            }
            else
            {
                //for (int i = this.pointsOfInterest.Count - 1; i >= 0; --i)
                //{
                //	this.scrollRect.x += this.pointsOfInterest[i].offset;
                //	for (int j = 0; j < this.pointsOfInterest[i].Count; j++)
                //	{
                //		this.scrollRect.y = min + this.pointsOfInterest[i][j].offset;
                //		EditorGUI.DrawRect(this.scrollRect, this.pointsOfInterest[i][j].color);
                //	}
                //	this.scrollRect.x -= this.pointsOfInterest[i].offset;
                //}
            }
        }