Beispiel #1
0
		public override void MapImage_MouseClick( object sender, MouseEventArgs e ) {
			if( MapControl.CanEdit == false )
				return;

			int i = InRange( e.X, e.Y );
			if( i == -1 && e.Button != MouseButtons.Left )
				return;

			// remove a Point
			if( e.Button == MouseButtons.Right ) {
				if( RemovePoint != null )
					RemovePoint( i );
				return;
			}

			// edit a Point
			if( e.Button == MouseButtons.Middle ) {
				mToolTip.Active = false;
				if( EditPoint != null )
					EditPoint( i, Factory[ i ].X, Factory[ i ].Y );

				return;
			}

			// add a Point
			frmMobPoint frm = new frmMobPoint( "hinzufügen..." );
			if( frm.ShowDialog() != DialogResult.OK )
				return;

			Factory.AddToList( SMobPoint.FromForm( e.X, e.Y, frm ) );

			this.Invalidate();
		}
Beispiel #2
0
        public void EditMobPoint(int i, int x, int y)
        {
            frmMobPoint frm = new frmMobPoint("bearbeiten...");

            SMobPoint p = mFactory[i] as SMobPoint;

            frm.txtName.Text            = p.Name;
            frm.txtLevel.Text           = p.Level;
            frm.cbCount.Text            = p.Anzahl;
            frm.cbElement.SelectedIndex = (int)p.Element;
            frm.chkBoss.Checked         = p.IsBoss;
            frm.txtInfo.Text            = p.InfoDesc;
            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            p.Changed  = true;
            p.Name     = frm.txtName.Text;
            p.Level    = frm.txtLevel.Text;
            p.Anzahl   = frm.cbCount.Text;
            p.Element  = (EMobElement)frm.cbElement.SelectedIndex;
            p.IsBoss   = frm.chkBoss.Checked;
            p.InfoDesc = frm.txtInfo.Text;

            for (int j = 0; j < listMobPoints.Items.Count; j++)
            {
                if (int.Parse(listMobPoints.Items[j].Tag.ToString()) == i)
                {
                    listMobPoints.Items[j] = FactoryMobPoint.BuildListItem(mFactory, i, p);
                    break;
                }
            }

            MonsterMap.Invalidate();
        }