private void telePointGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (!gotJob) { if (e.RowIndex != -1) { telePoint t = (telePoint)telePointGrid.CurrentRow.Cells[0].Value; if (t.mapId == ObjectManager.MapId) { curLoc = new Objects.Location(t.x, t.y, t.z); gotJob = true; } } } }
private void UpdateGrid() { telePointGrid.Rows.Clear(); foreach (string x in strTeleports) { string[] tmp = x.Split('|'); if (tmp.Length == 5) { if (tmp[0].ToLower().Contains(tbSearch.Text.ToLower())) { float tmpX; if (float.TryParse(tmp[1].Replace(',', '.'), NumberStyles.Any, CultureInfo.InvariantCulture, out tmpX)) { float tmpY; if (float.TryParse(tmp[2].Replace(',', '.'), NumberStyles.Any, CultureInfo.InvariantCulture, out tmpY)) { float tmpZ; if (float.TryParse(tmp[3].Replace(',', '.'), NumberStyles.Any, CultureInfo.InvariantCulture, out tmpZ)) { int tmpMapId; if (int.TryParse(tmp[4].Replace(',', '.'), NumberStyles.Any, CultureInfo.InvariantCulture, out tmpMapId)) { telePoint p = new telePoint(); p.name = tmp[0]; p.mapId = tmpMapId; p.x = tmpX; p.y = tmpY; p.z = tmpZ; telePointGrid.Rows.Add(p); } } } } } } } }