Editor → User Interface → start_screen.h
ui::start_screen
| Type | Class |
| Namespace | conjure::editor::ui |
| Include File Path | engine/include/conjure/editor/ui/start_screen.h |
| Source File Path | engine/src/editor/ui/start_screen.cpp |
| API ↗ | The editor, The workspace UI |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | start_screen(); |
Important
Additional constructor overloads have been deleted.
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~start_screen(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| public | CREATE_KEY | static constexpr std:: | "create_project" | |
| private | mEntries | std:: | {} | |
| private | mListed | bool | false | |
| private | mListedFrom | std:: | {} | |
| private | mNewFolder | std::string | "" | |
| private | mNewName | std::string | "" | |
| private | mNewProblem | std::string | "" | |
| private | mOpenPath | std::string | "" | |
| private | mOpenProblem | std::string | "" | |
| private | m | std::string | "" | |
| private | m | bool | false | |
| public | NEW_ | static constexpr std:: | "new_folder" | |
| public | NEW_NAME_KEY | static constexpr std:: | "new_name" | |
| public | OPEN_KEY | static constexpr std:: | "open_project" | |
| public | OPEN_ | static constexpr std:: | "open_path" | The kit keys of the screen's fields and buttons, as the frame record lists them (a field's key is its hidden label, "##open_path"). A recent project's Open and Remove are RECENT_OPEN_KEY and RECENT_REMOVE_KEY under the id scope of its index (kit::id_scope). |
| public | RECENT_ | static constexpr std:: | "open" | |
| public | RECENT_ | static constexpr std:: | "remove" | |
| public | WINDOW_NAME | static constexpr const char * | "Start###conjure_ | The ImGui window name of the screen. |
Functions
Public
create_project
create_project[[nodiscard]] core::result<void> create_project(
editor_context &context,
std::string_view parentFolder,
std::string_view name);What New does: checks the name and the folder to create the project in, sends project.create for <parentFolder>/<name>, then project.open. On failure the sentence is kept (new_problem()) and the error returned: INVALID_ARGUMENT, NOT_FOUND or ALREADY_EXISTS from the check, or the failing command's error.
draw
drawvoid draw(
editor_context &context);Draws the screen over the main viewport's work area (between the menu bar and the status bar). Does nothing outside an ImGui frame. The first draw in a frame takes the host's startup problem (why --project could not be opened) as the Open problem, so the screen says it until the next Open attempt; drawing needs a current kit context, without which nothing is drawn.
entries
entries[[nodiscard]] std::span<const start_screen_entry> entries() const noexcept;The recent projects as listed (refresh() or the last draw()).
new_problem
new_problem[[nodiscard]] const std::string &new_problem() const noexcept;open_problem
open_problem[[nodiscard]] const std::string &open_problem() const noexcept;The last problem of Open, New and the recent list ("" when the last attempt worked).
open_project
open_project[[nodiscard]] core::result<void> open_project(
editor_context &context,
std::string_view folder);What Open does: checks the typed folder (a project's folder, or its project.json; quotes around it are dropped) and sends project.open. On failure the sentence for the user is kept (open_problem()) and the error returned: INVALID_ARGUMENT or NOT_FOUND from the check, or the command's error.
open_recent
open_recent[[nodiscard]] core::result<void> open_recent(
editor_context &context,
usize index);Opens the recent project at index of entries() as open_project() does. OUT_OF_RANGE for an index past the list; NOT_FOUND, and the problem kept (recent_problem()), for a project that is missing.
recent_problem
recent_problem[[nodiscard]] const std::string &recent_problem() const noexcept;refresh
refreshvoid refresh(
editor_context &context);Rebuilds the list from the context's recent projects and checks again which folders still hold a project. The list is also rebuilt by itself whenever the recent projects change; the disk is read only then, never every frame.
remove_recent
remove_recent[[nodiscard]] core::result<void> remove_recent(
editor_context &context,
const std::filesystem::path &root);Removes a project from the recent list: from the context's settings and, when the editor has a user configuration folder, from editor_settings.json (a read-modify-write, update_user_settings, so the lists of other editors are kept). NOT_FOUND when the root is not listed; the file's error when it cannot be written (the project then leaves this session's list only, and the problem is kept).
Private
draw_new
draw_newvoid draw_new(
editor_context &context,
bool busy);draw_open
draw_openvoid draw_open(
editor_context &context,
bool busy);draw_recent
draw_recentvoid draw_recent(
editor_context &context);sync_entries
sync_entriesvoid sync_entries(
editor_context &context);take_startup_problem
take_startup_problemvoid take_startup_problem(
editor_context &context);