Пример #1
0
        public override void Draw(DevicePanel d)
        {
            if (Object.GetChild("script") != null) return;
            int type = Object.GetInt("pt");
            bool arrow = ((type == 1 || type == 3 || type == 10) && Object.GetInt("tm") == int.Parse(MapEditor.Instance.MapID) && Map.Instance.GetPortal(Object.GetString("tn")) != null);

            int cx = Map.Instance.CenterX;
            int cy = Map.Instance.CenterY;
            switch (Object.GetInt("pt"))
            {
                case 0:
                case 1:
                case 10:
                    d.DrawCircle(cx + Object.GetInt("x"), cy + Object.GetInt("y"), Color.FromArgb(Transparency, (Selected) ? Color.Blue : Color.RoyalBlue)); break;
                case 3:
                    d.DrawCircle(cx + Object.GetInt("x"), cy + Object.GetInt("y"), Color.FromArgb(Transparency, (Selected) ? Color.Blue : Color.RoyalBlue)); 
                    d.DrawEmptyCircle(cx + Object.GetInt("x"), cy + Object.GetInt("y"), Color.FromArgb(Transparency, (Selected) ? Color.Blue : Color.RoyalBlue)); break;
                case 2:
                    d.DrawBitmap(Image.GetCanvas().GetTexture(d._device), cx + Object.GetInt("x") - Image.GetVector("origin").x, cy + Object.GetInt("y") - Image.GetVector("origin").y, Image.GetCanvas().width, Image.GetCanvas().height, Selected, (Transparency == 50) ? 100 : Transparency); break;
            }

            if (arrow)
            {
                MapPortal p = Map.Instance.GetPortal(Object.GetString("tn"));
                int x = p.Object.GetInt("x");
                int y = p.Object.GetInt("y");
                double di = MapFoothold.Distance(Object.GetInt("x"), Object.GetInt("y"), x, y);
                if (di != 0)
                {
                    double xp = (Object.GetInt("x") * 5 + x * (di - 5)) / di;
                    double yp = (Object.GetInt("y") * 5 + y * (di - 5)) / di;
                    d.DrawArrow(Object.GetInt("x") + cx, Object.GetInt("y") + cy, (int)xp + cx, (int)yp + cy, Color.FromArgb(Transparency, (Selected) ? Color.Blue : Color.RoyalBlue));
                }
            }
        }
Пример #2
0
        public Simulator(DevicePanel Graphics)
        {
            InitializeComponent();

            Controls.Add(Graphics);

            this.Graphics = Graphics;

            Graphics.OnRender += new RenderEventHandler(Graphics_OnRender);
            Graphics.MouseMove += new MouseEventHandler(Graphics_MouseMove);
            Graphics.MouseWheel += new MouseEventHandler(Graphics_MouseWheel);
            Graphics.MouseDoubleClick += new MouseEventHandler(Graphics_MouseDoubleClick);
            Graphics.MouseDown += new MouseEventHandler(Graphics_MouseDown);
            Graphics.OnCreateDevice += new CreateDeviceEventHandler(Graphics_OnCreateDevice);
            Graphics.MouseUp += new MouseEventHandler(Graphics_MouseUp);
            Graphics.KeyDown += new KeyEventHandler(Graphics_KeyDown);
            Graphics.KeyUp += new KeyEventHandler(Graphics_KeyUp);

            //Graphics.Size = new Size(800, 600);
            MapEditor.Instance.Width = 800;
            MapEditor.Instance.Height = 600;
            Graphics.Focus();

            if (MapEditor.Instance.ShiftX < Map.Instance.VRLeft + Map.Instance.CenterX) MapEditor.Instance.ShiftX = Map.Instance.VRLeft + Map.Instance.CenterX;
            if (MapEditor.Instance.ShiftX + 800 > Map.Instance.VRRight + Map.Instance.CenterX) MapEditor.Instance.ShiftX = Map.Instance.VRRight + Map.Instance.CenterX - 800;
            if (MapEditor.Instance.ShiftY < Map.Instance.VRTop + Map.Instance.CenterY) MapEditor.Instance.ShiftY = Map.Instance.VRTop + Map.Instance.CenterY;
            if (MapEditor.Instance.ShiftY + 600 > Map.Instance.VRBottom + Map.Instance.CenterY) MapEditor.Instance.ShiftY = Map.Instance.VRBottom + Map.Instance.CenterY - 600;

            physics = new MaplePyhsics(MapEditor.file.Directory.GetIMG("Physics.img"), 0, 0);
        }
Пример #3
0
 public override void Draw(DevicePanel d)
 {
     if (!Magnet)
     {
         base.Draw(d);
     }
     else
     {
         d.DrawBitmap(Image.GetCanvas().GetTexture(d._device), Map.Instance.CenterX + MagnetX - Image.GetVector("origin").x, Map.Instance.CenterY + MagnetY - Image.GetVector("origin").y, _size, Selected, Transparency);
     }
 }
Пример #4
0
 public override void Draw(DevicePanel d)
 {
     if (!s1.Selected)
     {
         s1.Transparency = Transparency;
     }
     if (!s2.Selected)
     {
         s2.Transparency = Transparency;
     }
     int cX = Map.Instance.CenterX;
     int cY = Map.Instance.CenterY;
     int x = cX + Object.GetInt("x");
     int y1 = cY + Object.GetInt("y1");
     int y2 = cY + Object.GetInt("y2");
     d.DrawLine(x, y1, x, y2, Color.FromArgb(Transparency, (Selected) ? Color.Blue : Color.Green));
     s1.Draw(d);
     s2.Draw(d);
 }
Пример #5
0
        public override void DrawAnimation(DevicePanel d)
        {
            if (animationTime == 0)
            {
                Draw(d);
                return;
            }
            int time = System.Environment.TickCount % animationTime;

            foreach (MapBackFrame frame in frames)
            {
                time -= frame.Image.GetInt("delay");
                if (time < 0)
                {
                    frame.Draw(d);
                    break;
                }
            }
        }
Пример #6
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);
 }
Пример #7
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);
        }
Пример #8
0
 public void DrawAnimation(DevicePanel d)
 {
     //for (int i = 0; i <= 20; i++)
     {
         foreach (MapObject o in objects)
         {
             //if (o.Object.GetInt("z") == i)
             {
                 o.DrawAnimation(d);
             }
         }
     }
     //for (int i = -5; i <= 0; i++)
     {
         foreach (MapTile t in tiles)
         {
             //if (!t.Selected && t.Image.GetInt("z") == i)
             {
                 t.DrawAnimation(d);
             }
         }
     }/*
     for (int i = -5; i <= 0; i++)
     {
         foreach (MapTile t in tiles)
         {
             if (t.Selected && t.Image.GetInt("z") == i)
             {
                 t.DrawAnimation(d);
             }
         }
     }*/
 }
Пример #9
0
        public void Draw(DevicePanel d)
        {
            int transparency = (MapEditor.Instance.EditMode.Checked && (!MapEditor.Instance.EditObj.Checked || MapEditor.Instance.Layer.Value != ID)) ? 0x32 : 0xFF;
            if (MapEditor.Instance.ShowObj.Checked || MapEditor.Instance.EditObj.Checked)
            {
                //for (int i = 0; i <= 20; i++)
                {
                    foreach (MapObject o in objects)
                    {
                        //if (o.Object.GetInt("z") == i)
                       {
                            o.Transparency = transparency;
                            o.Draw(d);
                        }
                    }
                }
            }

            transparency = (MapEditor.Instance.EditMode.Checked && (!MapEditor.Instance.EditTile.Checked || MapEditor.Instance.Layer.Value != ID)) ? 0x32 : 0xFF;
            if (MapEditor.Instance.ShowTile.Checked || MapEditor.Instance.EditTile.Checked)
            {
               // for (int i = -5; i <= 0; i++)
                {
                    foreach (MapTile t in tiles)
                    {
                        //if (!t.Selected && t.Image.GetInt("z") == i)
                        {
                            t.Transparency = transparency;
                            t.Draw(d);
                        }
                    }
                }
                /*for (int i = -5; i <= 0; i++)
                {
                    foreach (MapTile t in tiles)
                    {
                        if (t.Selected && t.Image.GetInt("z") == i)
                        {
                            t.Transparency = transparency;
                            t.Draw(d);
                        }
                    }
                }*/
            }

            transparency = (MapEditor.Instance.EditMode.Checked && (!(MapEditor.Instance.EditFH.Checked || MapEditor.Instance.LinkToFH.Checked) || MapEditor.Instance.Layer.Value != ID)) ? 0x32 : 0xFF;
            if (MapEditor.Instance.ShowFH.Checked || MapEditor.Instance.EditFH.Checked)
            {
                foreach (MapFootholds f in footholdGroups.Values)
                {
                    f.Transparency = transparency;
                    f.Draw(d);
                }
            }

           transparency = (MapEditor.Instance.EditMode.Checked && (!MapEditor.Instance.EditLR.Checked || MapEditor.Instance.Layer.Value != ID)) ? 0x32 : 0xFF;
           if (MapEditor.Instance.ShowLR.Checked || MapEditor.Instance.EditLR.Checked)
            {
                foreach (MapLR lr in Map.Instance.lrs)
                {
                    if (lr.Object.GetInt("page") == ID)
                    {
                        lr.Transparency = transparency;
                        lr.Draw(d);
                    }
                }
            }

            transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditLife.Checked) ? 0x32 : 0xFF;
            if (MapEditor.Instance.ShowLife.Checked || MapEditor.Instance.EditLife.Checked)
            {
                foreach (MapLife l in Map.Instance.lifes)
                {
                    if (Map.Instance.footholds.Contains(l.Object.GetInt("fh")))
                    {
                        if (IsContainFoothold(l.Object.GetInt("fh")))
                        {
                            l.Transparency = transparency;
                            l.Draw(d);
                        }
                    }
                }
            }
            if (MapEditor.Instance.Layer.Value == ID && MapEditor.Instance.EditFH.Checked && MapEditor.Instance.FootholdsCreator.Checked)
            {
                List<MapFootholdDesign> l = MapEditor.Instance.FHCreating;
                for(int i=0; i<l.Count; i++)
                {
                    if(i != l.Count - 1)
                    {
                        d.DrawLine(l[i].GetX(), l[i].GetY(), l[i + 1].GetX(), l[i + 1].GetY(), Color.Red);
                    }
                    else
                    {
                        d.DrawLine(l[i].GetX(), l[i].GetY(), MapEditor.Instance.lastX, MapEditor.Instance.lastY, Color.Red);
                    }
                }
                foreach (MapTile t in tiles)
                {
                    foreach (MapFootholdDesign fh in t.Footholds)
                    {
                        fh.Draw(d);
                    }
                }
                /*foreach (MapObject o in objects)
                {
                    foreach (MapFootholdDesign fh in o.Footholds)
                    {
                        fh.Draw(d);
                    }
                }*/
            }
            if (MapEditor.Instance.Layer.Value == ID && MapEditor.Instance.EditLR.Checked && MapEditor.Instance.FootholdsCreator.Checked)
            {
                List<MapLRDesign> l = MapEditor.Instance.LRCreating;
                for (int i = 0; i < l.Count; i++)
                {
                    if (i != l.Count - 1)
                    {
                        d.DrawLine(l[i].GetX(), l[i].GetY(), l[i + 1].GetX(), l[i + 1].GetY(), Color.Green);
                    }
                    else
                    {
                        d.DrawLine(l[i].GetX(), l[i].GetY(), MapEditor.Instance.lastX, MapEditor.Instance.lastY, Color.Red);
                    }
                }
                foreach (MapObject o in objects)
                {
                    foreach (MapLRDesign lr in o.LRs)
                    {
                        lr.Draw(d);
                    }
                }
            }
        }
Пример #10
0
        public void DrawAnimation(DevicePanel d)
        {
            d.Cache();

            //long a = System.DateTime.Now.Millisecond;
            //Console.Out.WriteLine(System.DateTime.Now.Millisecond - a);

            foreach (MapBack b in backs)
            {
                if (b.Object.GetInt("front") == 0)
                {
                    b.DrawAnimation(d);
                }
            }

            foreach (MapLayer l in layers)
            {
                l.DrawAnimation(d);
            }

            foreach (MapBack b in backs)
            {
                if (b.Object.GetInt("front") == 1)
                {
                    b.DrawAnimation(d);
                }
            }
        }
Пример #11
0
 public override void Draw(DevicePanel d)
 {
     d.DrawCircle(GetX(), GetY(), Color.Blue);
 }
Пример #12
0
 public override void Draw(DevicePanel d)
 {
     d.DrawCircle(GetX(), GetY(), Color.Blue);
 }
Пример #13
0
        public void Draw(DevicePanel d)
        {
            int transparency = (MapEditor.Instance.EditMode.Checked && (!MapEditor.Instance.EditObj.Checked || MapEditor.Instance.Layer.Value != ID)) ? 0x32 : 0xFF;

            if (MapEditor.Instance.ShowObj.Checked || MapEditor.Instance.EditObj.Checked)
            {
                //for (int i = 0; i <= 20; i++)
                {
                    foreach (MapObject o in objects)
                    {
                        //if (o.Object.GetInt("z") == i)
                        {
                            o.Transparency = transparency;
                            o.Draw(d);
                        }
                    }
                }
            }

            transparency = (MapEditor.Instance.EditMode.Checked && (!MapEditor.Instance.EditTile.Checked || MapEditor.Instance.Layer.Value != ID)) ? 0x32 : 0xFF;
            if (MapEditor.Instance.ShowTile.Checked || MapEditor.Instance.EditTile.Checked)
            {
                // for (int i = -5; i <= 0; i++)
                {
                    foreach (MapTile t in tiles)
                    {
                        //if (!t.Selected && t.Image.GetInt("z") == i)
                        {
                            t.Transparency = transparency;
                            t.Draw(d);
                        }
                    }
                }

                /*for (int i = -5; i <= 0; i++)
                 * {
                 *  foreach (MapTile t in tiles)
                 *  {
                 *      if (t.Selected && t.Image.GetInt("z") == i)
                 *      {
                 *          t.Transparency = transparency;
                 *          t.Draw(d);
                 *      }
                 *  }
                 * }*/
            }

            transparency = (MapEditor.Instance.EditMode.Checked && (!(MapEditor.Instance.EditFH.Checked || MapEditor.Instance.LinkToFH.Checked) || MapEditor.Instance.Layer.Value != ID)) ? 0x32 : 0xFF;
            if (MapEditor.Instance.ShowFH.Checked || MapEditor.Instance.EditFH.Checked)
            {
                foreach (MapFootholds f in footholdGroups.Values)
                {
                    f.Transparency = transparency;
                    f.Draw(d);
                }
            }

            transparency = (MapEditor.Instance.EditMode.Checked && (!MapEditor.Instance.EditLR.Checked || MapEditor.Instance.Layer.Value != ID)) ? 0x32 : 0xFF;
            if (MapEditor.Instance.ShowLR.Checked || MapEditor.Instance.EditLR.Checked)
            {
                foreach (MapLR lr in Map.Instance.lrs)
                {
                    if (lr.Object.GetInt("page") == ID)
                    {
                        lr.Transparency = transparency;
                        lr.Draw(d);
                    }
                }
            }

            transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditLife.Checked) ? 0x32 : 0xFF;
            if (MapEditor.Instance.ShowLife.Checked || MapEditor.Instance.EditLife.Checked)
            {
                foreach (MapLife l in Map.Instance.lifes)
                {
                    if (Map.Instance.footholds.Contains(l.Object.GetInt("fh")))
                    {
                        if (IsContainFoothold(l.Object.GetInt("fh")))
                        {
                            l.Transparency = transparency;
                            l.Draw(d);
                        }
                    }
                }
            }
            if (MapEditor.Instance.Layer.Value == ID && MapEditor.Instance.EditFH.Checked && MapEditor.Instance.FootholdsCreator.Checked)
            {
                List <MapFootholdDesign> l = MapEditor.Instance.FHCreating;
                for (int i = 0; i < l.Count; i++)
                {
                    if (i != l.Count - 1)
                    {
                        d.DrawLine(l[i].GetX(), l[i].GetY(), l[i + 1].GetX(), l[i + 1].GetY(), Color.Red);
                    }
                    else
                    {
                        d.DrawLine(l[i].GetX(), l[i].GetY(), MapEditor.Instance.lastX, MapEditor.Instance.lastY, Color.Red);
                    }
                }
                foreach (MapTile t in tiles)
                {
                    foreach (MapFootholdDesign fh in t.Footholds)
                    {
                        fh.Draw(d);
                    }
                }

                /*foreach (MapObject o in objects)
                 * {
                 *  foreach (MapFootholdDesign fh in o.Footholds)
                 *  {
                 *      fh.Draw(d);
                 *  }
                 * }*/
            }
            if (MapEditor.Instance.Layer.Value == ID && MapEditor.Instance.EditLR.Checked && MapEditor.Instance.FootholdsCreator.Checked)
            {
                List <MapLRDesign> l = MapEditor.Instance.LRCreating;
                for (int i = 0; i < l.Count; i++)
                {
                    if (i != l.Count - 1)
                    {
                        d.DrawLine(l[i].GetX(), l[i].GetY(), l[i + 1].GetX(), l[i + 1].GetY(), Color.Green);
                    }
                    else
                    {
                        d.DrawLine(l[i].GetX(), l[i].GetY(), MapEditor.Instance.lastX, MapEditor.Instance.lastY, Color.Red);
                    }
                }
                foreach (MapObject o in objects)
                {
                    foreach (MapLRDesign lr in o.LRs)
                    {
                        lr.Draw(d);
                    }
                }
            }
        }
Пример #14
0
 public abstract void Draw(DevicePanel d);
Пример #15
0
 public override void Draw(DevicePanel d)
 {
     if (!cached) Cache();
     d.DrawBitmap((_f) ? Image.GetCanvas().GetFlippedTexture(d._device) : Image.GetCanvas().GetTexture(d._device), _x, _y, _size, Selected, Transparency);
 }
Пример #16
0
 public override void Draw(DevicePanel d)
 {
     d.DrawCircle(GetX(), GetY(), Color.FromArgb(Transparency, (Selected) ? Color.Blue : Color.Red));
 }
Пример #17
0
 public virtual void DrawAnimation(DevicePanel d) { Draw(d); }
Пример #18
0
 public abstract void Draw(DevicePanel d);
Пример #19
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);
        }
Пример #20
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);
                }
            }
        }
Пример #21
0
 public override void Draw(DevicePanel d)
 {
     d.DrawCircle(GetX(), GetY(), Color.FromArgb(Transparency, (Selected || ToolTip.Selected) ? Color.Blue : Color.MediumTurquoise));
 }
Пример #22
0
 public void DrawAnimation(DevicePanel d)
 {
 }
Пример #23
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);
                }
            }
        }
Пример #24
0
 public override void Draw(DevicePanel d)
 {
     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");
     d.DrawLine(x1, y1, x2, y2, Color.FromArgb(Transparency, (Selected) ? Color.Blue : Color.Red));
     s1.Draw(d);
     s2.Draw(d);
 }
Пример #25
0
 public virtual void DrawAnimation(DevicePanel d)
 {
     Draw(d);
 }
Пример #26
0
 public override void Draw(DevicePanel d)
 {
     d.DrawCircle(GetX(), GetY(), Color.FromArgb(Transparency, (Selected) ? Color.Blue : Color.Red));
 }
Пример #27
0
 public override void Draw(DevicePanel d)
 {
     if (!cached) Cache();
     if (Magnet)
     {
         d.DrawBitmap((_f) ? Image.GetCanvas().GetFlippedTexture(d._device) : Image.GetCanvas().GetTexture(d._device), Map.Instance.CenterX + Object.GetInt("x") - ((Object.GetBool("f")) ? Image.GetCanvas().width - Image.GetVector("origin").x : Image.GetVector("origin").x), Map.Instance.CenterY + MagnetY - Image.GetVector("origin").y, _size, Selected, Transparency);
     }
     else
     {
         d.DrawBitmap((_f) ? Image.GetCanvas().GetFlippedTexture(d._device) : Image.GetCanvas().GetTexture(d._device), _x, _y, _size, Selected, Transparency);
     }
 }
Пример #28
0
        public override void Draw(DevicePanel d)
        {
            if (!cached) Cache();

            int X = MapEditor.Instance.ShiftX - Map.Instance.CenterX + 400;
            int Y = MapEditor.Instance.ShiftY - Map.Instance.CenterY + 300;

            X += (int)(X * _rX) + _x; 
            Y += (int)(Y * _rY) + _y;


            int xStart = 0, xEnd = 1, yStart = 0, yEnd = 1;
            if (_mX != 0)
            {
                xStart = (d.GetScreen().X - X) / _mX - 1;
                xEnd = (d.GetScreen().Right - X) / _mX + 1;
            }
            if (_mY != 0)
            {
                yStart = (d.GetScreen().Y - Y) / _mY - 1;
                yEnd = (d.GetScreen().Bottom - Y) / _mY + 1;
            }

            //if(_mX != 0 && _mY != 0 && Object.GetInt("cx") == 0 && Object.GetInt("cy") == 0)
            //    d.DrawBitmap((Object.GetBool("f")) ? Image.GetCanvas().GetFlippedTexture(d._device) : Image.GetCanvas().GetTexture(d._device), 0, 0, Map.Instance.Width, Map.Instance.Height, Selected, Transparency);
            //else
            for (int x = xStart; x < xEnd; x++)
            {
                for (int y = yStart; y < yEnd; y++)
                {
                    d.DrawBitmap(_f ? Image.GetCanvas().GetFlippedTexture(d._device) : Image.GetCanvas().GetTexture(d._device), X + _mX * x, Y + _mY * y, _size, Selected, Transparency); 
                }
            }
            
        }
Пример #29
0
 public override void Draw(DevicePanel d)
 {
     foreach (MapFoothold f in footholds.Values)
     {
         if (MapEditor.Instance.LinkToFH.Checked)
         {
             f.Selected = Selected;
             f.s1.Selected = Selected;
             f.s2.Selected = Selected;
         }
         else if (f.Selected)
         {
             f.Selected = false;
             f.s1.Selected = false;
             f.s2.Selected = false;
         }
         f.Transparency = Transparency;
         f.s1.Transparency = Transparency;
         f.s2.Transparency = Transparency;
         f.Draw(d);
     }
 }
Пример #30
0
 public override void Draw(DevicePanel d)
 {
     d.DrawCircle(Map.Instance.CenterX + Object.GetInt("x"), Map.Instance.CenterY + Object.GetInt("y" + ID.ToString()), Color.FromArgb(Transparency, (Selected) ? Color.Blue : Color.Green));
 }
Пример #31
0
 public override void Draw(DevicePanel d)
 {
     d.DrawCircle(Map.Instance.CenterX + Object.GetInt("x"), Map.Instance.CenterY + Object.GetInt("y" + ID.ToString()), Color.FromArgb(Transparency, (Selected) ? Color.Blue : Color.Green));
 }
Пример #32
0
 public override void Draw(DevicePanel d)
 {
     d.DrawCircle(GetX(), GetY(), Color.FromArgb(Transparency, (Selected || ToolTip.Selected) ? Color.Blue : Color.MediumTurquoise));
 }