Beispiel #1
0
        private void OnClickApplyFilterLand(object sender, EventArgs e)
        {
            LandData land = new LandData();
            string   name = textBoxNameLand.Text;

            if (name.Length > 20)
            {
                name = name.Substring(0, 20);
            }

            land.Name = name;
            if (short.TryParse(textBoxTexID.Text, out short shortres))
            {
                land.TextureID = shortres;
            }

            land.Flags = TileFlag.None;
            if (checkedListBox2.GetItemChecked(0))
            {
                land.Flags |= TileFlag.Damaging;
            }

            if (checkedListBox2.GetItemChecked(1))
            {
                land.Flags |= TileFlag.Wet;
            }

            if (checkedListBox2.GetItemChecked(2))
            {
                land.Flags |= TileFlag.Impassable;
            }

            if (checkedListBox2.GetItemChecked(3))
            {
                land.Flags |= TileFlag.Wall;
            }

            if (checkedListBox2.GetItemChecked(4))
            {
                land.Flags |= TileFlag.Unknown3;
            }

            TileDatas.ApplyFilterLand(land);
        }