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); }
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); }
public void DeleteObj(LevelObj o, ObjList list) { if (o == null) { return; } AddToUndo((dynamic) => InternalAddObj(o, list), "Deleted object: " + o.ToString()); InternalDeleteObj(o, list); }
public ObjList FindListByObj(LevelObj o) { foreach (string k in objs.Keys) { if (objs[k].Contains(o)) { return(objs[k]); } } return(null); }
public void DuplicateObj(LevelObj o, ObjList list) { if (o == null) { return; } var newobj = o.Clone(); newobj.ID = "obj" + Level.HighestID++; AddObj(newobj, list); }
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 }; }
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); }
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); }
public void UpdateModelPosition(LevelObj o) { render.ChangeTransform(o, o.ModelView_Pos, o.ModelView_Scale, o.ModelView_Rot); }
public void AddObj(LevelObj o, ObjList list) { AddToUndo((dynamic) => InternalDeleteObj(o, list), "Added object: " + o.ToString()); InternalAddObj(o, list); }