File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,11 +23,15 @@ impl Editor {
2323 let _ = ENVIRONMENT . set ( * Editor :: environment ( ) ) ;
2424 graphene_std:: uuid:: set_uuid_seed ( 0 ) ;
2525
26- let ( runtime, executor) = crate :: node_graph_executor:: NodeGraphExecutor :: new_with_local_runtime ( ) ;
26+ let ( mut runtime, executor) = crate :: node_graph_executor:: NodeGraphExecutor :: new_with_local_runtime ( ) ;
2727 let editor = Self {
2828 dispatcher : Dispatcher :: with_executor ( executor) ,
2929 } ;
3030
31+ let mut application_io = PlatformApplicationIo :: default ( ) ;
32+ application_io. inject_resources ( editor. dispatcher . message_handlers . resource_message_handler . resources ( ) ) ;
33+ runtime. replace_application_io ( application_io) ;
34+
3135 ( editor, runtime)
3236 }
3337
Original file line number Diff line number Diff line change @@ -569,11 +569,17 @@ pub async fn replace_node_runtime(runtime: NodeRuntime) -> Option<NodeRuntime> {
569569pub ( crate ) async fn replace_application_io ( application_io : PlatformApplicationIo ) {
570570 let mut node_runtime = NODE_RUNTIME . lock ( ) ;
571571 if let Some ( node_runtime) = & mut * node_runtime {
572- node_runtime. editor_api = PlatformEditorApi {
573- font_cache : node_runtime. editor_api . font_cache . clone ( ) ,
572+ node_runtime. replace_application_io ( application_io) ;
573+ }
574+ }
575+
576+ impl NodeRuntime {
577+ pub ( crate ) fn replace_application_io ( & mut self , application_io : PlatformApplicationIo ) {
578+ self . editor_api = PlatformEditorApi {
579+ font_cache : self . editor_api . font_cache . clone ( ) ,
574580 application_io : Some ( application_io. into ( ) ) ,
575- node_graph_message_sender : Box :: new ( node_runtime . sender . clone ( ) ) ,
576- editor_preferences : Box :: new ( node_runtime . editor_preferences . clone ( ) ) ,
581+ node_graph_message_sender : Box :: new ( self . sender . clone ( ) ) ,
582+ editor_preferences : Box :: new ( self . editor_preferences . clone ( ) ) ,
577583 }
578584 . into ( ) ;
579585 }
You can’t perform that action at this time.
0 commit comments