diff --git a/lib/roblox_emulator/src/runner/instance/instance.rs b/lib/roblox_emulator/src/runner/instance/instance.rs index a735a00..410de24 100644 --- a/lib/roblox_emulator/src/runner/instance/instance.rs +++ b/lib/roblox_emulator/src/runner/instance/instance.rs @@ -471,7 +471,13 @@ static CLASS_FUNCTION_DATABASE:CFD=phf::phf_map!{ "Play"=>NO_OP, }, "TweenService"=>phf::phf_map!{ - "Create"=>NO_OP, + "Create"=>cf!(|_lua,_,(instance,tween_info,goal):(Instance,crate::runner::tween_info::TweenInfo,mlua::Table)|->mlua::Result<_>{ + Ok(crate::runner::tween::Tween::create( + instance, + tween_info, + goal, + )) + }), }, }; diff --git a/lib/roblox_emulator/src/runner/mod.rs b/lib/roblox_emulator/src/runner/mod.rs index 9c620a3..171f50c 100644 --- a/lib/roblox_emulator/src/runner/mod.rs +++ b/lib/roblox_emulator/src/runner/mod.rs @@ -5,6 +5,7 @@ mod runner; mod r#enum; mod task; mod udim; +mod tween; mod udim2; mod color3; mod cframe; diff --git a/lib/roblox_emulator/src/runner/tween.rs b/lib/roblox_emulator/src/runner/tween.rs new file mode 100644 index 0000000..89c16d4 --- /dev/null +++ b/lib/roblox_emulator/src/runner/tween.rs @@ -0,0 +1,34 @@ +use super::instance::Instance; +use super::tween_info::TweenInfo; + +#[derive(Clone)] +pub struct Tween{ + instance:Instance, + tween_info:TweenInfo, + goal:mlua::Table, + playback_state:rbx_types::Enum, +} +impl Tween{ + pub fn create( + instance:Instance, + tween_info:TweenInfo, + goal:mlua::Table, + )->Self{ + Self{ + instance, + tween_info, + goal, + // Enum.PlaybackState.Begin + playback_state:rbx_types::Enum::from_u32(0), + } + } + pub fn play(&mut self){ + } +} + +impl mlua::UserData for Tween{ + fn add_methods<M:mlua::UserDataMethods<Self>>(methods:&mut M){ + methods.add_method_mut("Play",|_,this,()|Ok(this.play())) + } +} +type_from_lua_userdata_clone!(Tween);