Ejemplo n.º 1
0
        private void panelIn_MouseClick(object sender, MouseEventArgs e)
        {
            WorldMapAreaEntry a = (WorldMapAreaEntry)listWorldMapAreas.SelectedItem;
            Rectangle coordsMap = getBordersCoordinates();

            foreach (AreaPOIEntry poi in DBCStores.AreaPOI.Records.Where(poip => coordsMap.Contains(new Point((int)poip.Y, (int)poip.X)) && poip.ContinentId == a.MapId).Reverse())
            {
                Point ptBase = new Point(
                    Convert.ToInt32(((coordsMap.Width + coordsMap.X - poi.Y) * MAX_MAP_WIDTH / coordsMap.Width) - 11),
                    Convert.ToInt32((coordsMap.Height + coordsMap.Y - poi.X) * MAX_MAP_HEIGHT / coordsMap.Height - 15));

                Rectangle rectIconDelete = new Rectangle(ptBase.X + 15, ptBase.Y - 3, 7, 7);

                if (rectIconDelete.Contains(e.Location))
                {
                    DBCStores.AreaPOI.RemoveEntry(poi.Id);

                    RePaintMap();

                    return;
                }

                Rectangle rectIcon = new Rectangle(ptBase.X, ptBase.Y, 20, 20);

                if (rectIcon.Contains(e.Location))
                {
                    txtId.Text = poi.Id.ToString();
                    txtName.Text = poi.Name;
                    txtDescription.Text = poi.Description;

                    txtNormalIcon.Text = poi.NormalIcon.ToString();
                    txtNormalIcon50.Text = poi.NormalIcon50p.ToString();
                    txtNormalIcon0.Text = poi.NormalIcon0p.ToString();
                    txtHordeIcon.Text = poi.HordeIcon.ToString();
                    txtHordeIcon50.Text = poi.HordeIcon50p.ToString();
                    txtHordeIcon0.Text = poi.HordeIcon0p.ToString();
                    txtAllianceIcon.Text = poi.AllianceIcon.ToString();
                    txtAllianceIcon50.Text = poi.AllianceIcon50p.ToString();
                    txtAllianceIcon0.Text = poi.AllianceIcon0p.ToString();

                    txtX.Text = poi.X.ToString();
                    txtY.Text = poi.Y.ToString();
                    txtZ.Text = poi.Z.ToString();

                    txtContinentId.Text = poi.ContinentId.ToString();
                    txtArea.Text = poi.Area.ToString();
                    txtImportance.Text = poi.Importance.ToString();
                    txtFactionId.Text = poi.FactionId.ToString();
                    txtWorldState.Text = poi.WorldState.ToString();
                    txtFlags.Text = poi.Flags.ToString();
                    // Valeur non utilisée, toujours 0
                    //txtWorldMapLink.Text = poi.WorldMapLink.ToString();

                    panelIn_Paint(null, null);

                    return;
                }
            }

            // Si on arrive ici c'est que le clic ne correspond à aucun emplacement de poi
            AreaPOIEntry newPoi = new AreaPOIEntry
            {
                Id = DBCStores.AreaPOI.MaxKey + 1,
                NormalIcon = (Editors.POIsEditor.Icons.m_poisIconsEditor == null) ? 45 : (uint)Editors.POIsEditor.Icons.IconIdSelected,
                X = coordsMap.Height + coordsMap.Y - (e.Y + 15 - 9) * coordsMap.Height / MAX_MAP_HEIGHT,
                Y = coordsMap.Width + coordsMap.X - (e.X + 11 - 9) * coordsMap.Width / MAX_MAP_WIDTH,
                ContinentId = a.MapId,
                Name = "Nouveau point d'intérêt",
                Description = "",
            };
            DBCStores.AreaPOI.AddEntry(newPoi.Id, newPoi);

            RePaintMap();
        }
Ejemplo n.º 2
0
        private void panelIn_MouseDown(object sender, MouseEventArgs e)
        {
            WorldMapAreaEntry a = (WorldMapAreaEntry)listWorldMapAreas.SelectedItem;
            Rectangle coordsMap = getBordersCoordinates();

            foreach (AreaPOIEntry poi in DBCStores.AreaPOI.Records.Where(poip => coordsMap.Contains(new Point((int)poip.Y, (int)poip.X)) && poip.ContinentId == a.MapId).Reverse())
            {
                Point ptBase = new Point(
                    Convert.ToInt32(((coordsMap.Width + coordsMap.X - poi.Y) * MAX_MAP_WIDTH / coordsMap.Width) - 11),
                    Convert.ToInt32((coordsMap.Height + coordsMap.Y - poi.X) * MAX_MAP_HEIGHT / coordsMap.Height - 15));

                Rectangle rectIcon = new Rectangle(ptBase.X, ptBase.Y, 20, 20);

                if (rectIcon.Contains(e.Location))
                {
                    ClickIsDown = true;
                    PoiSelected = poi;
                    return;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Permet de récupérer l'icône d'un POI à afficher en fonction des paramètres d'affichage (Alliance/Horde/Neutre & 100%/50%/0%)
 /// </summary>
 /// <param name="poi"></param>
 /// <returns></returns>
 private uint getIconPoiForDisplayOptions(AreaPOIEntry poi)
 {
     if (listFaction.SelectedIndex == 1)
         if (barDestruct.Value == 1)
             return poi.HordeIcon50p;
         else if (barDestruct.Value == 0)
             return poi.HordeIcon0p;
         else
             return poi.HordeIcon;
     else if (listFaction.SelectedIndex == 2)
         if (barDestruct.Value == 1)
             return poi.AllianceIcon50p;
         else if (barDestruct.Value == 0)
             return poi.AllianceIcon0p;
         else
             return poi.AllianceIcon;
     else
         if (barDestruct.Value == 1)
             return poi.NormalIcon50p;
         else if (barDestruct.Value == 0)
             return poi.NormalIcon0p;
         else
             return poi.NormalIcon;
 }