-
Notifications
You must be signed in to change notification settings - Fork 38
Add attributes support #32
base: master
Are you sure you want to change the base?
Conversation
@@ -102,6 +102,22 @@ pub fn lua_to_rbxvalue(ty: VariantType, value: LuaValue<'_>) -> LuaResult<Varian | |||
} | |||
} | |||
|
|||
pub fn guess_type_from_rbxvalue(value: &LuaValue<'_>) -> Option<VariantType> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not ecstatic about this. I think it might be better to just make something like setRawAttribute
in its place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small note, but RbxValue
is a very dead name now, we just call those variants now!
rlua::Error::external("Cannot call GetAttribute() on a destroyed instance") | ||
})?; | ||
|
||
let attribute_binary_string = match instance.properties.get("AttributesSerialize") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a heads-up, we'll probably be tweaking the reflection database before attributes go live so that this property becomes just Attributes
when in memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attributes have been live for a few weeks now 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*before attributes go live in rbx-dom :)
Marked as draft while waiting for the merging of rojo-rbx/rbx-dom#166. Currently this just uses my repository. PR made anyway for code review.