From 6e0715838f9200ea424f806bf9d29a5cdcb07a72 Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Fri, 23 Apr 2021 20:24:34 -0400 Subject: [PATCH 01/11] Add functionalities to Vector3 and Vector3int16 --- src/roblox_api/mod.rs | 37 ++++++-- src/value.rs | 137 ++++++++++++++++++++++++++++- test-scripts/type-vector3.lua | 18 ++++ test-scripts/type-vector3int16.lua | 19 ++++ 4 files changed, 203 insertions(+), 8 deletions(-) create mode 100644 test-scripts/type-vector3.lua diff --git a/src/roblox_api/mod.rs b/src/roblox_api/mod.rs index 9aea770..40a9395 100644 --- a/src/roblox_api/mod.rs +++ b/src/roblox_api/mod.rs @@ -7,7 +7,7 @@ use rlua::{Context, UserData, UserDataMethods}; use crate::{ remodel_context::RemodelContext, - value::{Color3Value, Vector3int16Value}, + value::{Color3Value, Vector3Value, Vector3int16Value}, }; pub use instance::LuaInstance; @@ -17,6 +17,7 @@ pub struct RobloxApi; impl RobloxApi { pub fn inject(context: Context<'_>) -> rlua::Result<()> { context.globals().set("Instance", Instance)?; + context.globals().set("Vector3", Vector3)?; context.globals().set("Vector3int16", Vector3int16)?; context.globals().set("Color3", Color3)?; @@ -51,15 +52,39 @@ impl UserData for Instance { } } +struct Vector3; + +impl UserData for Vector3 { + fn add_methods<'lua, T: UserDataMethods<'lua, Self>>(methods: &mut T) { + methods.add_function( + "new", + |_context, (x, y, z): (Option, Option, Option)| { + Ok(Vector3Value::new(rbx_dom_weak::types::Vector3::new( + x.unwrap_or(0.0), + y.unwrap_or(0.0), + z.unwrap_or(0.0), + ))) + }, + ); + } +} + struct Vector3int16; impl UserData for Vector3int16 { fn add_methods<'lua, T: UserDataMethods<'lua, Self>>(methods: &mut T) { - methods.add_function("new", |_context, (x, y, z): (i16, i16, i16)| { - Ok(Vector3int16Value::new( - rbx_dom_weak::types::Vector3int16::new(x, y, z), - )) - }) + methods.add_function( + "new", + |_context, (x, y, z): (Option, Option, Option)| { + Ok(Vector3int16Value::new( + rbx_dom_weak::types::Vector3int16::new( + x.unwrap_or(0), + y.unwrap_or(0), + z.unwrap_or(0), + ), + )) + }, + ) } } diff --git a/src/value.rs b/src/value.rs index 0ed48c4..7de043a 100644 --- a/src/value.rs +++ b/src/value.rs @@ -1,6 +1,8 @@ //! Defines how to turn Variant values into Lua values and back. -use rbx_dom_weak::types::{Color3, Color3uint8, Variant, VariantType, Vector3int16}; +use rbx_dom_weak::types::{ + Color3, Color3uint8, Variant, VariantType, Vector3, Vector3int16, +}; use rlua::{ Context, MetaMethod, Result as LuaResult, ToLua, UserData, UserDataMethods, Value as LuaValue, }; @@ -84,6 +86,10 @@ pub fn lua_to_rbxvalue(ty: VariantType, value: LuaValue<'_>) -> LuaResult { + let vector3 = &*user_data.borrow::()?; + Ok(vector3.into()) + } (VariantType::Vector3int16, LuaValue::UserData(ref user_data)) => { let vector3int16 = &*user_data.borrow::()?; Ok(vector3int16.into()) @@ -215,6 +221,86 @@ impl UserData for Color3uint8Value { } } +#[derive(Debug, Clone, Copy)] +pub struct Vector3Value(Vector3); + +impl fmt::Display for Vector3Value { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}, {}, {}", self.0.x, self.0.y, self.0.z) + } +} + +impl Vector3Value { + pub fn new(value: Vector3) -> Self { + Self(value) + } + + fn meta_index<'lua>( + &self, + context: Context<'lua>, + key: &str, + ) -> rlua::Result> { + match key { + "X" => self.0.x.to_lua(context), + "Y" => self.0.y.to_lua(context), + "Z" => self.0.z.to_lua(context), + _ => Err(rlua::Error::external(format!( + "'{}' is not a valid member of Vector3", + key + ))), + } + } +} + +impl ops::Add for &Vector3Value { + type Output = Vector3Value; + fn add(self, other: Self) -> Self::Output { + Vector3Value::new(Vector3::new( + self.0.x + other.0.x, + self.0.y + other.0.y, + self.0.z + other.0.z, + )) + } +} + +impl ops::Sub for &Vector3Value { + type Output = Vector3Value; + fn sub(self, other: Self) -> Self::Output { + Vector3Value::new(Vector3::new( + self.0.x - other.0.x, + self.0.y - other.0.y, + self.0.z - other.0.z, + )) + } +} + +impl From<&Vector3Value> for Variant { + fn from(vector: &Vector3Value) -> Variant { + Variant::Vector3(vector.0) + } +} + +impl UserData for Vector3Value { + fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M) { + methods.add_meta_method(MetaMethod::Eq, |context, this, rhs: Self| { + (this.0 == rhs.0).to_lua(context) + }); + methods.add_meta_method(MetaMethod::Add, |context, this, rhs: Self| { + (this + &rhs).to_lua(context) + }); + methods.add_meta_method(MetaMethod::Sub, |context, this, rhs: Self| { + (this - &rhs).to_lua(context) + }); + + methods.add_meta_method(MetaMethod::Index, |context, this, key: String| { + this.meta_index(context, &key) + }); + methods.add_meta_method(MetaMethod::ToString, |context, this, _arg: ()| { + this.to_string().to_lua(context) + }); + } +} + #[derive(Debug, Clone, Copy)] pub struct Vector3int16Value(Vector3int16); @@ -228,6 +314,44 @@ impl Vector3int16Value { pub fn new(value: Vector3int16) -> Self { Self(value) } + + fn meta_index<'lua>( + &self, + context: Context<'lua>, + key: &str, + ) -> rlua::Result> { + match key { + "X" => self.0.x.to_lua(context), + "Y" => self.0.y.to_lua(context), + "Z" => self.0.z.to_lua(context), + _ => Err(rlua::Error::external(format!( + "'{}' is not a valid member of Vector3", + key + ))), + } + } +} + +impl ops::Add for &Vector3int16Value { + type Output = Vector3int16Value; + fn add(self, other: Self) -> Self::Output { + Vector3int16Value::new(Vector3int16::new( + self.0.x + other.0.x, + self.0.y + other.0.y, + self.0.z + other.0.z, + )) + } +} + +impl ops::Sub for &Vector3int16Value { + type Output = Vector3int16Value; + fn sub(self, other: Self) -> Self::Output { + Vector3int16Value::new(Vector3int16::new( + self.0.x - other.0.x, + self.0.y - other.0.y, + self.0.z - other.0.z, + )) + } } impl From<&Vector3int16Value> for Variant { @@ -238,10 +362,19 @@ impl From<&Vector3int16Value> for Variant { impl UserData for Vector3int16Value { fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M) { - methods.add_meta_method(MetaMethod::Eq, |context, this, rhs: Vector3int16Value| { + methods.add_meta_method(MetaMethod::Eq, |context, this, rhs: Self| { (this.0 == rhs.0).to_lua(context) }); + methods.add_meta_method(MetaMethod::Add, |context, this, rhs: Self| { + (this + &rhs).to_lua(context) + }); + methods.add_meta_method(MetaMethod::Sub, |context, this, rhs: Self| { + (this - &rhs).to_lua(context) + }); + methods.add_meta_method(MetaMethod::Index, |context, this, key: String| { + this.meta_index(context, &key) + }); methods.add_meta_method(MetaMethod::ToString, |context, this, _arg: ()| { this.to_string().to_lua(context) }); diff --git a/test-scripts/type-vector3.lua b/test-scripts/type-vector3.lua new file mode 100644 index 0000000..b8a3b74 --- /dev/null +++ b/test-scripts/type-vector3.lua @@ -0,0 +1,18 @@ +local function assertVector(vec, x, y, z) + assert(vec.X == x, ("%f ~= %f"):format(vec.X, x)) + assert(vec.Y == y, ("%f ~= %f"):format(vec.Y, y)) + assert(vec.Z == z, ("%f ~= %f"):format(vec.Z, z)) +end + +assertVector(Vector3.new(), 0, 0, 0) +assertVector(Vector3.new(1), 1, 0, 0) +assertVector(Vector3.new(1, 2), 1, 2, 0) +assertVector(Vector3.new(1, 2, 3), 1, 2, 3) + +assert(tostring(Vector3.new(1, 2, 3)) == "1, 2, 3") + +assertVector(Vector3.new(1, 2, 3) + Vector3.new(1, 2, 3), 2, 4, 6) +assertVector(Vector3.new(1, 2, 3) - Vector3.new(1, 2, 3), 0, 0, 0) + +assert(Vector3.new(1, 2, 3) == Vector3.new(1, 2, 3)) +assert(Vector3.new() ~= Vector3.new(1, 2, 3)) diff --git a/test-scripts/type-vector3int16.lua b/test-scripts/type-vector3int16.lua index dff6e9b..ff7bc0f 100644 --- a/test-scripts/type-vector3int16.lua +++ b/test-scripts/type-vector3int16.lua @@ -1,3 +1,22 @@ +local function assertVector(vec, x, y, z) + assert(vec.X == x, ("%f ~= %f"):format(vec.X, x)) + assert(vec.Y == y, ("%f ~= %f"):format(vec.Y, y)) + assert(vec.Z == z, ("%f ~= %f"):format(vec.Z, z)) +end + +assertVector(Vector3int16.new(), 0, 0, 0) +assertVector(Vector3int16.new(1), 1, 0, 0) +assertVector(Vector3int16.new(1, 2), 1, 2, 0) +assertVector(Vector3int16.new(1, 2, 3), 1, 2, 3) + +assertVector(Vector3int16.new(1, 2, 3) + Vector3int16.new(1, 2, 3), 2, 4, 6) +assertVector(Vector3int16.new(1, 2, 3) - Vector3int16.new(1, 2, 3), 0, 0, 0) + +assert(Vector3int16.new(1, 2, 3) == Vector3int16.new(1, 2, 3)) +assert(Vector3int16.new() ~= Vector3int16.new(1, 2, 3)) + +assert(tostring(Vector3int16.new(1, 2, 3)) == "1, 2, 3") + local terrainRegion = remodel.readModelFile("test-models/terrain-region.rbxmx")[1] assert(remodel.getRawProperty(terrainRegion, "ExtentsMax") == Vector3int16.new(32000, 32000, 32000)) From d6fe2819482d53efa9e57dac89dfd2d28962ff19 Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Fri, 23 Apr 2021 20:28:35 -0400 Subject: [PATCH 02/11] add entry to changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e458eb3..6b9aaa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## Unreleased Changes -* Add Color3.fromRGB(red, blue, green) ([#44](https://github.com/rojo-rbx/remodel/issues/44)) +* Added support for Vector3, and improved Vector3int16 ([#45](https://github.com/rojo-rbx/remodel/issues/45)) +* Added Color3.fromRGB(red, blue, green) ([#44](https://github.com/rojo-rbx/remodel/issues/44)) ## 0.8.1 (2021-04-09) * Updated to latest rbx_xml, which should fix `OptionalCoordinateFrame`-related issues. From 9520b138582cf6cc0e9ea8a87a19ddaaca9c4e2f Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Fri, 23 Apr 2021 20:29:35 -0400 Subject: [PATCH 03/11] fix changelog entries --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b9aaa6..d23f1b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ ## Unreleased Changes -* Added support for Vector3, and improved Vector3int16 ([#45](https://github.com/rojo-rbx/remodel/issues/45)) -* Added Color3.fromRGB(red, blue, green) ([#44](https://github.com/rojo-rbx/remodel/issues/44)) +* Added support for Vector3, and improved Vector3int16 ([#46](https://github.com/rojo-rbx/remodel/pull/46)) +* Added Color3.fromRGB(red, blue, green) ([#44](https://github.com/rojo-rbx/remodel/pull/44)) ## 0.8.1 (2021-04-09) * Updated to latest rbx_xml, which should fix `OptionalCoordinateFrame`-related issues. From 2847298dda0e6e36be6e11120e8906c973ed91ba Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Fri, 23 Apr 2021 23:36:55 -0400 Subject: [PATCH 04/11] add std::ops --- src/value.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/value.rs b/src/value.rs index 7de043a..66c390f 100644 --- a/src/value.rs +++ b/src/value.rs @@ -7,6 +7,7 @@ use rlua::{ Context, MetaMethod, Result as LuaResult, ToLua, UserData, UserDataMethods, Value as LuaValue, }; use std::fmt; +use std::ops; pub fn rbxvalue_to_lua<'lua>(context: Context<'lua>, value: &Variant) -> LuaResult> { fn unimplemented_type(name: &str) -> LuaResult> { From ee118a04437f1e742905c3c45be989d4e814d274 Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Fri, 23 Apr 2021 23:46:41 -0400 Subject: [PATCH 05/11] fix format --- src/value.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/value.rs b/src/value.rs index 66c390f..e714aa3 100644 --- a/src/value.rs +++ b/src/value.rs @@ -1,8 +1,6 @@ //! Defines how to turn Variant values into Lua values and back. -use rbx_dom_weak::types::{ - Color3, Color3uint8, Variant, VariantType, Vector3, Vector3int16, -}; +use rbx_dom_weak::types::{Color3, Color3uint8, Variant, VariantType, Vector3, Vector3int16}; use rlua::{ Context, MetaMethod, Result as LuaResult, ToLua, UserData, UserDataMethods, Value as LuaValue, }; From b05183ac54518d6dffca1cac0d0e8c561261d734 Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Thu, 6 May 2021 23:52:41 -0400 Subject: [PATCH 06/11] change add and sub trait to use owned type --- src/value.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/value.rs b/src/value.rs index e714aa3..d98f780 100644 --- a/src/value.rs +++ b/src/value.rs @@ -251,7 +251,7 @@ impl Vector3Value { } } -impl ops::Add for &Vector3Value { +impl ops::Add for Vector3Value { type Output = Vector3Value; fn add(self, other: Self) -> Self::Output { Vector3Value::new(Vector3::new( @@ -262,7 +262,7 @@ impl ops::Add for &Vector3Value { } } -impl ops::Sub for &Vector3Value { +impl ops::Sub for Vector3Value { type Output = Vector3Value; fn sub(self, other: Self) -> Self::Output { Vector3Value::new(Vector3::new( @@ -285,10 +285,10 @@ impl UserData for Vector3Value { (this.0 == rhs.0).to_lua(context) }); methods.add_meta_method(MetaMethod::Add, |context, this, rhs: Self| { - (this + &rhs).to_lua(context) + (*this + rhs).to_lua(context) }); methods.add_meta_method(MetaMethod::Sub, |context, this, rhs: Self| { - (this - &rhs).to_lua(context) + (*this - rhs).to_lua(context) }); methods.add_meta_method(MetaMethod::Index, |context, this, key: String| { @@ -331,7 +331,7 @@ impl Vector3int16Value { } } -impl ops::Add for &Vector3int16Value { +impl ops::Add for Vector3int16Value { type Output = Vector3int16Value; fn add(self, other: Self) -> Self::Output { Vector3int16Value::new(Vector3int16::new( @@ -342,7 +342,7 @@ impl ops::Add for &Vector3int16Value { } } -impl ops::Sub for &Vector3int16Value { +impl ops::Sub for Vector3int16Value { type Output = Vector3int16Value; fn sub(self, other: Self) -> Self::Output { Vector3int16Value::new(Vector3int16::new( @@ -365,10 +365,10 @@ impl UserData for Vector3int16Value { (this.0 == rhs.0).to_lua(context) }); methods.add_meta_method(MetaMethod::Add, |context, this, rhs: Self| { - (this + &rhs).to_lua(context) + (*this + rhs).to_lua(context) }); methods.add_meta_method(MetaMethod::Sub, |context, this, rhs: Self| { - (this - &rhs).to_lua(context) + (*this - rhs).to_lua(context) }); methods.add_meta_method(MetaMethod::Index, |context, this, key: String| { From 7179a6ee34020ed63b76efd7cc1594c0ab127ed0 Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Mon, 10 May 2021 20:52:50 -0400 Subject: [PATCH 07/11] add region3int16 --- src/value.rs | 2 +- test-scripts/type-region3int16.lua | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test-scripts/type-region3int16.lua diff --git a/src/value.rs b/src/value.rs index 9a1443c..928c1b4 100644 --- a/src/value.rs +++ b/src/value.rs @@ -588,7 +588,7 @@ impl Region3int16Value { "Min" => Vector3int16Value::new(self.0.min).to_lua(context), "Max" => Vector3int16Value::new(self.0.max).to_lua(context), _ => Err(rlua::Error::external(format!( - "'{}' is not a valid member of Region3", + "'{}' is not a valid member of Region3int16", key ))), } diff --git a/test-scripts/type-region3int16.lua b/test-scripts/type-region3int16.lua new file mode 100644 index 0000000..4a16c6a --- /dev/null +++ b/test-scripts/type-region3int16.lua @@ -0,0 +1,26 @@ +local function assertRegion3int16(region, min, max) + assert( + region.Min == min, + ("Min %s ~= %s"):format(region.Min, min) + ) + assert( + region.Max == max, + ("Max %s ~= %s"):format(region.Max, max) + ) +end + +assertRegion3int16( + Region3int16.new(Vector3int16.new(2, 3, 4), Vector3int16.new(8, 6, 5)), + Vector3int16.new(2, 3, 4), + Vector3int16.new(8, 6, 5) +) + +do + local region = Region3int16.new(Vector3int16.new(1, 2, 3), Vector3int16.new(7, 8, 9)) + local format = tostring(region) + assert(format == "1, 2, 3; 7, 8, 9", "got " .. format) +end + +local min = Vector3int16.new(2, 3, 4) +local max = Vector3int16.new(8, 6, 5) +assert(Region3int16.new(min, max) == Region3int16.new(min, max)) From ec2760c51d23d735c055a3e7307ea5f563b453d8 Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Mon, 10 May 2021 21:14:45 -0400 Subject: [PATCH 08/11] remove things I did not want to commit --- src/roblox_api/instance.rs | 82 -------------------------------------- 1 file changed, 82 deletions(-) diff --git a/src/roblox_api/instance.rs b/src/roblox_api/instance.rs index 2aebbbe..5843353 100644 --- a/src/roblox_api/instance.rs +++ b/src/roblox_api/instance.rs @@ -11,56 +11,6 @@ use rbx_dom_weak::{ use rbx_reflection::ClassTag; use rlua::{Context, FromLua, MetaMethod, ToLua, UserData, UserDataMethods}; -mod terrain { - use super::*; - - pub fn copy_region<'lua>( - _context: Context<'lua>, - terrain: Option, - ) -> rlua::Result { - let terrain = terrain - .map(|instance| { - instance - .get_raw_class_name() - .map(|class_name| (class_name, instance)) - }) - .transpose()? - .and_then(|(class_name, instance)| { - if class_name == "Terrain" { - Some(instance) - } else { - None - } - }) - .ok_or(rlua::Error::external( - "Expected ':' not '.' calling member function CopyRegion", - ))?; - - let mut tree = terrain.tree.lock().unwrap(); - - let terrain_instance = tree.get_by_ref(terrain.id).ok_or_else(|| { - rlua::Error::external("Cannot call CopyRegion() on a destroyed instance") - })?; - - let mut builder = InstanceBuilder::new("TerrainRegion") - .with_name("TerrainRegion") - .with_property("ExtentsMax", Vector3int16::new(32000, 32000, 32000)) - .with_property("ExtentsMin", Vector3int16::new(-32000, -32000, -32000)); - - if let Some(value) = terrain_instance.properties.get("SmoothGrid") { - builder = builder.with_property("SmoothGrid", value.clone()); - } - - let root_id = tree.root_ref(); - let new_id = tree.insert(root_id, builder); - - Ok(LuaInstance { - tree: Arc::clone(&terrain.tree), - id: new_id, - }) - } -} - #[derive(Clone)] pub struct LuaInstance { pub tree: Arc>, @@ -279,16 +229,6 @@ impl LuaInstance { instance.class.as_str().to_lua(context) } - fn get_raw_class_name(&self) -> rlua::Result { - let tree = self.tree.lock().unwrap(); - - let instance = tree.get_by_ref(self.id).ok_or_else(|| { - rlua::Error::external("Cannot access ClassName on a destroyed instance") - })?; - - Ok(instance.class.to_owned()) - } - fn get_name<'lua>(&self, context: Context<'lua>) -> rlua::Result> { let tree = self.tree.lock().unwrap(); @@ -374,28 +314,6 @@ impl LuaInstance { instance.name.as_str().to_lua(context) } - fn check_for_method<'lua>( - &self, - context: Context<'lua>, - key: &str, - ) -> Option>> { - let tree = self.tree.lock().unwrap(); - let instance = tree.get_by_ref(self.id)?; - - if instance.class == "Terrain" { - match key { - "CopyRegion" => Some( - context - .create_function(terrain::copy_region) - .and_then(|function| function.to_lua(context)), - ), - _ => None, - } - } else { - None - } - } - fn meta_index<'lua>( &self, context: Context<'lua>, From 92ceb23e93252acb444d21064450cd945b63f0e8 Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Mon, 10 May 2021 21:15:43 -0400 Subject: [PATCH 09/11] fix partially removed code --- src/roblox_api/instance.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/roblox_api/instance.rs b/src/roblox_api/instance.rs index 5843353..022e287 100644 --- a/src/roblox_api/instance.rs +++ b/src/roblox_api/instance.rs @@ -4,10 +4,7 @@ use std::{ sync::{Arc, Mutex}, }; -use rbx_dom_weak::{ - types::{Ref, Vector3int16}, - InstanceBuilder, WeakDom, -}; +use rbx_dom_weak::{types::Ref, InstanceBuilder, WeakDom}; use rbx_reflection::ClassTag; use rlua::{Context, FromLua, MetaMethod, ToLua, UserData, UserDataMethods}; @@ -330,11 +327,6 @@ impl LuaInstance { return Ok(value); } - if let Some(value) = self.check_for_method(context, key) { - println!("found method value yay"); - return value; - } - if let Some(child) = self.find_first_child(key)? { return child.to_lua(context); } From 180547b5fcda1b4537acdb2c3879a3d2caa4efa2 Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Mon, 10 May 2021 21:16:04 -0400 Subject: [PATCH 10/11] add entry to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d184cc..26193d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased Changes +* Added Region3 and Region3int16 types ([#51](https://github.com/rojo-rbx/remodel/pull/51)) * Added `Instance:FindFirstChildOfClass()` ([#50](https://github.com/rojo-rbx/remodel/pull/50)) * Added support for CFrame ([#48](https://github.com/rojo-rbx/remodel/pull/48)) * Added support for Vector3, and improved Vector3int16 ([#46](https://github.com/rojo-rbx/remodel/pull/46)) From 7079cef73c9ea1dc7d7fca5005f9fbf6aed3a853 Mon Sep 17 00:00:00 2001 From: jeparlefrancais Date: Tue, 11 May 2021 00:19:32 -0400 Subject: [PATCH 11/11] fix format --- src/roblox_api/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/roblox_api/mod.rs b/src/roblox_api/mod.rs index 525aaa3..be5dd53 100644 --- a/src/roblox_api/mod.rs +++ b/src/roblox_api/mod.rs @@ -118,7 +118,8 @@ impl UserData for Region3 { "new", |_context, (min, max): (Vector3Value, Vector3Value)| { Ok(Region3Value::new(rbx_dom_weak::types::Region3::new( - min.inner(), max.inner(), + min.inner(), + max.inner(), ))) }, );