PrefabEditorWindow class

Editor for prefab files: a tab per open prefab, its values on the left and a preview of it on the right. An entity prefab's values are a property grid (PrefabFields); a Construct prefab's are its named defaults.

Base classes

class EditorPanel
class EditorDocuments

Constructors, destructors, conversion operators

PrefabEditorWindow()
~PrefabEditorWindow() override

Public functions

void Update(EditorState& state) override
Once a frame on Encoder, shown or not.
void Build(GGUI::UI& ui) override
The panel's content.
void OpenPrefab(const std::string& filePath, EditorState& state)
Open (or focus) a prefab file. Render-thread safe.
void DestroyAllPreviews(EditorState& state)
Release all preview worlds before editor shutdown.
auto Kind() const -> const char* override
What its documents are called in the autosave list ("prefab", "widget"). Never changes.
void ForEachUnsaved(const std::function<void(uint32_t id, const std::string&name, const std::string&path)>& visit) const override
Each open document with unsaved changes: its ID, name, and file.
auto Save(uint32_t id) -> bool override
Save open document id. False if it isn't open or couldn't be written.
auto TextOf(uint32_t id) const -> std::string override
Open document id as it stands, saved or not.
void OpenRecovered(const std::string& path, const std::string& text, EditorState& state) override
Open path with text in place of what the file has: recovered work, unsaved.