private void btnUberTexture_Click(object sender, EventArgs e) { // TODO: present some sort of output letting the user know // that they need to have a texture selected. if (_materialPass == null) { return; } // present the texture dialog to the user. Dialogs.TextureSelectionDialog dialog = new Dialogs.TextureSelectionDialog(true); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.Cancel) { return; } // get the current selection (or possibly none). string selection = null; int count = dialog.Selection.Count; if (count > 0) { selection = dialog.Selection[0]; } else { selection = ""; } // set the selection to the ubertexture. _materialPass.UberTexture = selection; }
//-------------------------------- private void btnUbertexture_Click(object sender, EventArgs e) { // present the texture dialog to the user. if (_textureSelector == null) { _textureSelector = new Dialogs.TextureSelectionDialog(true); } DialogResult result = _textureSelector.ShowDialog(); if (result == DialogResult.Cancel) { return; } // get the current selection (or possibly none). string selection = null; int count = _textureSelector.Selection.Count; if (count > 0) { selection = _textureSelector.Selection[0]; } else { return; } // set the selection to the ubertexture. _uberTexture = selection; // TODO: clip the selection to a reasonable length. string displayName = "(" + selection + ")"; // replace the button's text with the current selection. btnUbertexture.Text = displayName; }
private void texButton_Click(object sender, EventArgs e) { // TODO: present some sort of output letting the user know // that they need to have a texture selected. if (_materialPass == null) { return; } // present the texture dialog to the user. Dialogs.TextureSelectionDialog dialog = new Dialogs.TextureSelectionDialog(false); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.Cancel) { return; } // get the current selection (or possibly none). string selection = null; int count = dialog.Selection.Count; if (count > 0) { selection = dialog.Selection[0]; } else { return; } // figure out what stage to bind the texture to. Bootstrap.TextureStage stage = null; ButtonAdv button = sender as ButtonAdv; if (button == btnDiffuseTexture) { stage = _materialPass.DiffuseStage; } else if (button == btnSpecularTexture) { stage = _materialPass.SpecularStage; } else if (button == btnNormalTexture) { stage = _materialPass.NormalStage; } else if (button == btnBumpTexture) { stage = _materialPass.BumpStage; } else if (button == btnEmissiveTexture) { stage = _materialPass.EmissiveStage; } else if (button == btnAmbientTexture) { stage = _materialPass.AmbientStage; } else { return; } // finish by binding the texture to the stage. stage.Texture = selection; }