pub struct UiRequests {
pub new_project: Option<PathBuf>,
pub open_project: Option<PathBuf>,
pub attach_renderable: Option<(Entity, RenderableKind, PathBuf)>,
pub toggle_play: bool,
pub export_project: Option<PathBuf>,
pub switch_scene: Option<PathBuf>,
pub close_scene_tab: Option<PathBuf>,
pub rename_scene: Option<(PathBuf, String)>,
pub rename_script: Option<(PathBuf, String)>,
pub set_start_scene: Option<PathBuf>,
pub edited: bool,
pub save_scene: bool,
}Expand description
Requests raised by the UI that need something draw doesn’t have access to (a live
&mut Renderer for loading assets, or EditorScene’s ability to replace its whole World
when a project is opened) — consumed by EditorScene::update right after draw runs, while
the renderer is still in scope for that frame.
Fields§
§new_project: Option<PathBuf>§open_project: Option<PathBuf>§attach_renderable: Option<(Entity, RenderableKind, PathBuf)>§toggle_play: boolPlay/Stop was clicked — starting/stopping the [libdqg::scripting::ScriptRuntime] needs
EditorScene’s help (it owns the runtime and the pre-Play transform snapshot), unlike a
script attachment/removal/reorder, which ui.rs can just apply to world.scripts
directly since it needs no GPU load step.
export_project: Option<PathBuf>“Export…” was clicked and a destination folder chosen — building the standalone game
needs EditorScene’s open Project, which ui.rs doesn’t own.
switch_scene: Option<PathBuf>A scene tile in the Assets panel’s Scenes section was double-clicked, or a tab in the
scene tab strip was clicked — EditorScene’s own switch_or_open_scene method needs to
run (it owns every open tab’s World/project), same reason toggle_play/
export_project are requests instead of handled here directly.
close_scene_tab: Option<PathBuf>A tab’s close button was clicked — EditorScene’s own close_scene_tab needs to run (it
owns the tab list and has to autosave before dropping one).
rename_scene: Option<(PathBuf, String)>A scene tile’s inline rename was committed ((old_path, new_stem)) — needs EditorScene’s
help since renaming may also need to update ProjectManifest.start_scene and any open
tab’s identity, neither of which ui.rs owns.
rename_script: Option<(PathBuf, String)>A script tile’s inline rename was committed ((old_path, new_stem)) — deferred to
EditorScene::rename_script, which fixes up every open tab’s World and every scene file
on disk that references the old path, not just whichever World happens to be active —
ui.rs only ever sees one World at a time.
set_start_scene: Option<PathBuf>A scene tile’s “Set as Start Scene” context-menu item was clicked — needs &mut Project to
persist ProjectManifest.start_scene, which ui.rs only ever sees as &Project.
edited: boolSomething in the active tab’s World/entity-asset map was mutated this frame — set by
every editing widget below (transform drag, hierarchy add/rename/duplicate/delete, camera/
renderable/script editing) so EditorScene::update can mark that tab dirty. Not raised for
attach_renderable, which is itself a request EditorScene marks dirty when it applies it.
save_scene: bool“Save” was clicked — deferred to EditorScene (rather than saved directly here, unlike
before tabs existed) because ui.rs doesn’t own the dirty flag it needs to clear on
success.
Trait Implementations§
Source§impl Default for UiRequests
impl Default for UiRequests
Source§fn default() -> UiRequests
fn default() -> UiRequests
Auto Trait Implementations§
impl Freeze for UiRequests
impl RefUnwindSafe for UiRequests
impl Send for UiRequests
impl Sync for UiRequests
impl Unpin for UiRequests
impl UnsafeUnpin for UiRequests
impl UnwindSafe for UiRequests
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().