Exemplo n.º 1
0
        public int DrawItem(UIItem i, int y, int lc = 0)
        {
            int dx = lc * 25 + 15;

            if ((WidY + y) > WidY)
            {
                if (sy < 0)
                {
                    sy = y;
                }
            }
            if ((WidY + y) < WidY + WidH)
            {
                ey = y;
            }
            UISys.Skin().DrawBoxText((int)WidX + dx, (int)WidY + y, i.Name);
            UIPatch p = new UIPatch
            {
                X      = (int)WidX + dx - 8,
                Y      = (int)WidY + y + 4,
                W      = (int)WidW,
                H      = (int)25,
                Action = () =>
                {
                    Select(i);
                }
            };

            AddPatch(p);


            return(y + 25);
        }
Exemplo n.º 2
0
        public int DrawItem(UIItem i, int y, int lc = 0)
        {
            if (y > 0 || y < WidH)
            {
                int dx = lc * 25 + 15;

                if (i.Open)
                {
                    UISys.Skin().DrawLine((int)WidX + dx - 10, (int)WidY + y + 12, (int)WidX + dx - 4, (int)WidY + y + 12, new OpenTK.Vector4(1, 0.3f, 0.3f, 1.0f));
                }
                else
                {
                    UISys.Skin().DrawLine((int)WidX + dx - 7, (int)WidY + y + 6, (int)WidX + dx - 7, (int)WidY + y + 18, new OpenTK.Vector4(1, 0.3f, 0.3f, 1.0f));
                    UISys.Skin().DrawLine((int)WidX + dx - 10, (int)WidY + y + 12, (int)WidX + dx - 4, (int)WidY + y + 12, new OpenTK.Vector4(1, 0.3f, 0.3f, 1.0f));
                }
                if ((WidY + y) > WidY)
                {
                    if (sy < 0)
                    {
                        sy = y;
                    }
                }
                if ((WidY + y) < WidY + WidH)
                {
                    ey = y;
                }
                UISys.Skin().DrawBoxText((int)WidX + dx, (int)WidY + y, i.Name);
                UIPatch p = new UIPatch
                {
                    X = (int)WidX + dx - 8,
                    Y = (int)WidY + y + 4,
                    W = (int)WidW,
                    H = (int)25
                };
                if ((p.X + p.W) > WidX + WidW)
                {
                    p.W = (int)WidW - (p.X - (int)WidX);
                }
                p.Action = () =>
                {
                    if (i.Open)
                    {
                        i.Open = false;
                    }
                    else
                    {
                        i.Open = true;
                        Open(i);
                    }
                };
                AddPatch(p);
            }
            if (i.Open)
            {
                y += 25;

                int ny = y;
                foreach (var si in i.Sub)
                {
                    y  = DrawItem(si, y, lc + 1);
                    y += 25;
                }
            }
            return(y);
        }