Add Model SDF generation utilities

This commit is contained in:
Wojciech Figat
2022-03-24 11:32:02 +01:00
parent d5060e9067
commit b08d2001fd
24 changed files with 696 additions and 323 deletions

View File

@@ -16,26 +16,6 @@ namespace FlaxEditor.CustomEditors.Elements
/// </summary>
public readonly Button Button = new Button();
/// <summary>
/// Initializes the element.
/// </summary>
/// <param name="text">The text.</param>
public void Init(string text)
{
Button.Text = text;
}
/// <summary>
/// Initializes the element.
/// </summary>
/// <param name="text">The text.</param>
/// <param name="color">The color.</param>
public void Init(string text, Color color)
{
Button.Text = text;
Button.SetColors(color);
}
/// <inheritdoc />
public override Control Control => Button;
}

View File

@@ -133,11 +133,13 @@ namespace FlaxEditor.CustomEditors
/// Adds new button element.
/// </summary>
/// <param name="text">The text.</param>
/// <param name="tooltip">The tooltip text.</param>
/// <returns>The created element.</returns>
public ButtonElement Button(string text)
public ButtonElement Button(string text, string tooltip = null)
{
var element = new ButtonElement();
element.Init(text);
element.Button.Text = text;
element.Button.TooltipText = tooltip;
OnAddElement(element);
return element;
}
@@ -147,11 +149,14 @@ namespace FlaxEditor.CustomEditors
/// </summary>
/// <param name="text">The text.</param>
/// <param name="color">The color.</param>
/// <param name="tooltip">The tooltip text.</param>
/// <returns>The created element.</returns>
public ButtonElement Button(string text, Color color)
public ButtonElement Button(string text, Color color, string tooltip = null)
{
ButtonElement element = new ButtonElement();
element.Init(text, color);
element.Button.Text = text;
element.Button.TooltipText = tooltip;
element.Button.SetColors(color);
OnAddElement(element);
return element;
}