Пример #1
0
        void RefreshWaypointBeacons()
        {
            for (int i = 0; i < waypointBeacons.Count; i++)
            {
                pctBox_mapImage.Controls.Remove(waypointBeacons[i]);
            }
            waypointBeacons.Clear();

            for (int i = 0; i < currentMap.Ways[combobox_SelectedWay.SelectedIndex].waypoints.Count; i++)
            {
                WaypointBeacon wb = new WaypointBeacon();
                waypointBeacons.Add(wb);
                this.pctBox_mapImage.Controls.Add(wb);
                wb.WaypointLink = currentMap.Ways[combobox_SelectedWay.SelectedIndex].waypoints[i];
                wb.Size = new Size(64, 64);
                wb.Move += wb_Move;
                wb.MouseDown += wb_MouseDown;
                wb.waypointIndex = i;
                ControlMover.Init(wb, ControlMover.Direction.Any);
                wb.Refresh();
            }
            DrawMiniMapVeiwZone();
            pctBox_mapImage.Refresh();
        }
Пример #2
0
 public void SetWaypointPosition(WaypointBeacon wb, Point wpLocation)
 {
     wb.Location = wpLocation;
     wb.WaypointLink.Position = wpLocation;
 }
Пример #3
0
 private void AddWayPoint()
 {
     WaypointBeacon wb = new WaypointBeacon();
     waypointBeacons.Add(wb);
     this.pctBox_mapImage.Controls.Add(wb);
     wb.Size = new Size(64, 64);
     wb.Move += wb_Move;
     wb.MouseDown += wb_MouseDown;
     wb.Location = new Point(
         splitContainer_panel.Panel1.HorizontalScroll.Value + (int)(splitContainer_panel.Panel1.Width * 0.5f),
         splitContainer_panel.Panel1.VerticalScroll.Value + (int)(splitContainer_panel.Panel1.Height * 0.5f)
     );
     currentMap.Ways[combobox_SelectedWay.SelectedIndex].waypoints.Add(wb.WaypointLink);
     wb.waypointIndex = currentMap.Ways[combobox_SelectedWay.SelectedIndex].Waypoints.Count;
     propGrid_properties.SelectedObject = wb.WaypointLink;
     ControlMover.Init(wb, ControlMover.Direction.Any);
     DrawMiniMapVeiwZone();
     wb.Refresh();
     pctBox_mapImage.Refresh();
 }