reckfellENGINE

ScriptEditor

The panel for open internal documents and built-in help.

On this page
class ScriptEditorReckfellSharpEditorInherits EditorDock

Obtain the instance through EditorInterface.Singleton.GetScriptEditor(). Open documents, an active Script resource and a help tab are different concepts: help is not Script/ScriptEditorBase. GetCurrentScript() and GetCurrentEditor() can return null.

GetOpenScripts() and GetUnsavedFiles() concern internal documents, not the entire project or external IDE buffers. C# project context, compilation and debugging are configured separately.

Using the Script panel.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Methods16

ClearDocsFromScriptvoid
# ClearDocsFromScript
C#
public void ClearDocsFromScript(Script script);

Removes the documentation for the given script. Note: This should be called whenever the script is changed to keep the open documentation state up to date.

Parameters
NameTypeDefault
scriptScript—
CloseFileError
# CloseFile
C#
public Error CloseFile(string path);

Closes the file at the given path, discarding any unsaved changes. Returns OK on success or ERR_FILE_NOT_FOUND if the file is not found.

Parameters
NameTypeDefault
pathstring—
Returns Error
GetBreakpointsstring[]
# GetBreakpoints
C#
public string[] GetBreakpoints();

Returns array of breakpoints.

Returns string[]
GetCurrentEditorScriptEditorBase
# GetCurrentEditor
C#
public ScriptEditorBase GetCurrentEditor();

Return the current ScriptEditorBase when the active document has that type. A help tab does not, so null is valid. This does not retrieve an external editor process.

Returns ScriptEditorBase

The current ScriptEditorBase, or null.

GetCurrentScriptScript
# GetCurrentScript
C#
public Script GetCurrentScript();

Return the active internal editor Script. Help tabs or the absence of a suitable document return null. This does not determine the active file in an external C# IDE.

Returns Script

The Script resource, or null.

GetOpenScriptEditorsReckfell.Collections.Array<ScriptEditorBase>
# GetOpenScriptEditors
C#
public Reckfell.Collections.Array<ScriptEditorBase> GetOpenScriptEditors();

Returns an array with all ScriptEditorBase objects which are currently open in editor.

Returns Reckfell.Collections.Array<ScriptEditorBase>
GetOpenScriptsReckfell.Collections.Array<Script>
# GetOpenScripts
C#
public Reckfell.Collections.Array<Script> GetOpenScripts();

List Script resources open in internal documents. Help and arbitrary text files do not become scripts; this is not an index of all project files or external IDE documents.

Returns Reckfell.Collections.Array<Script>

An array of open Script resources.

GetUnsavedFilesstring[]
# GetUnsavedFiles
C#
public string[] GetUnsavedFiles();

List internal document paths with unsaved buffers. This excludes unsaved external IDE text and does not establish that an entire scene or project is saved.

Returns string[]

Paths of documents the internal editor considers unsaved.

GotoHelpvoid
# GotoHelp
C#
public void GotoHelp(string topic);

Open built-in help using a descriptor such as class_name:Entity. This neither opens a Script nor chooses an external C# IDE; GetCurrentScript() can return null afterward.

Parameters
NameTypeDefault
topicstring—
topic

The help topic descriptor; class_name:Entity is the verified example.

GotoLinevoid
# GotoLine
C#
public void GotoLine(int lineNumber);

Goes to the specified line in the current script.

Parameters
NameTypeDefault
lineNumberint—
OpenScriptCreateDialogvoid
# OpenScriptCreateDialog
C#
public void OpenScriptCreateDialog(string baseName, string basePath);

Opens the script create dialog. The script will extend base_name. The file extension can be omitted from base_path. It will be added based on the selected scripting language.

Parameters
NameTypeDefault
baseNamestring—
basePathstring—
RegisterSyntaxHighlightervoid
# RegisterSyntaxHighlighter
C#
public void RegisterSyntaxHighlighter(EditorSyntaxHighlighter syntaxHighlighter);

Registers the EditorSyntaxHighlighter to the editor, the EditorSyntaxHighlighter will be available on all open scripts. Note: Does not apply to scripts that are already opened.

Parameters
NameTypeDefault
syntaxHighlighterEditorSyntaxHighlighter—
ReloadOpenFilesvoid
# ReloadOpenFiles
C#
public void ReloadOpenFiles();

Reloads all currently opened files. This should be used when opened files are changed outside of the script editor. The user may be prompted to resolve file conflicts, see EditorSettings.text_editor/behavior/files/auto_reload_scripts_on_external_change.

SaveAllScriptsvoid
# SaveAllScripts
C#
public void SaveAllScripts();

Saves all open scripts.

UnregisterSyntaxHighlightervoid
# UnregisterSyntaxHighlighter
C#
public void UnregisterSyntaxHighlighter(EditorSyntaxHighlighter syntaxHighlighter);

Unregisters the EditorSyntaxHighlighter from the editor. Note: The EditorSyntaxHighlighter will still be applied to scripts that are already opened.

Parameters
NameTypeDefault
syntaxHighlighterEditorSyntaxHighlighter—
UpdateDocsFromScriptvoid
# UpdateDocsFromScript
C#
public void UpdateDocsFromScript(Script script);

Updates the documentation for the given script. Note: This should be called whenever the script is changed to keep the open documentation state up to date.

Parameters
NameTypeDefault
scriptScript—

Signals and events2

EditorScriptChangedEvent
# EditorScriptChanged
C#
public event ScriptEditor.EditorScriptChangedEventHandler EditorScriptChanged;

Emitted when user changed active script. Argument is a freshly activated Script.

Handler parameters
NameTypeDefault
scriptScript—
ScriptCloseEvent
# ScriptClose
C#
public event ScriptEditor.ScriptCloseEventHandler ScriptClose;

Emitted when editor is about to close the active script. Argument is a Script that is going to be closed.

Handler parameters
NameTypeDefault
scriptScript—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.