HammeriteEditorWorkspaces

Editor. Inherits Control

The level editor as one workspace among several, and a tab strip to change between them.

The seam a game hangs its own authoring on. The toolbar button and the right-hand panel (HammeriteMapEditor.add_toolbar_button(), HammeriteMapEditor.add_right_panel()) are room for a TOOL - something that acts on the map in front of you. A game also has authoring that is not about the map at all: its dialogue, its quests, its loot tables. That wants the whole window, and it wants to be here rather than in a separate application because it constantly asks the open map questions - who is placed in it, what the rooms are called. Hammerite knows nothing about what a game puts in one. It owns the strip, the switching, and the rule that the level is always workspace zero. The strip hides itself while the level is the only workspace, so a project that registers none looks exactly as it did before this existed.

Methods

ReturnsMethod
intregister_workspace(title: String, panel: Control)
voidunregister_workspace(id: int)
voidshow_workspace(id: int)
intcurrent_workspace()
Window[]windows_to_dress()

Signals

workspace_changed

signal workspace_changed(id: int)

Emitted when a different workspace is shown.

Constants

LEVEL

const LEVEL = 0

The level editor's own workspace. Always present, always first, and never unregistered.

Method descriptions

register_workspace()

func register_workspace(title: String, panel: Control) -> int

Offer panel as a workspace, on a tab titled title, and return the id to show or unregister it by: its own for as long as it is registered, whatever else comes and goes. -1 when panel is null; a panel already registered is an error, and keeps the id it has. The panel is moved out of any parent it had. The panel is NOT taken ownership of, the way a right-hand panel is not: unregistering detaches it and leaves it to its owner to keep or free. A panel whose popups are built before they are in the tree can offer them as windows_to_dress() -> ArrayWindow, and they follow the editor's UI scale as the editor's own do.

unregister_workspace()

func unregister_workspace(id: int) -> void

Take a workspace back out. The level's cannot be removed - there would be nothing to come back to. Shows LEVEL afterwards if it was showing. Other workspaces keep their ids.

show_workspace()

func show_workspace(id: int) -> void

Switch to workspace id. While the editor is down it is only remembered, and shown when the editor comes back up. An id nothing was registered under is an error.

current_workspace()

func current_workspace() -> int

The id of the workspace showing, or that will show when the editor comes back up.

windows_to_dress()

func windows_to_dress() -> Window[]

Windows a workspace built before it was ever in the tree, forwarded to whoever is scaling us. HammeriteEditorCanvas finds popups by walking the children of the one control it holds, and asks that control for the rest. What it holds is this now rather than the editor, so without this the editor's own browsers stopped being told the scale - a regression with no symptom until somebody opened one on a screen that was not at 1.0.

Hammerite 1.0 · built from a6dd634, 2026-10-10