Merge branch 'scroll-script-add' of https://github.com/Tryibion/FlaxEngine into Tryibion-scroll-script-add

This commit is contained in:
Wojtek Figat
2024-12-16 23:16:04 +01:00
2 changed files with 14 additions and 0 deletions

View File

@@ -424,6 +424,13 @@ namespace FlaxEditor.CustomEditors.Dedicated
{
presenter.Undo.AddAction(multiAction);
presenter.Control.Focus();
// Scroll to bottom of script control where a new script is added.
if (presenter.Panel.Parent is Panel p && Editor.Instance.Options.Options.Interface.ScrollToScriptOnAdd)
{
var loc = ScriptsEditor.Layout.Control.BottomLeft;
p.ScrollViewTo(loc);
}
}
}
}

View File

@@ -258,6 +258,13 @@ namespace FlaxEditor.Options
private TextAlignment _tooltipTextAlignment = TextAlignment.Center;
/// <summary>
/// Whether to scroll to the script when a script is added to an actor.
/// </summary>
[DefaultValue(true)]
[EditorDisplay("Interface"), EditorOrder(322)]
public bool ScrollToScriptOnAdd { get; set; } = true;
/// <summary>
/// Gets or sets the timestamps prefix mode for output log messages.
/// </summary>