예제 #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 (ushort.TryParse(textBoxTexID.Text, out ushort shortres))
            {
                land.TextureID = shortres;
            }

            land.Flags = TileFlag.None;
            Array enumValues = Enum.GetValues(typeof(TileFlag));

            for (int i = 0; i < checkedListBox2.Items.Count; ++i)
            {
                if (checkedListBox2.GetItemChecked(i))
                {
                    land.Flags |= (TileFlag)enumValues.GetValue(i + 1);
                }
            }
            TileDataControl.ApplyFilterLand(land);
        }
예제 #2
0
        private void SearchNextName(object sender, EventArgs e)
        {
            bool res = TileDataControl.SearchName(textBoxItemName.Text, true, _land);

            if (res)
            {
                return;
            }

            DialogResult result = MessageBox.Show("No item found", "Result", MessageBoxButtons.OKCancel,
                                                  MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);

            if (result == DialogResult.Cancel)
            {
                Close();
            }
        }
예제 #3
0
        private void SearchGraphic(object sender, EventArgs e)
        {
            if (!Utils.ConvertStringToInt(textBoxGraphic.Text, out int graphic, 0, Ultima.Art.GetMaxItemID()))
            {
                return;
            }

            bool res = TileDataControl.SearchGraphic(graphic, _land);

            if (res)
            {
                return;
            }

            DialogResult result = MessageBox.Show("No item found", "Result", MessageBoxButtons.OKCancel,
                                                  MessageBoxIcon.Error, MessageBoxDefaultButton.Button2);

            if (result == DialogResult.Cancel)
            {
                Close();
            }
        }
예제 #4
0
        private void OnClickApplyFilterItem(object sender, EventArgs e)
        {
            ItemData item = new ItemData();
            string   name = textBoxName.Text;

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

            item.Name = name;
            if (short.TryParse(textBoxAnim.Text, out short shortres))
            {
                item.Animation = shortres;
            }

            if (byte.TryParse(textBoxWeight.Text, out byte byteres))
            {
                item.Weight = byteres;
            }

            if (byte.TryParse(textBoxQuality.Text, out byteres))
            {
                item.Quality = byteres;
            }

            if (byte.TryParse(textBoxQuantity.Text, out byteres))
            {
                item.Quantity = byteres;
            }

            if (byte.TryParse(textBoxHue.Text, out byteres))
            {
                item.Hue = byteres;
            }

            if (byte.TryParse(textBoxStackOff.Text, out byteres))
            {
                item.StackingOffset = byteres;
            }

            if (byte.TryParse(textBoxValue.Text, out byteres))
            {
                item.Value = byteres;
            }

            if (byte.TryParse(textBoxHeigth.Text, out byteres))
            {
                item.Height = byteres;
            }

            if (short.TryParse(textBoxUnk1.Text, out shortres))
            {
                item.MiscData = shortres;
            }

            if (byte.TryParse(textBoxUnk2.Text, out byteres))
            {
                item.Unk2 = byteres;
            }

            if (byte.TryParse(textBoxUnk3.Text, out byteres))
            {
                item.Unk3 = byteres;
            }

            item.Flags = TileFlag.None;
            Array enumValues = Enum.GetValues(typeof(TileFlag));

            for (int i = 0; i < checkedListBox1.Items.Count; ++i)
            {
                if (checkedListBox1.GetItemChecked(i))
                {
                    item.Flags |= (TileFlag)enumValues.GetValue(i + 1);
                }
            }
            TileDataControl.ApplyFilterItem(item);
        }