Fix showing shader source code window over a calling window

This commit is contained in:
Wojtek Figat
2021-02-15 12:02:25 +01:00
parent cd2a02a5c8
commit b6557cb15c
3 changed files with 12 additions and 18 deletions

View File

@@ -233,18 +233,14 @@ namespace FlaxEditor.Windows.Assets
// Toolstrip
_toolstrip.AddSeparator();
_toolstrip.AddButton(editor.Icons.BracketsSlash32, () => ShowSourceCode(_asset)).LinkTooltip("Show generated shader source code");
_toolstrip.AddButton(editor.Icons.BracketsSlash32, ShowSourceCode).LinkTooltip("Show generated shader source code");
_toolstrip.AddButton(editor.Icons.Docs32, () => Platform.OpenUrl(Utilities.Constants.DocsUrl + "manual/graphics/materials/index.html")).LinkTooltip("See documentation to learn more");
}
/// <summary>
/// Shows the material source code window.
/// </summary>
/// <param name="material">The material asset.</param>
public static void ShowSourceCode(Material material)
private void ShowSourceCode()
{
var source = Editor.GetShaderSourceCode(material);
Utilities.Utils.ShowSourceCodeWindow(source, "Material Source");
var source = Editor.GetShaderSourceCode(_asset);
Utilities.Utils.ShowSourceCodeWindow(source, "Material Source", this);
}
/// <summary>

View File

@@ -139,18 +139,14 @@ namespace FlaxEditor.Windows.Assets
// Toolstrip
_toolstrip.AddSeparator();
_toolstrip.AddButton(editor.Icons.BracketsSlash32, () => ShowSourceCode(_asset)).LinkTooltip("Show generated shader source code");
_toolstrip.AddButton(editor.Icons.BracketsSlash32, ShowSourceCode).LinkTooltip("Show generated shader source code");
_toolstrip.AddButton(editor.Icons.Docs32, () => Platform.OpenUrl(Utilities.Constants.DocsUrl + "manual/particles/index.html")).LinkTooltip("See documentation to learn more");
}
/// <summary>
/// Shows the ParticleEmitter source code window.
/// </summary>
/// <param name="particleEmitter">The ParticleEmitter asset.</param>
public static void ShowSourceCode(ParticleEmitter particleEmitter)
private void ShowSourceCode()
{
var source = Editor.GetShaderSourceCode(particleEmitter);
Utilities.Utils.ShowSourceCodeWindow(source, "Particle Emitter GPU Simulation Source");
var source = Editor.GetShaderSourceCode(_asset);
Utilities.Utils.ShowSourceCodeWindow(source, "Particle Emitter GPU Simulation Source", this);
}
/// <inheritdoc />