private void SearchNextName(object sender, EventArgs e) { bool res = TileDatas.SearchName(textBoxItemName.Text, true, land); if (!res) { DialogResult result = MessageBox.Show("No item found", "Result", MessageBoxButtons.OKCancel, MessageBoxIcon.Error, MessageBoxDefaultButton.Button2); if (result == DialogResult.Cancel) { Close(); } } }
private void SearchGraphic(object sender, EventArgs e) { int graphic; if (Utils.ConvertStringToInt(textBoxGraphic.Text, out graphic, 0, (land ? Ultima.Art.LandLength : Ultima.Art.StaticLength) - 1)) { bool res = TileDatas.SearchGraphic(graphic, land); if (!res) { DialogResult result = MessageBox.Show("No item found", "Result", MessageBoxButtons.OKCancel, MessageBoxIcon.Error, MessageBoxDefaultButton.Button2); if (result == DialogResult.Cancel) { Close(); } } } }
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; short shortres; if (short.TryParse(textBoxTexID.Text, out 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); }
public TileDatas() { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); InitializeComponent(); checkedListBox1.BeginUpdate(); checkedListBox1.Items.Clear(); string[] EnumNames = System.Enum.GetNames(typeof(TileFlag)); for (int i = 1; i < EnumNames.Length; ++i) { checkedListBox1.Items.Add(EnumNames[i], false); } checkedListBox1.EndUpdate(); checkedListBox2.BeginUpdate(); checkedListBox2.Items.Clear(); checkedListBox2.Items.Add(System.Enum.GetName(typeof(TileFlag), TileFlag.Damaging), false); checkedListBox2.Items.Add(System.Enum.GetName(typeof(TileFlag), TileFlag.Wet), false); checkedListBox2.Items.Add(System.Enum.GetName(typeof(TileFlag), TileFlag.Impassable), false); checkedListBox2.Items.Add(System.Enum.GetName(typeof(TileFlag), TileFlag.Wall), false); checkedListBox2.Items.Add(System.Enum.GetName(typeof(TileFlag), TileFlag.Unknown3), false); checkedListBox2.EndUpdate(); refMarker = this; }
public TileDatas() { ChangesInTiledataOrRadarCol = new bool[ItemMaxIndex + LandMaxIndex]; Array.Clear(ChangesInTiledataOrRadarCol, 0, ChangesInTiledataOrRadarCol.Length); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); InitializeComponent(); checkedListBox1.BeginUpdate(); checkedListBox1.Items.Clear(); EnumNames = System.Enum.GetNames(typeof(TileFlag)); for (int i = 1; i < EnumNames.Length; ++i) { if (EnumNames[i].StartsWith("UnUsed")) continue; checkedListBox1.Items.Add(EnumNames[i], false); } checkedListBox1.EndUpdate(); checkedListBox2.BeginUpdate(); checkedListBox2.Items.Clear(); checkedListBox2.Items.Add(System.Enum.GetName(typeof(TileFlag), TileFlag.Damaging), false); checkedListBox2.Items.Add(System.Enum.GetName(typeof(TileFlag), TileFlag.Wet), false); checkedListBox2.Items.Add(System.Enum.GetName(typeof(TileFlag), TileFlag.Impassable), false); checkedListBox2.Items.Add(System.Enum.GetName(typeof(TileFlag), TileFlag.Wall), false); checkedListBox2.Items.Add(System.Enum.GetName(typeof(TileFlag), TileFlag.Unknown3), false); checkedListBox2.EndUpdate(); refMarker = this; ReloadCliloc(); }
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; byte byteres; short shortres; if (short.TryParse(textBoxAnim.Text, out shortres)) { item.Animation = shortres; } if (byte.TryParse(textBoxWeight.Text, out 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 = System.Enum.GetValues(typeof(TileFlag)); for (int i = 0; i < checkedListBox1.Items.Count; ++i) { if (checkedListBox1.GetItemChecked(i)) { item.Flags |= (TileFlag)EnumValues.GetValue(i + 1); } } TileDatas.ApplyFilterItem(item); }