Beispiel #1
0
        public void SelectObjects(List <LevelItem> objs, LevelItem selectedTabType)
        {
            if (objs.Contains(selectedTabType))
            {
                objs.Remove(selectedTabType);
                objs.Insert(0, selectedTabType);
            }
            SelectedObjs = objs;
            ClearTabs();
            int tabIndex = -1;

            foreach (LevelItem obj in objs)
            {
                if (obj is NSMBObject)
                {
                    AddTab(objects);
                }
                if (obj is NSMBSprite)
                {
                    AddTab(sprites);
                }
                if (obj is NSMBEntrance)
                {
                    AddTab(entrances);
                }
                if (obj is NSMBView)
                {
                    NSMBView v = obj as NSMBView;
                    if (v.isZone)
                    {
                        AddTab(zones);
                    }
                    else
                    {
                        AddTab(views);
                    }
                }
                if (obj is NSMBPathPoint)
                {
                    NSMBPathPoint pp = obj as NSMBPathPoint;
                    if (pp.parent.isProgressPath)
                    {
                        AddTab(progresspaths);
                    }
                    else
                    {
                        AddTab(paths);
                    }
                }

                if (selectedTabType != null && obj.GetType() == selectedTabType.GetType() && tabIndex == -1)
                {
                    tabIndex = tabControl1.TabCount - 1;
                }
            }
            if (tabControl1.TabCount == 0)
            {
                SelectNone();
            }
            if (tabIndex > -1)
            {
                tabControl1.SelectedIndex = tabIndex;
            }
            EdControl.Focus();
        }