public void Draw(DevicePanel d) { for (int i = 1; i < points.Count; i++) { d.DrawLine(points[i - 1].X, points[i - 1].Y, points[i].X, points[i].Y, Color.Black); } if (closed) { d.DrawLine(points.First <Point>().X, points.First <Point>().Y, points.Last <Point>().X, points.Last <Point>().Y, Color.Black); } }
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); }
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); }
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); }
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); } } } }
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); } } }
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); } } } }