public MapClearStatics(FiddlerControls.Map parent, Ultima.Map map) { MapParent = parent; Map = map; InitializeComponent(); this.Icon = FiddlerControls.Options.GetFiddlerIcon(); numericUpDownX1.Maximum = map.Width; numericUpDownX2.Maximum = map.Width; numericUpDownY1.Maximum = map.Height; numericUpDownY2.Maximum = map.Height; }
private void ChangeMap() { SetScrollBarValues(); string path = toolStripTextBox1.Text; if (Directory.Exists(path)) { currmap = Ultima.Map.Custom = new Ultima.Map(path, origmap.FileIndex, currmapint, origmap.Width, origmap.Height); } CalculateDiffs(); pictureBox.Invalidate(); }
public static bool ComputeMapDetails(Ultima.Map map, int x, int y, out int xCenter, out int yCenter, out int xWidth, out int yHeight) { xWidth = 5120; yHeight = 4096; if (map == Ultima.Map.Trammel || map == Ultima.Map.Felucca) { if (x >= 0 && y >= 0 && x < 5120 && y < map.Height) { xCenter = 1323; yCenter = 1624; } else if (x >= 5120 && y >= 2304 && x < 6144 && y < map.Height) { xCenter = 5936; yCenter = 3112; } else { xCenter = 0; yCenter = 0; return(false); } } else if (x >= 0 && y >= 0 && x < map.Width && y < map.Height) { xCenter = 1323; yCenter = 1624; } else { xCenter = map.Width / 2; yCenter = map.Height / 2; return(false); } return(true); }
private Map(int index, Ultima.Map mapObject) { m_Index = index; m_MapObject = mapObject; }
public void FullUpdate() { if (!Active) { return; } if (m_Background != null) { m_Background.Dispose(); } m_Background = new Bitmap(this.Width, this.Height); int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; int w = (this.Width) >> 3; int h = (this.Height) >> 3; int xtrans = this.Width / 2; int ytrans = this.Height / 2; Point3D focus = this.FocusMobile.Position; Point offset = new Point(focus.X & 7, focus.Y & 7); Point mapOrigin = new Point((focus.X >> 3) - (w / 2), (focus.Y >> 3) - (h / 2)); Point pntPlayer = new Point((focus.X) - (mapOrigin.X << 3) - offset.X, (focus.Y) - (mapOrigin.Y << 3) - offset.Y); Graphics gfx = Graphics.FromImage(m_Background); gfx.FillRectangle(Brushes.Black, 0, 0, this.Width, this.Height); gfx.TranslateTransform(-xtrans, -ytrans, MatrixOrder.Append); gfx.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; gfx.PageUnit = GraphicsUnit.Pixel; gfx.ScaleTransform(1.5f, 1.5f, MatrixOrder.Append); gfx.RotateTransform(45, MatrixOrder.Append); gfx.TranslateTransform(xtrans, ytrans, MatrixOrder.Append); Ultima.Map map = Map.GetMap(this.FocusMobile.Map); if (map == null) { map = Ultima.Map.Felucca; } gfx.DrawImage(map.GetImage(mapOrigin.X, mapOrigin.Y, w + offset.X, h + offset.Y, true), -offset.X, -offset.Y); gfx.ScaleTransform(1.0f, 1.0f, MatrixOrder.Append); ArrayList regions = new ArrayList(); ArrayList mButtons = new ArrayList(); if (this.Width > this.Height) { regions = RegionList(focus.X, focus.Y, this.Width); mButtons = ButtonList(focus.X, focus.Y, this.Width); } else { regions = RegionList(focus.X, focus.Y, this.Height); mButtons = ButtonList(focus.X, focus.Y, this.Height); } foreach (Assistant.MapUO.Region region in regions) { gfx.DrawRectangle(Pens.LimeGreen, (region.X) - ((mapOrigin.X << 3) + offset.X), (region.Y) - ((mapOrigin.Y << 3) + offset.Y), region.Width, region.Length); } gfx.DrawLine(Pens.Silver, pntPlayer.X - 2, pntPlayer.Y - 2, pntPlayer.X + 2, pntPlayer.Y + 2); gfx.DrawLine(Pens.Silver, pntPlayer.X - 2, pntPlayer.Y + 2, pntPlayer.X + 2, pntPlayer.Y - 2); gfx.FillRectangle(Brushes.Red, pntPlayer.X, pntPlayer.Y, 1, 1); //gfx.DrawEllipse( Pens.Silver, pntPlayer.X - 2, pntPlayer.Y - 2, 4, 4 ); gfx.DrawString("W", m_BoldFont, Brushes.Red, pntPlayer.X - 35, pntPlayer.Y - 5); gfx.DrawString("E", m_BoldFont, Brushes.Red, pntPlayer.X + 25, pntPlayer.Y - 5); gfx.DrawString("N", m_BoldFont, Brushes.Red, pntPlayer.X - 5, pntPlayer.Y - 35); gfx.DrawString("S", m_BoldFont, Brushes.Red, pntPlayer.X - 5, pntPlayer.Y + 25); gfx.ResetTransform(); if (Format(new Point(focus.X, focus.Y), Ultima.Map.Felucca, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { string locString = String.Format("{0}°{1}'{2} {3}°{4}'{5} | ({6},{7})", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W", World.Player.Position.X, World.Player.Position.Y); SizeF size = gfx.MeasureString(locString, m_RegFont); gfx.FillRectangle(Brushes.Wheat, 0, 0, size.Width + 2, size.Height + 2); gfx.DrawRectangle(Pens.Black, 0, 0, size.Width + 2, size.Height + 2); gfx.DrawString(locString, m_RegFont, Brushes.Black, 1, 1); } gfx.ResetTransform(); gfx.Dispose(); this.Refresh(); }
private void OnClickChangeTrammel(object sender, EventArgs e) { if (!trammelToolStripMenuItem.Checked) { ResetCheckedMap(); trammelToolStripMenuItem.Checked = true; origmap = Ultima.Map.Trammel; currmapint = 1; ChangeMap(); } }
private void OnLoad(object sender, EventArgs e) { currmap = Ultima.Map.Custom; origmap = Ultima.Map.Felucca; feluccaToolStripMenuItem.Checked = true; trammelToolStripMenuItem.Checked = false; ilshenarToolStripMenuItem.Checked = false; malasToolStripMenuItem.Checked = false; tokunoToolStripMenuItem.Checked = false; terMurToolStripMenuItem.Checked = false; showDifferencesToolStripMenuItem.Checked = true; showMap1ToolStripMenuItem.Checked = true; showMap2ToolStripMenuItem.Checked = false; SetScrollBarValues(); ChangeMapNames(); ZoomLabel.Text = String.Format("Zoom: {0}", Zoom); FiddlerControls.Options.LoadedUltimaClass["Map"] = true; FiddlerControls.Options.LoadedUltimaClass["RadarColor"] = true; if (!Loaded) { FiddlerControls.Events.MapDiffChangeEvent += new FiddlerControls.Events.MapDiffChangeHandler(OnMapDiffChangeEvent); FiddlerControls.Events.MapNameChangeEvent += new FiddlerControls.Events.MapNameChangeHandler(OnMapNameChangeEvent); FiddlerControls.Events.MapSizeChangeEvent += new FiddlerControls.Events.MapSizeChangeHandler(OnMapSizeChangeEvent); FiddlerControls.Events.FilePathChangeEvent += new FiddlerControls.Events.FilePathChangeHandler(OnFilePathChangeEvent); } Loaded = true; }
private void OnClickChangeTerMur(object sender, EventArgs e) { if (!terMurToolStripMenuItem.Checked) { ResetCheckedMap(); terMurToolStripMenuItem.Checked = true; origmap = Ultima.Map.TerMur; currmapint = 5; ChangeMap(); } }
private void OnClickChangeTokuno(object sender, EventArgs e) { if (!tokunoToolStripMenuItem.Checked) { ResetCheckedMap(); tokunoToolStripMenuItem.Checked = true; origmap = Ultima.Map.Tokuno; currmapint = 4; ChangeMap(); } }
private void OnClickChangeMalas(object sender, EventArgs e) { if (!malasToolStripMenuItem.Checked) { ResetCheckedMap(); malasToolStripMenuItem.Checked = true; origmap = Ultima.Map.Malas; currmapint = 3; ChangeMap(); } }
private void OnClickChangeIlshenar(object sender, EventArgs e) { if (!ilshenarToolStripMenuItem.Checked) { ResetCheckedMap(); ilshenarToolStripMenuItem.Checked = true; origmap = Ultima.Map.Ilshenar; currmapint = 2; ChangeMap(); } }
private void OnClickChangeFelucca(object sender, EventArgs e) { if (!feluccaToolStripMenuItem.Checked) { ResetCheckedMap(); feluccaToolStripMenuItem.Checked = true; origmap = Ultima.Map.Felucca; currmapint = 0; ChangeMap(); } }
private void ChangeMap() { SetScrollBarValues(); string path = toolStripTextBox1.Text; if (Directory.Exists(path)) currmap = Ultima.Map.Custom = new Ultima.Map(path, origmap.FileIndex, currmapint, origmap.Width, origmap.Height); CalculateDiffs(); pictureBox.Invalidate(); }
protected override void OnPaint(PaintEventArgs e) { if (Current == null) { return; } position = Current.Position; Point point = new Point(position.X % 8, position.Y % 8); Point start = new Point((position.X / 8) - (Width / 16), (position.Y / 8) - (Height / 16)); Point center = new Point((position.X - (start.X * 8)) - point.X, (position.Y - (start.Y * 8)) - point.Y); e.Graphics.TranslateTransform(-Width / 2F, -Height / 2F, MatrixOrder.Append); e.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor; e.Graphics.ScaleTransform(1.5F, 1.5F, MatrixOrder.Append); e.Graphics.RotateTransform(45F, MatrixOrder.Append); e.Graphics.TranslateTransform(Width / 2F, Height / 2F, MatrixOrder.Append); Ultima.Map map = Map.GetMap(Current.Map) ?? Ultima.Map.Trammel; e.Graphics.DrawImage(map.GetImage(start.X, start.Y, Width / 8 + point.X, Height / 8 + point.Y, true), -point.X, -point.Y); e.Graphics.ScaleTransform(1F, 1F, MatrixOrder.Append); e.Graphics.FillRectangle(GetBrush(Current), center.X - 1, center.Y - 1, 2, 2); if (Current != World.Player) { e.Graphics.DrawString(Current.GetName(), Font, Brushes.Silver, center.X, center.Y); } party.Clear(); foreach (Serial serial in Party) { Mobile mobile = World.FindMobile(serial); Point3D pos = mobile != null ? mobile.Position : Point3D.Zero; party.Add(serial, pos); if (pos != Point3D.Zero && mobile != Current) { DrawPoint(e.Graphics, pos, mobile != null ? mobile.GetName() : "(Unknown)", GetBrush(mobile), center); } } if ((PositionCheck.InFire || PositionCheck.InKhaldun) && ConfigEx.GetElement(true, "RadarArcheologyGrid")) { for (int x = center.X - position.X + (position.X - Width) + 40 - (position.X - Width) % 40; x < Width; x += 40) { e.Graphics.DrawLine(Pens.Gray, x, center.Y - Height, x, center.Y + Height); } for (int y = center.Y - position.Y + (position.Y - Height) + 40 - (position.Y - Height) % 40; y < Height; y += 40) { e.Graphics.DrawLine(Pens.Gray, center.X - Width, y, center.X + Width, y); } } foreach (Item sos in World.Player.Backpack.FindItems(0x14ED)) { FishingSOS.SOSInfo info; if (FishingSOS.List.TryGetValue(sos.Serial, out info) && info.Felucca.HasValue) { DrawPoint(e.Graphics, info.Location, null, Brushes.Gold, center); } } e.Graphics.ResetTransform(); e.Graphics.DrawString("W", bigFont, Brushes.DeepPink, 0, 0); e.Graphics.DrawString("S", bigFont, Brushes.DeepPink, 0, Height - bigFont.Height); e.Graphics.DrawString("N", bigFont, Brushes.DeepPink, Width - bigFont.Height, 0); e.Graphics.DrawString("E", bigFont, Brushes.DeepPink, Width - bigFont.Height, Height - bigFont.Height); position = World.Player.Position; }