Skip to content

Editor → Applications

play_controller.h

Play mode in the editing world. EDITING keeps the engine PAUSED and the script runtime in EDIT mode; play.start captures a scene snapshot, freezes the undo stack and runs the engine; play.stop ends a script's anti-aliasing override, restores the snapshot (guids preserved), remaps the selection and thaws the undo stack. A scene edit made while playing is not recorded and goes with the restore; a file edit (an ON_DISK command) stays on disk, so the controller keeps its inverse and play.stop pushes all of them as one undo entry. play.step runs exactly n fixed steps through application::step_fixed and answers once they ran. The clocks play.* report belong to the play session: play.start records the engine's fixedTime and fixedStepIndex, the session's time and fixed steps count from there (they stop while paused), and the ended session's values stay until the next play.start.

Structs

File Description
play_controller::pending_step

Classes

File Description
edit_origin_scope The origin of the commands the UI sends while the scope lives (the Inspector's edits, a gizmo drag's), so the play edit log tells them apart; the origin before it is put back when it ends. Main thread, around the drawing that sends the commands. Cannot be copied or moved: it restores the controller it was given.
play_controller

Enumerations

play_state

enum class play_state : u8 {
    EDITING = 0,
    PLAYING,
    PAUSED
};

play_stop_mode

enum class play_stop_mode : u8 {
    DISCARD_PINS = 0,       // the scene is thrown away next (shutdown, the restart of project.open)
    APPLY_PINS              // the scene is kept (play.stop, editor.quit {saveChanges}, a module detach)
};

What play_controller::stop() does with the pins of the play session.

Forward Declarations

editor_context

class editor_context;

Functions

Public

to_string

[[nodiscard]] CONJURE_API std::string_view to_string(
    play_state state) noexcept;

The wire name of a state ("editing").