// Create circuit button clicked private void circuitCreateButton_Click(object sender, EventArgs e) { CreateResourceView resourceView = new CreateResourceView(); if (resourceView.ShowDialog() == DialogResult.OK) { EditorCircuit circuit = new EditorCircuit(resourceView.uid); _controller.circuits.Add(circuit); selectCircuit(circuit); } }
// Add blueprint private void addBlueprintButton_Click(object sender, EventArgs e) { CreateResourceView createResourceView = new CreateResourceView(); if (createResourceView.ShowDialog() == DialogResult.OK) { EditorBlueprint blueprint = _controller.createBlueprint(createResourceView.uid); blueprintList.RefreshItems(); if (blueprint != null) selectBlueprint(blueprint); } }
// Add material clicked private void addButton_Click(object sender, EventArgs e) { CreateResourceView createResourceView = new CreateResourceView(); if (createResourceView.ShowDialog() == DialogResult.OK) { _controller.createMaterial(createResourceView.uid); materialsListBox.RefreshItems(); } }
// Add blueprint scrap private void addScrapButton_Click(object sender, EventArgs e) { System.Diagnostics.Debug.Assert(selectedBlueprint != null); CreateResourceView createResourceView = new CreateResourceView(); if (createResourceView.ShowDialog() == DialogResult.OK) { BlueprintScrap scrap = _controller.createBlueprintScrap(selectedBlueprint, createResourceView.uid); scrapList.RefreshItems(); if (scrap != null) selectBlueprintScrap(scrap); } }
// Add new background private void addBackgroundButton_Click(object sender, EventArgs e) { CreateResourceView createResourceView = new CreateResourceView(); if (createResourceView.ShowDialog() == DialogResult.OK) { EditorBackground background = new EditorBackground(createResourceView.uid); _controller.backgrounds.Add(background); } }