Exemple #1
0
        public void AddModel(LevelObj obj, string listName)
        {
            string PlaceholderModel = $"{ModelsFolder}/UnkBlue.obj";

            if (listName == "AreaList")
            {
                PlaceholderModel = $"{ModelsFolder}/UnkYellow.obj";
            }
            else if (listName == "DebugList")
            {
                PlaceholderModel = $"{ModelsFolder}/UnkRed.obj";
            }
            else if (listName == "CameraAreaInfo")
            {
                PlaceholderModel = $"{ModelsFolder}/UnkGreen.obj";
            }

            string ModelFile = GetModelName(obj.ModelName);

            if (ModelFile == null)
            {
                ModelFile = PlaceholderModel;
            }
            render.addModel(ModelFile, obj, obj.ModelView_Pos, obj.ModelView_Scale, obj.ModelView_Rot);
        }
Exemple #2
0
 public void InternalDeleteObj(LevelObj o, ObjList list)
 {
     ObjectsListBox.SelectedIndex = -1;
     if (list == CurList)
     {
         ObjectsListBox.Items.RemoveAt(CurList.IndexOf(o));
         render.RemoveModel(o);
     }
     list.Remove(o);
 }
Exemple #3
0
 public void DeleteObj(LevelObj o, ObjList list)
 {
     if (o == null)
     {
         return;
     }
     AddToUndo((dynamic) =>
               InternalAddObj(o, list), "Deleted object: " + o.ToString());
     InternalDeleteObj(o, list);
 }
Exemple #4
0
 public ObjList FindListByObj(LevelObj o)
 {
     foreach (string k in objs.Keys)
     {
         if (objs[k].Contains(o))
         {
             return(objs[k]);
         }
     }
     return(null);
 }
Exemple #5
0
        public void DuplicateObj(LevelObj o, ObjList list)
        {
            if (o == null)
            {
                return;
            }
            var newobj = o.Clone();

            newobj.ID = "obj" + Level.HighestID++;
            AddObj(newobj, list);
        }
Exemple #6
0
 private void ClipBoardMenu_CopyFull_Click(object sender, EventArgs e)
 {
     LevelObj[] objs = new LevelObj[SelectionCount];
     for (int i = 0; i < objs.Length; i++)
     {
         objs[i] = SelectedObjs[i].Clone();
     }
     StoredValue = new ClipBoardItem()
     {
         Type = ClipBoardItem.ClipboardType.Objects, Objs = objs
     };
 }
Exemple #7
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 #8
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 #9
0
        private void Btn_AddObj_Click(object sender, EventArgs e)
        {
            string name = "";

            InputDialog.Show("", "Enter a name for the object", ref name);
            if (name.Trim() == "")
            {
                return;
            }
            var o = new LevelObj();

            o.ID            = "obj" + Level.HighestID++;
            o.Name          = name;
            o.ModelView_Pos = render.GetPositionInView();
            AddObj(o, CurList);
            render.LookAt(o.ModelView_Pos);
        }
Exemple #10
0
 public void UpdateModelPosition(LevelObj o)
 {
     render.ChangeTransform(o, o.ModelView_Pos, o.ModelView_Scale, o.ModelView_Rot);
 }
Exemple #11
0
 public void AddObj(LevelObj o, ObjList list)
 {
     AddToUndo((dynamic) => InternalDeleteObj(o, list), "Added object: " + o.ToString());
     InternalAddObj(o, list);
 }