v0.3.6 update roblox emulator api

This commit is contained in:
Quaternions 2024-09-21 12:40:51 -07:00
parent f0d0c925dc
commit 652bf5a0d3
3 changed files with 8 additions and 11 deletions

6
Cargo.lock generated
View File

@ -527,9 +527,9 @@ dependencies = [
[[package]] [[package]]
name = "roblox_emulator" name = "roblox_emulator"
version = "0.1.0" version = "0.2.0"
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
checksum = "9071bd2716bfd691b4ec872dfb8141188294bb050a6fba0ae3bb0c956c109a3d" checksum = "62ab7e851fb72ba7d690734e1d33d8bd47e83a25b7dbdb28b4771fd3425f7538"
dependencies = [ dependencies = [
"glam", "glam",
"mlua", "mlua",
@ -585,7 +585,7 @@ dependencies = [
[[package]] [[package]]
name = "strafesnet_rbx_loader" name = "strafesnet_rbx_loader"
version = "0.3.5" version = "0.3.6"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"glam", "glam",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "strafesnet_rbx_loader" name = "strafesnet_rbx_loader"
version = "0.3.5" version = "0.3.6"
edition = "2021" edition = "2021"
repository = "https://git.itzana.me/StrafesNET/rbx_loader" repository = "https://git.itzana.me/StrafesNET/rbx_loader"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
@ -18,5 +18,5 @@ rbx_dom_weak = { version = "2.7.0", registry = "strafesnet" }
rbx_mesh = "0.1.2" rbx_mesh = "0.1.2"
rbx_reflection_database = { version = "0.2.10", registry = "strafesnet" } rbx_reflection_database = { version = "0.2.10", registry = "strafesnet" }
rbx_xml = { version = "0.13.3", registry = "strafesnet" } rbx_xml = { version = "0.13.3", registry = "strafesnet" }
roblox_emulator = { version = "0.1.0", registry = "strafesnet" } roblox_emulator = { version = "0.2.0", registry = "strafesnet" }
strafesnet_common = { version = "0.4.0", registry = "strafesnet" } strafesnet_common = { version = "0.4.0", registry = "strafesnet" }

View File

@ -18,17 +18,14 @@ pub mod data{
pub struct Dom(rbx_dom_weak::WeakDom); pub struct Dom(rbx_dom_weak::WeakDom);
impl Dom{ impl Dom{
pub fn run_scripts(self)->Self{ pub fn run_scripts(&mut self){
let runner=roblox_emulator::runner::Runner::new().unwrap(); let runner=roblox_emulator::runner::Runner::new().unwrap();
let mut context=roblox_emulator::context::Context::new(self.0); let context=roblox_emulator::context::Context::from_mut(&mut self.0);
for script in context.scripts(){ for script in context.scripts(){
let (modified_context,script_error)=runner.run_script(script,context); if let Err(e)=runner.run_script(script,context){
context=modified_context;
if let Err(e)=script_error{
e.print(); e.print();
} }
} }
Self(context.into_inner())
} }
} }