v0.5.1 place includes services... duh

This commit is contained in:
Quaternions 2024-10-03 20:22:45 -07:00
parent 7a3184efd5
commit c149064c38
3 changed files with 9 additions and 7 deletions

4
Cargo.lock generated
View File

@ -571,9 +571,9 @@ dependencies = [
[[package]]
name = "roblox_emulator"
version = "0.3.0"
version = "0.3.1"
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
checksum = "ba81a9134bb07930669340c7aad34719e74690f68771c6ef7b093f00ddba9e65"
checksum = "b58d7bb42d458984e629a012757474710fd0e429c2c824a2529574be5e7c2fd6"
dependencies = [
"glam",
"mlua",

View File

@ -18,5 +18,5 @@ rbx_dom_weak = { version = "2.7.0", registry = "strafesnet" }
rbx_mesh = "0.1.2"
rbx_reflection_database = { version = "0.2.10", registry = "strafesnet" }
rbx_xml = { version = "0.13.3", registry = "strafesnet" }
roblox_emulator = { version = "0.3.0", registry = "strafesnet" }
roblox_emulator = { version = "0.3.1", registry = "strafesnet" }
strafesnet_common = { version = "0.5.1", registry = "strafesnet" }

View File

@ -24,9 +24,9 @@ impl Model{
fn new(dom:WeakDom)->Self{
Self{dom}
}
pub fn into_place(self)->(Place,roblox_emulator::place::Services){
pub fn into_place(self)->Place{
let (dom,services)=roblox_emulator::place::new_place_with_instances_in_workspace(self.dom);
(Place{dom},services)
Place{dom,services}
}
}
impl AsRef<WeakDom> for Model{
@ -37,11 +37,13 @@ impl AsRef<WeakDom> for Model{
pub struct Place{
dom:WeakDom,
services:roblox_emulator::place::Services,
}
impl Place{
pub fn run_scripts(&mut self,services:roblox_emulator::place::Services){
pub fn run_scripts(&mut self){
let Place{dom,services}=self;
let runner=roblox_emulator::runner::Runner::new().unwrap();
let context=roblox_emulator::context::Context::from_mut(&mut self.dom);
let context=roblox_emulator::context::Context::from_mut(dom);
let scripts=context.scripts();
let runnable=runner.runnable_context(context,services).unwrap();
for script in scripts{