public override void DisplayAllOnMainPanel() { form.MainScriptingPanel.BackColor = Color.Silver; VisualProject visualProject = form.projectManager.visualProject; int amountOfPanelsInRow = (int)Math.Floor((double)form.MainScriptingPanel.Size.Width / (double)100); int amountOfRows = (int)Math.Ceiling((double)visualProject.visualClasses.Count / (double)amountOfPanelsInRow); for (int y = 0; y < amountOfRows; y++) { for (int x = 0; x < amountOfPanelsInRow; x++) { if (!(visualProject.visualClasses.Count <= y * amountOfPanelsInRow + x)) { ClassAssetButton newPanel = new ClassAssetButton(visualProject.visualClasses[y * amountOfPanelsInRow + x]); form.MainScriptingPanel.Controls.Add(newPanel); newPanel.Location = new Point(x * 100, y * 100); newPanel.assetPressed += AssetPressed; } } } }
public ProjectManager(Form1 _form) { form = _form; form.projectManager = this; navigationPanel = form.NavigationPanel; Instance = this; visualProject = new VisualProject(); showingEditors = new List <BaseEditorManager>(); AssetsEditorManager assetEditor = new AssetsEditorManager(form); showingEditors.Add(assetEditor); VisualClass newClass = new VisualClass("Program"); VisualClassScriptEditorManager scriptEdditor = new VisualClassScriptEditorManager(form, newClass); showingEditors.Add(scriptEdditor); visualProject.visualClasses.Add(newClass); ChangeSelectedEditorIndex(0); UpdateNavigationPanel(); }