Exemple #1
0
        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();
        }
Exemple #2
0
 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);
     }
 }
Exemple #3
0
 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);
 }
Exemple #4
0
        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();
        }
Exemple #5
0
        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);
                }
            }
        }
Exemple #6
0
 public void AddObj(LevelObj o, ObjList list)
 {
     AddToUndo((dynamic) => InternalDeleteObj(o, list), "Added object: " + o.ToString());
     InternalAddObj(o, list);
 }