private void addbtn_Click(object sender, EventArgs e) { if (ActiveMaterial.TextureMaps.Length == 3) { return; } Texture_Selector selector = new Texture_Selector(); selector.LoadTextures(textureList, "", ActiveMaterial.ParentLayout); if (selector.ShowDialog() == DialogResult.OK) { string newTexture = selector.GetSelectedTexture(); ActiveMaterial.AddTexture(newTexture); //Apply to all selected panes foreach (BasePane pane in ParentEditor.SelectedPanes) { var mat = pane.TryGetActiveMaterial(); if (mat != null && mat != ActiveMaterial && mat.TextureMaps?.Length != 3) { mat.AddTexture(newTexture); } } ReloadTexture(); ParentEditor.PropertyChanged?.Invoke(sender, e); } if (selector.UpdateTextures) { ParentEditor.UpdateTextureList(); } }
private void addbtn_Click(object sender, EventArgs e) { if (ActiveMaterial.TextureMaps.Length == 3) { return; } Texture_Selector selector = new Texture_Selector(); selector.LoadTextures(textureList, "", ActiveMaterial.ParentLayout); if (selector.ShowDialog() == DialogResult.OK) { string newTexture = selector.GetSelectedTexture(); ActiveMaterial.AddTexture(newTexture); ReloadTexture(); ParentEditor.PropertyChanged?.Invoke(sender, e); } if (selector.UpdateTextures) { ParentEditor.UpdateTextureList(); } }