sad api
This commit is contained in:
parent
aa361bce77
commit
baea9e297c
10
src/lib.rs
10
src/lib.rs
@ -18,13 +18,17 @@ pub mod data{
|
||||
|
||||
pub struct Dom(rbx_dom_weak::WeakDom);
|
||||
impl Dom{
|
||||
pub fn run_scripts(&mut self){
|
||||
let mut context=roblox_emulator::context::Context::new(&mut self.0);
|
||||
pub fn run_scripts(self)->Self{
|
||||
let runner=roblox_emulator::runner::Runner::new().unwrap();
|
||||
let mut context=roblox_emulator::context::Context::new(self.0);
|
||||
for script in context.scripts(){
|
||||
if let Err(e)=script.run(&mut context){
|
||||
let (modified_context,script_error)=runner.run_script(script,context);
|
||||
context=modified_context;
|
||||
if let Err(e)=script_error{
|
||||
e.print();
|
||||
}
|
||||
}
|
||||
Self(context.into_inner())
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user