public void EditList(IList <dynamic> objList) { ObjList list = new ObjList(RendererControl.C0ListName, objList); ListEditingStack.Push(list); foreach (var o in list) { ObjectsListBox.Items.Add(o.ToString()); } LoadObjListModels(list, RendererControl.C0ListName); PopulateListBox(); }
void InternalAddObj(LevelObj o, ObjList list) { list.Add(o); if (list == CurList) { ObjectsListBox.Items.Add(o.ToString()); } if (!(list.name == RendererControl.C0ListName && EditingList)) { AddModel(o, list.name); } }
public void SelectObject(ObjList List, LevelObj obj) { if (EditingList) { if (List != CurList) { return; } } else { comboBox1.Text = List.name; } ObjectsListBox.ClearSelected(); ObjectsListBox.SelectedIndex = List.IndexOf(obj); }
public void SearchObject(Func <LevelObj, bool> seachFn, ObjList list = null, string QueryDescription = "") { List <Tuple <ObjList, LevelObj> > Result = new List <Tuple <ObjList, LevelObj> >(); if (list != null) { foreach (var o in list) { if (seachFn(o)) { Result.Add(new Tuple <ObjList, LevelObj>(list, o)); } } } else if (EditingList) { foreach (var o in CurList) { if (seachFn(o)) { Result.Add(new Tuple <ObjList, LevelObj>(CurList, o)); } } } else { foreach (var k in LoadedLevel.objs.Values) { foreach (var o in k) { if (seachFn(o)) { Result.Add(new Tuple <ObjList, LevelObj>(k, o)); } } } } new EditorFroms.SearchResult(Result.ToArray(), QueryDescription, this).Show(); }
public void HideList(ObjList list, bool hide) { if (LoadedLevel == null || list.IsHidden == hide) { return; } list.IsHidden = hide; if (hide) { foreach (var o in list) { render.RemoveModel(o); } } else { foreach (var o in list) { AddModel(o, list.name); } } }
public void AddObj(LevelObj o, ObjList list) { AddToUndo((dynamic) => InternalDeleteObj(o, list), "Added object: " + o.ToString()); InternalAddObj(o, list); }