@@ -12,7 +12,6 @@ use super::{
12
12
use crate :: {
13
13
IntoScriptPluginParams ,
14
14
bindings:: pretty_print:: DisplayWithWorld ,
15
- context:: ContextLoadingSettings ,
16
15
error:: { InteropError , ScriptError } ,
17
16
event:: CallbackLabel ,
18
17
extractors:: get_all_access_ids,
@@ -161,12 +160,6 @@ impl ScriptSystemBuilder {
161
160
let after_systems = self . after . clone ( ) ;
162
161
let system_name = self . name . to_string ( ) ;
163
162
164
- // let system: DynamicScriptSystem<P> =
165
- // IntoSystem::<(), (), (IsDynamicScriptSystem<P>, ())>::into_system(self);
166
-
167
- // dummy node id for now
168
- // let mut reflect_system = ReflectSystem::from_system(&system, NodeId::System(0));
169
-
170
163
// this is quite important, by default systems are placed in a set defined by their TYPE, i.e. in this case
171
164
// all script systems would be the same
172
165
@@ -208,7 +201,6 @@ impl ScriptSystemBuilder {
208
201
209
202
struct DynamicHandlerContext < ' w , P : IntoScriptPluginParams > {
210
203
script_context : & ' w ScriptContext < P > ,
211
- context_loading_settings : & ' w ContextLoadingSettings < P > ,
212
204
runtime_container : & ' w RuntimeContainer < P > ,
213
205
}
214
206
@@ -220,17 +212,17 @@ impl<'w, P: IntoScriptPluginParams> DynamicHandlerContext<'w, P> {
220
212
) ]
221
213
pub fn init_param ( world : & mut World , system : & mut FilteredAccessSet < ComponentId > ) {
222
214
let mut access = FilteredAccess :: < ComponentId > :: matches_nothing ( ) ;
223
- // let scripts_res_id = world
224
- // .query::<&Script<P>>();
225
- let context_loading_settings_res_id = world
226
- . resource_id :: < ContextLoadingSettings < P > > ( )
227
- . expect ( "ContextLoadingSettings resource not found" ) ;
215
+
228
216
let runtime_container_res_id = world
229
217
. resource_id :: < RuntimeContainer < P > > ( )
230
218
. expect ( "RuntimeContainer resource not found" ) ;
231
219
232
- access. add_resource_read ( context_loading_settings_res_id) ;
220
+ let script_context_res_id = world
221
+ . resource_id :: < ScriptContext < P > > ( )
222
+ . expect ( "Scripts resource not found" ) ;
223
+
233
224
access. add_resource_read ( runtime_container_res_id) ;
225
+ access. add_resource_read ( script_context_res_id) ;
234
226
235
227
system. add ( access) ;
236
228
}
@@ -243,9 +235,6 @@ impl<'w, P: IntoScriptPluginParams> DynamicHandlerContext<'w, P> {
243
235
unsafe {
244
236
Self {
245
237
script_context : system. get_resource ( ) . expect ( "Scripts resource not found" ) ,
246
- context_loading_settings : system
247
- . get_resource ( )
248
- . expect ( "ContextLoadingSettings resource not found" ) ,
249
238
runtime_container : system
250
239
. get_resource ( )
251
240
. expect ( "RuntimeContainer resource not found" ) ,
@@ -268,22 +257,11 @@ impl<'w, P: IntoScriptPluginParams> DynamicHandlerContext<'w, P> {
268
257
} ;
269
258
270
259
// call the script
271
- let pre_handling_initializers = & self
272
- . context_loading_settings
273
- . context_pre_handling_initializers ;
274
260
let runtime = & self . runtime_container . runtime ;
275
261
276
262
let mut context = context. lock ( ) ;
277
263
278
- P :: handle (
279
- payload,
280
- context_key,
281
- label,
282
- & mut context,
283
- pre_handling_initializers,
284
- runtime,
285
- guard,
286
- )
264
+ P :: handle ( payload, context_key, label, & mut context, runtime, guard)
287
265
}
288
266
}
289
267
@@ -684,7 +662,10 @@ mod test {
684
662
} ;
685
663
use test_utils:: make_test_plugin;
686
664
687
- use crate :: BMSScriptingInfrastructurePlugin ;
665
+ use crate :: {
666
+ BMSScriptingInfrastructurePlugin ,
667
+ config:: { GetPluginThreadConfig , ScriptingPluginConfiguration } ,
668
+ } ;
688
669
689
670
use super :: * ;
690
671
0 commit comments