void UpdateCompList() { EditorUIBase GenCompEntry(int index) { var disp = new EHorizontalLayout() + new EText().Content(index.ToString()).Width(20) + new EText().BindContent(() => { AssetTypes.ComponentDBPage p = window.GetSelectedPage(); if (p != null) { if (p.componentList.Count > index) { return(p.componentList[index].name); } } return("OUT OF SCOPE!"); }).RelativeSize(true); var tabs = new ESwitchTab().Height(100); var element = tabs //Unselected + (new EButton().OnClicked((EButton b) => { window.selectedComp = index; window.OpenCompEditTab(); }) + disp ) ; element.OnConstruct(window); return(element); } AssetTypes.ComponentDBPage page = window.GetSelectedPage(); if (page == null) { compList.children.Clear(); return; } if (compList.children.Count < page.componentList.Count) { for (int i = compList.children.Count; i < page.componentList.Count; i++) { compList.children.Add(GenCompEntry(i)); } } else if (page.componentList.Count < compList.children.Count) { compList.children.RemoveRange(page.componentList.Count, compList.children.Count - page.componentList.Count); } }
bool CheckNameViability() { if (compName == null || compName == "") { return(false); } var db = window.GetSelectedPage(); if (db == null) { return(false); } foreach (var item in db.componentList) { if (item.name == compName) { return(false); } } return(true); }