private void pathsList_SelectedIndexChanged(object sender, EventArgs e) { if (DataUpdateFlag) { return; } DataUpdateFlag = true; List <LevelItem> pts = new List <LevelItem>(); for (int l = 0; l < pathsList.SelectedIndices.Count; l++) { foreach (NSMBPathPoint pp in lst[pathsList.SelectedIndices[l]].points) { pts.Add(pp); } } if (pts.Count == 0) { EdControl.SelectObject(null); } else { EdControl.SelectObject(pts); EdControl.ScrollToObjects(pts); } DataUpdateFlag = false; EdControl.repaint(); }
private void viewsList_SelectedIndexChanged(object sender, EventArgs e) { if (DataUpdateFlag) { return; } DataUpdateFlag = true; List <LevelItem> views = new List <LevelItem>(); for (int l = 0; l < viewsList.SelectedIndices.Count; l++) { views.Add(lst[viewsList.SelectedIndices[l]]); } if (views.Count == 0) { EdControl.SelectObject(null); } else { EdControl.SelectObject(views); EdControl.ScrollToObjects(views); } DataUpdateFlag = false; EdControl.repaint(); }
private void entranceListBox_SelectedIndexChanged(object sender, EventArgs e) { if (DataUpdateFlag) { return; } DataUpdateFlag = true; List <LevelItem> ents = new List <LevelItem>(); for (int l = 0; l < entranceListBox.SelectedIndices.Count; l++) { ents.Add(EdControl.Level.Entrances[entranceListBox.SelectedIndices[l]]); } if (ents.Count == 0) { EdControl.SelectObject(null); } else { EdControl.SelectObject(ents); EdControl.ScrollToObjects(ents); } DataUpdateFlag = false; EdControl.repaint(); }
private void spriteFindNext_Click(object sender, EventArgs e) { if (EdControl.Level.Sprites.Count == 0) { //MessageBox.Show(LanguageManager.Get("ToolsForm", "NoSprites"), LanguageManager.Get("General", "Warning"), MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } int ind = -1; if (foundSprite != null && EdControl.Level.Sprites.Contains(foundSprite)) { ind = EdControl.Level.Sprites.IndexOf(foundSprite); } int startInd = ind; ind++; ind %= EdControl.Level.Sprites.Count; bool found = false; while (ind != startInd && !found) { if (EdControl.Level.Sprites[ind].Type == SpriteNumber.Value) { foundSprite = EdControl.Level.Sprites[ind]; found = true; } ind++; ind %= EdControl.Level.Sprites.Count; } if (found) { EdControl.SelectObject(foundSprite); EdControl.EnsureBlockVisible(foundSprite.X, foundSprite.Y); } //else //MessageBox.Show(LanguageManager.Get("ToolsForm", "NotFound"), LanguageManager.Get("General", "Warning"), MessageBoxButtons.OK, MessageBoxIcon.Warning); }