Compare commits

...

4 Commits

Author SHA1 Message Date
baea9e297c sad api 2024-09-18 18:48:39 -07:00
aa361bce77 turn run_scripts into member function 2024-09-18 15:31:09 -07:00
555b9773e6 not fallible, print errors 2024-09-17 18:28:40 -07:00
bdda966497 wip 2024-09-17 18:27:56 -07:00

View File

@ -17,6 +17,20 @@ pub mod data{
} }
pub struct Dom(rbx_dom_weak::WeakDom); pub struct Dom(rbx_dom_weak::WeakDom);
impl Dom{
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(){
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())
}
}
#[derive(Debug)] #[derive(Debug)]
pub enum ReadError{ pub enum ReadError{