- Added editor option to toggle description panel for visual scripting
This commit is contained in:
@@ -368,6 +368,13 @@ namespace FlaxEditor.Options
|
|||||||
[EditorDisplay("Visject"), EditorOrder(550)]
|
[EditorDisplay("Visject"), EditorOrder(550)]
|
||||||
public float ConnectionCurvature { get; set; } = 1.0f;
|
public float ConnectionCurvature { get; set; } = 1.0f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the visject connection curvature.
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(true)]
|
||||||
|
[EditorDisplay("Visject"), EditorOrder(550)]
|
||||||
|
public bool VisualScriptingDescriptionPanel { get; set; } = true;
|
||||||
|
|
||||||
private static FontAsset DefaultFont => FlaxEngine.Content.LoadAsyncInternal<FontAsset>(EditorAssets.PrimaryFont);
|
private static FontAsset DefaultFont => FlaxEngine.Content.LoadAsyncInternal<FontAsset>(EditorAssets.PrimaryFont);
|
||||||
private static FontAsset ConsoleFont => FlaxEngine.Content.LoadAsyncInternal<FontAsset>(EditorAssets.InconsolataRegularFont);
|
private static FontAsset ConsoleFont => FlaxEngine.Content.LoadAsyncInternal<FontAsset>(EditorAssets.InconsolataRegularFont);
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ namespace FlaxEditor.Surface.ContextMenu
|
|||||||
|
|
||||||
// Description panel elements
|
// Description panel elements
|
||||||
private readonly bool _useDescriptionPanel;
|
private readonly bool _useDescriptionPanel;
|
||||||
|
private bool _descriptionPanelVisible;
|
||||||
private readonly Panel _descriptionPanel;
|
private readonly Panel _descriptionPanel;
|
||||||
private readonly Image _descriptionClassImage;
|
private readonly Image _descriptionClassImage;
|
||||||
private readonly Label _descriptionSignatureLabel;
|
private readonly Label _descriptionSignatureLabel;
|
||||||
@@ -801,7 +802,7 @@ namespace FlaxEditor.Surface.ContextMenu
|
|||||||
if(!_useDescriptionPanel)
|
if(!_useDescriptionPanel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (archetype == null)
|
if (archetype == null || !Editor.Instance.Options.Options.Interface.VisualScriptingDescriptionPanel)
|
||||||
{
|
{
|
||||||
HideDescriptionPanel();
|
HideDescriptionPanel();
|
||||||
return;
|
return;
|
||||||
@@ -903,6 +904,7 @@ namespace FlaxEditor.Surface.ContextMenu
|
|||||||
_descriptionPanel.Height = Mathf.Max(120f, panelHeight);
|
_descriptionPanel.Height = Mathf.Max(120f, panelHeight);
|
||||||
Height = 400 + _descriptionPanel.Height;
|
Height = 400 + _descriptionPanel.Height;
|
||||||
UpdateWindowSize();
|
UpdateWindowSize();
|
||||||
|
_descriptionPanelVisible = true;
|
||||||
|
|
||||||
Profiler.EndEvent();
|
Profiler.EndEvent();
|
||||||
}
|
}
|
||||||
@@ -945,10 +947,14 @@ namespace FlaxEditor.Surface.ContextMenu
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void HideDescriptionPanel()
|
private void HideDescriptionPanel()
|
||||||
{
|
{
|
||||||
|
if(!_descriptionPanelVisible)
|
||||||
|
return;
|
||||||
|
|
||||||
_descriptionInputPanel.RemoveChildren();
|
_descriptionInputPanel.RemoveChildren();
|
||||||
_descriptionOutputPanel.RemoveChildren();
|
_descriptionOutputPanel.RemoveChildren();
|
||||||
Height = 400;
|
Height = 400;
|
||||||
UpdateWindowSize();
|
UpdateWindowSize();
|
||||||
|
_descriptionPanelVisible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
Reference in New Issue
Block a user