Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

Add attributes support #32

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

Kampfkarren
Copy link
Member

@Kampfkarren Kampfkarren commented Mar 8, 2021

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.

  • Test how getting behaves for unimplemented types, such as Color3.
  • Include a test file with existing attributes.

@@ -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> {
Copy link
Member Author

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.

Copy link
Contributor

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") {
Copy link
Contributor

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.

Copy link
Member Author

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 😛

Copy link
Contributor

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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants