Main workspace through EditorDock
Current MainScreen dock without the older main-screen scheme.
For a dedicated workspace, use EditorDock with DefaultSlot = EditorDock.DockSlot.MainScreen. Register it with the same AddDock() as a side panel; the older _HasMainScreen() and _MakeVisible() callbacks are unnecessary.
Complete example
Create asset://addons/docs_workspace/ and save WorkspacePlugin.cs plus plugin.cfg:
using Reckfell;
[Tool]
public partial class WorkspacePlugin : EditorPlugin
{
private EditorDock? _dock;
public override void _EnterTree()
{
_dock = new EditorDock { Name = "DocsWorkspaceDock", Title = "Docs workspace", DefaultSlot = EditorDock.DockSlot.MainScreen };
_dock.AddChild(new Label { Text = "A dedicated editor workspace" });
AddDock(_dock);
}
public override void _ExitTree()
{
if (_dock is not null) { RemoveDock(_dock); _dock.QueueFree(); _dock = null; }
}
}[plugin]
name="Docs workspace"
description="Main-screen EditorDock example"
author="Reckfell documentation"
version="1.0.0"
script="WorkspacePlugin.cs"Build the C# project and enable the addon in plugin settings. Open Docs workspace. In the check, EditorInterface.Singleton.GetDockByName("Docs workspace") located the panel; MakeVisible() put it into the visible main-screen state.
Lookup uses the display title, not folder docs_workspace or Name="DocsWorkspaceDock". Prefer retaining a reference to your owned panel. If titles are translated, do not use them as persistent project-data identifiers.
Cleanup and responsibilities
On disable, call RemoveDock() and QueueFree(). Reenabling creates one new panel. Do not create another instance in _Process() or whenever a workspace is selected.
MainScreen controls tool placement; it neither runs the game nor edits the current hierarchy. Implement selection, resource handling, or hierarchy changes separately and add UndoRedo where project data changes.
MainScreen registration, title lookup, MakeVisible, visibility state, and cleanup across reenablement were executed. Screenshots, physical tab switching, user layouts, multiple monitors, and game exports were not tested.