roblox_emulator: Tween Create & Play stub
This commit is contained in:
parent
b507624d91
commit
08f9163605
lib/roblox_emulator/src/runner
@ -471,7 +471,13 @@ static CLASS_FUNCTION_DATABASE:CFD=phf::phf_map!{
|
|||||||
"Play"=>NO_OP,
|
"Play"=>NO_OP,
|
||||||
},
|
},
|
||||||
"TweenService"=>phf::phf_map!{
|
"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,
|
||||||
|
))
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ mod runner;
|
|||||||
mod r#enum;
|
mod r#enum;
|
||||||
mod task;
|
mod task;
|
||||||
mod udim;
|
mod udim;
|
||||||
|
mod tween;
|
||||||
mod udim2;
|
mod udim2;
|
||||||
mod color3;
|
mod color3;
|
||||||
mod cframe;
|
mod cframe;
|
||||||
|
34
lib/roblox_emulator/src/runner/tween.rs
Normal file
34
lib/roblox_emulator/src/runner/tween.rs
Normal file
@ -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);
|
Loading…
x
Reference in New Issue
Block a user