Exemplo n.º 1
0
        public override void Draw(DevicePanel d)
        {
            if (!c1.Selected)
            {
                c1.Transparency = Transparency;
            }
            if (!c2.Selected)
            {
                c2.Transparency = Transparency;
            }
            if (!c3.Selected)
            {
                c3.Transparency = Transparency;
            }
            if (!c4.Selected)
            {
                c4.Transparency = Transparency;
            }
            int cX = Map.Instance.CenterX;
            int cY = Map.Instance.CenterY;
            int x1 = cX + Object.GetInt("x1");
            int x2 = cX + Object.GetInt("x2");
            int y1 = cY + Object.GetInt("y1");
            int y2 = cY + Object.GetInt("y2");

            Color color = Selected ? Color.Blue : Color.MediumTurquoise;

            d.DrawRectangle(x1, y1, x2, y2, Color.FromArgb(50 * Transparency / 0xFF, color));

            d.DrawLine(x1, y1, x2, y1, Color.FromArgb(Transparency, color));
            d.DrawLine(x1, y1, x1, y2, Color.FromArgb(Transparency, color));
            d.DrawLine(x2, y2, x2, y1, Color.FromArgb(Transparency, color));
            d.DrawLine(x2, y2, x1, y2, Color.FromArgb(Transparency, color));

            c1.Draw(d);
            c2.Draw(d);
            c3.Draw(d);
            c4.Draw(d);

            d.DrawText(Image.GetString("Title"), x1 + 7, y1 + 2, 0, Color.FromArgb(Transparency, color), true);
            d.DrawText(Image.GetString("Desc"), x1 + 7, y1 + 14, x2 - x1 - 14, Color.FromArgb(Transparency, color), false);
        }
Exemplo n.º 2
0
 public override void Draw(DevicePanel d)
 {
     if (MapEditor.Instance.EditMode.Checked && MapEditor.Instance.EditClock.Checked)
     {
         d.DrawRectangle(Object.GetInt("x") + Map.Instance.CenterX + 10, Object.GetInt("y") + Map.Instance.CenterY + 76, Object.GetInt("x") + Map.Instance.CenterX + Object.GetInt("width") - 8, Object.GetInt("y") + Map.Instance.CenterY + Object.GetInt("height") - 78, Selected ? Color.FromArgb(150, Color.Blue) : Color.FromArgb(150, 51, 17, 0));
     }
     WZCanvas draw = Image.GetCanvas("am");
     int x = Object.GetInt("x") + 16 + Map.Instance.CenterX, y = Object.GetInt("y") + 82 + Map.Instance.CenterY;
     d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
     x += draw.width + 17;
     draw = Image.GetCanvas("0");
     d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
     x += draw.width + 2;
     d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
     x += draw.width + 2;
     draw = Image.GetCanvas("comma");
     d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
     x += draw.width + 2;
     draw = Image.GetCanvas("0");
     d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
     x += draw.width + 2;
     d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
 }
Exemplo n.º 3
0
        public override void Draw(DevicePanel d)
        {
            if (MapEditor.Instance.EditMode.Checked && MapEditor.Instance.EditClock.Checked)
            {
                d.DrawRectangle(Object.GetInt("x") + Map.Instance.CenterX + 10, Object.GetInt("y") + Map.Instance.CenterY + 76, Object.GetInt("x") + Map.Instance.CenterX + Object.GetInt("width") - 8, Object.GetInt("y") + Map.Instance.CenterY + Object.GetInt("height") - 78, Selected ? Color.FromArgb(150, Color.Blue) : Color.FromArgb(150, 51, 17, 0));
            }
            WZCanvas draw = Image.GetCanvas("am");
            int      x = Object.GetInt("x") + 16 + Map.Instance.CenterX, y = Object.GetInt("y") + 82 + Map.Instance.CenterY;

            d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
            x   += draw.width + 17;
            draw = Image.GetCanvas("0");
            d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
            x += draw.width + 2;
            d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
            x   += draw.width + 2;
            draw = Image.GetCanvas("comma");
            d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
            x   += draw.width + 2;
            draw = Image.GetCanvas("0");
            d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
            x += draw.width + 2;
            d.DrawBitmap(draw.GetTexture(d._device), x, y, draw.width, draw.height, Selected, Transparency);
        }
Exemplo n.º 4
0
        public void Draw(DevicePanel d)
        {
            d.Cache();

            if (MapEditor.Instance.ShowBack.Checked || MapEditor.Instance.EditBack.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditBack.Checked) ? 0x32 : 0xFF;
                foreach (MapBack b in backs)
                {
                    if (b.Object.GetInt("front") == 0)
                    {
                        b.Transparency = transparency;
                        b.Draw(d);
                    }
                }
            }
            //long a = System.DateTime.Now.Millisecond;
            foreach (MapLayer l in layers)
            {
                l.Draw(d);
            }
            //Console.Out.WriteLine(System.DateTime.Now.Millisecond - a);
            if (MapEditor.Instance.ShowLife.Checked || MapEditor.Instance.EditLife.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditLife.Checked) ? 0x32 : 0xFF;
                foreach (MapLife l in lifes)
                {
                    if (!footholds.Contains(l.Object.GetInt("fh")))
                    {
                        l.Transparency = transparency;
                        l.Draw(d);
                    }
                }
            }
            if (MapEditor.Instance.ShowReactor.Checked || MapEditor.Instance.EditReactor.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditReactor.Checked) ? 0x32 : 0xFF;
                foreach (MapReactor r in reactors)
                {
                    r.Transparency = transparency;
                    r.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowClock.Checked || MapEditor.Instance.EditClock.Checked)
            {
                if (clock != null)
                {
                    int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditClock.Checked) ? 0x32 : 0xFF;
                    clock.Transparency = transparency;
                    clock.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowSeat.Checked || MapEditor.Instance.EditSeat.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditSeat.Checked) ? 0x32 : 0xFF;
                foreach (MapSeat s in seats)
                {
                    s.Transparency = transparency;
                    s.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowPortal.Checked || MapEditor.Instance.EditPortal.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditPortal.Checked) ? 0x32 : 0xFF;
                foreach (MapPortal p in portals)
                {
                    p.Transparency = transparency;
                    p.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowBack.Checked || MapEditor.Instance.EditBack.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditBack.Checked) ? 0x32 : 0xFF;
                foreach (MapBack b in backs)
                {
                    if (b.Object.GetInt("front") == 1)
                    {
                        b.Transparency = transparency;
                        b.Draw(d);
                    }
                }
            }
            if (MapEditor.Instance.ShowToolTip.Checked || MapEditor.Instance.EditToolTip.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditToolTip.Checked) ? 0x32 : 0xFF;
                foreach (MapToolTip t in tooltips)
                {
                    t.Transparency = transparency;
                    t.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowLimits.Checked && VRTop != 0)
            {
                int x1 = CenterX + VRLeft, y1 = CenterY + VRTop, x2 = CenterX + VRRight, y2 = CenterY + VRBottom;

                /*
                 * (X1, Y1)         (X2, Y1)
                 *
                 *
                 * (X1, Y2)         (X2, Y2)
                 */

                d.DrawLine(x1, y1, x2, y1, Color.DarkBlue);
                d.DrawLine(x1, y1, x1, y2, Color.DarkBlue);
                d.DrawLine(x2, y2, x2, y1, Color.DarkBlue);
                d.DrawLine(x2, y2, x1, y2, Color.DarkBlue);
            }
            if (MapEditor.Instance.draggingSelection)
            {
                int x1 = (int)(MapEditor.Instance.selectingX / MapEditor.Instance.Zoom), x2 = (int)(MapEditor.Instance.lastX / MapEditor.Instance.Zoom);
                int y1 = (int)(MapEditor.Instance.selectingY / MapEditor.Instance.Zoom), y2 = (int)(MapEditor.Instance.lastY / MapEditor.Instance.Zoom);
                if (x1 != x2 && y1 != y2)
                {
                    if (x1 > x2)
                    {
                        x1 = (int)(MapEditor.Instance.lastX / MapEditor.Instance.Zoom);
                        x2 = (int)(MapEditor.Instance.selectingX / MapEditor.Instance.Zoom);
                    }
                    if (y1 > y2)
                    {
                        y1 = (int)(MapEditor.Instance.lastY / MapEditor.Instance.Zoom);
                        y2 = (int)(MapEditor.Instance.selectingY / MapEditor.Instance.Zoom);
                    }

                    d.DrawRectangle(x1, y1, x2, y2, Color.FromArgb(50, Color.Purple));

                    d.DrawLine(x1, y1, x2, y1, Color.Purple);
                    d.DrawLine(x1, y1, x1, y2, Color.Purple);
                    d.DrawLine(x2, y2, x2, y1, Color.Purple);
                    d.DrawLine(x2, y2, x1, y2, Color.Purple);
                }
            }
            if (MapEditor.Instance.DrawMode.Checked)
            {
                foreach (MapCurve curve in MapEditor.Instance.curves)
                {
                    curve.Draw(d);
                }
            }
        }
Exemplo n.º 5
0
        public override void Draw(DevicePanel d)
        {
            if (!c1.Selected)
            {
                c1.Transparency = Transparency;
            }
            if (!c2.Selected)
            {
                c2.Transparency = Transparency;
            }
            if (!c3.Selected)
            {
                c3.Transparency = Transparency;
            }
            if (!c4.Selected)
            {
                c4.Transparency = Transparency;
            }
            int cX = Map.Instance.CenterX;
            int cY = Map.Instance.CenterY;
            int x1 = cX + Object.GetInt("x1");
            int x2 = cX + Object.GetInt("x2");
            int y1 = cY + Object.GetInt("y1");
            int y2 = cY + Object.GetInt("y2");

            Color color = Selected ? Color.Blue : Color.MediumTurquoise;

            d.DrawRectangle(x1, y1, x2, y2, Color.FromArgb(50 * Transparency / 0xFF, color));

            d.DrawLine(x1, y1, x2, y1, Color.FromArgb(Transparency, color));
            d.DrawLine(x1, y1, x1, y2, Color.FromArgb(Transparency, color));
            d.DrawLine(x2, y2, x2, y1, Color.FromArgb(Transparency, color));
            d.DrawLine(x2, y2, x1, y2, Color.FromArgb(Transparency, color));

            c1.Draw(d);
            c2.Draw(d);
            c3.Draw(d);
            c4.Draw(d);

            d.DrawText(Image.GetString("Title"), x1 + 7, y1 + 2, 0, Color.FromArgb(Transparency, color), true);
            d.DrawText(Image.GetString("Desc"), x1 + 7, y1 + 14, x2 - x1 - 14, Color.FromArgb(Transparency, color), false);
        }
Exemplo n.º 6
0
        public void Draw(DevicePanel d)
        {
            d.Cache();

            if (MapEditor.Instance.ShowBack.Checked || MapEditor.Instance.EditBack.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditBack.Checked) ? 0x32 : 0xFF;
                foreach (MapBack b in backs)
                {
                    if (b.Object.GetInt("front") == 0)
                    {
                        b.Transparency = transparency;
                        b.Draw(d);
                    }
                }
            }
            //long a = System.DateTime.Now.Millisecond;
            foreach (MapLayer l in layers)
            {
                l.Draw(d);
            }
            //Console.Out.WriteLine(System.DateTime.Now.Millisecond - a);
            if (MapEditor.Instance.ShowLife.Checked || MapEditor.Instance.EditLife.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditLife.Checked) ? 0x32 : 0xFF;
                foreach (MapLife l in lifes)
                {
                    if (!footholds.Contains(l.Object.GetInt("fh")))
                    {
                        l.Transparency = transparency;
                        l.Draw(d);
                    }
                }
            }
            if (MapEditor.Instance.ShowReactor.Checked || MapEditor.Instance.EditReactor.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditReactor.Checked) ? 0x32 : 0xFF;
                foreach (MapReactor r in reactors)
                {
                    r.Transparency = transparency;
                    r.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowClock.Checked || MapEditor.Instance.EditClock.Checked)
            {
                if (clock != null)
                {
                    int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditClock.Checked) ? 0x32 : 0xFF;
                    clock.Transparency = transparency;
                    clock.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowSeat.Checked || MapEditor.Instance.EditSeat.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditSeat.Checked) ? 0x32 : 0xFF;
                foreach (MapSeat s in seats)
                {
                    s.Transparency = transparency;
                    s.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowPortal.Checked || MapEditor.Instance.EditPortal.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditPortal.Checked) ? 0x32 : 0xFF;
                foreach (MapPortal p in portals)
                {
                    p.Transparency = transparency;
                    p.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowBack.Checked || MapEditor.Instance.EditBack.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditBack.Checked) ? 0x32 : 0xFF;
                foreach (MapBack b in backs)
                {
                    if (b.Object.GetInt("front") == 1)
                    {
                        b.Transparency = transparency;
                        b.Draw(d);
                    }
                }
            }
            if (MapEditor.Instance.ShowToolTip.Checked || MapEditor.Instance.EditToolTip.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditToolTip.Checked) ? 0x32 : 0xFF;
                foreach (MapToolTip t in tooltips)
                {
                    t.Transparency = transparency;
                    t.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowLimits.Checked && VRTop != 0)
            {
                int x1 = CenterX + VRLeft, y1 = CenterY + VRTop, x2 = CenterX + VRRight, y2 = CenterY + VRBottom;
                /*
                 * (X1, Y1)         (X2, Y1)
                 * 
                 * 
                 * (X1, Y2)         (X2, Y2)
                 */

                d.DrawLine(x1, y1, x2, y1, Color.DarkBlue);
                d.DrawLine(x1, y1, x1, y2, Color.DarkBlue);
                d.DrawLine(x2, y2, x2, y1, Color.DarkBlue);
                d.DrawLine(x2, y2, x1, y2, Color.DarkBlue);
            }
            if (MapEditor.Instance.draggingSelection)
            {
                int x1 = (int)(MapEditor.Instance.selectingX / MapEditor.Instance.Zoom), x2 = (int)(MapEditor.Instance.lastX / MapEditor.Instance.Zoom);
                int y1 = (int)(MapEditor.Instance.selectingY / MapEditor.Instance.Zoom), y2 = (int)(MapEditor.Instance.lastY / MapEditor.Instance.Zoom);
                if (x1 != x2 && y1 != y2)
                {
                    if (x1 > x2)
                    {
                        x1 = (int)(MapEditor.Instance.lastX / MapEditor.Instance.Zoom);
                        x2 = (int)(MapEditor.Instance.selectingX / MapEditor.Instance.Zoom);
                    }
                    if (y1 > y2)
                    {
                        y1 = (int)(MapEditor.Instance.lastY / MapEditor.Instance.Zoom);
                        y2 = (int)(MapEditor.Instance.selectingY / MapEditor.Instance.Zoom);
                    }

                    d.DrawRectangle(x1, y1, x2, y2, Color.FromArgb(50, Color.Purple));

                    d.DrawLine(x1, y1, x2, y1, Color.Purple);
                    d.DrawLine(x1, y1, x1, y2, Color.Purple);
                    d.DrawLine(x2, y2, x2, y1, Color.Purple);
                    d.DrawLine(x2, y2, x1, y2, Color.Purple);
                }
            }
            if (MapEditor.Instance.DrawMode.Checked)
            {
                foreach (MapCurve curve in MapEditor.Instance.curves)
                {
                    curve.Draw(d);
                }
            }
        }