Beispiel #1
0
        public bool SelectPoint(SMobPoint p, bool Clear)
        {
            if (Clear == true)
            {
                listMobPoints.SelectedIndices.Clear();
                mMarkedMobs.Clear();
                MonsterMap.Invalidate();
            }

            for (int i = 0; i < mFactory.Points.Count; i++)
            {
                if (mFactory[i].Equals(p) == true)
                {
                    mMarkedMobs.Add(i);

                    for (int j = 0; j < listMobPoints.Items.Count; j++)
                    {
                        if (int.Parse(listMobPoints.Items[j].Tag.ToString()) == i)
                        {
                            listMobPoints.SelectedIndices.Add(j);
                            break;
                        }
                    }
                    return(true);
                }
            }
            return(false);
        }
Beispiel #2
0
        public void InitializeMobImage()
        {
            if (SMobPoints.MobImages == null)
            {
                SMobPoints.MobImages = new Image[4] {
                    Properties.Resources.Mob1,
                    Properties.Resources.Mob2,
                    Properties.Resources.Mob3,
                    Properties.Resources.Mob4
                };
            }

            imgMob1.Image    = SMobPoints.MobImages[0];
            imgMob2.Image    = SMobPoints.MobImages[1];
            imgMob3.Image    = SMobPoints.MobImages[2];
            imgMob4.Image    = SMobPoints.MobImages[3];
            imgMobBoss.Image = Properties.Resources.MobBoss;

            MonsterMap.Factory = mFactory;
            MonsterMap.Image   = Bitmap.FromStream(mAssembly.GetManifestResourceStream(string.Format(FactoryMobPoint.MapRessource, mFactory.Map.ToString())));

            lblMobLevel1.Text = "Mob " + mFactory.ActiveMapRule.MobLevel1;
            lblMobLevel2.Text = "Mob " + mFactory.ActiveMapRule.MobLevel2;
            lblMobLevel3.Text = "Mob " + mFactory.ActiveMapRule.MobLevel3;
            lblMobLevel4.Text = "Mob " + mFactory.ActiveMapRule.MobLevel4;

            MonsterMap.Invalidate();
        }
Beispiel #3
0
        public bool MoveMobPoints(Keys key)
        {
            if (mMarkedMobs.Count == 0)
            {
                return(false);
            }
            if (MapControl.CanEdit == false)
            {
                return(false);
            }

            mMarkedMobs.ForEach(
                delegate(int i) {
                switch (key)
                {
                case Keys.Up:
                    if (mFactory[i].Y == 0)
                    {
                        break;
                    }
                    mFactory[i].Y--;
                    mFactory[i].Changed = true;
                    break;

                case Keys.Down:
                    if (mFactory[i].Y == MonsterMap.Height)
                    {
                        break;
                    }
                    mFactory[i].Y++;
                    mFactory[i].Changed = true;
                    break;

                case Keys.Left:
                    if (mFactory[i].X == 0)
                    {
                        break;
                    }
                    mFactory[i].X--;
                    mFactory[i].Changed = true;
                    break;

                case Keys.Right:
                    if (mFactory[i].X == MonsterMap.Width)
                    {
                        break;
                    }
                    mFactory[i].X++;
                    mFactory[i].Changed = true;
                    break;
                }
            }
                );

            MonsterMap.Invalidate();
            return(true);
        }
Beispiel #4
0
        private void listMobPoints_SelectedIndexChanged(object sender, EventArgs e)
        {
            mMarkedMobs.Clear();
            for (int i = 0; i < listMobPoints.SelectedItems.Count; i++)
            {
                mMarkedMobs.Add(int.Parse(listMobPoints.SelectedItems[i].Tag.ToString()));
            }

            MonsterMap.Invalidate();
        }
Beispiel #5
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();
        }