feat(roblox): add TweenInfo datatype#402
Open
pealz1 wants to merge 1 commit into
Open
Conversation
Adds the TweenInfo datatype to the roblox standard library, matching Roblox's constructor and property surface: - TweenInfo.new(time?, easingStyle?, easingDirection?, repeatCount?, reverses?, delayTime?) - Properties: Time, EasingStyle, EasingDirection, RepeatCount, Reverses, DelayTime - Eq and tostring metamethods EasingStyle/EasingDirection arguments are validated against their Enum types. TweenInfo has no rbx_dom_weak backing (Roblox never stores it on instances), so it is a standalone datatype with no DOM conversion. Includes a Luau test and a changelog entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
TweenInfodatatype to therobloxstandard library. It was the only commonly-used tween-related datatype missing, soroblox.TweenInfocurrently returnsnil.What's included
TweenInfo.new(time?, easingStyle?, easingDirection?, repeatCount?, reverses?, delayTime?)with Roblox's defaults (Time = 1,EasingStyle = Quad,EasingDirection = Out,RepeatCount = 0,Reverses = false,DelayTime = 0).Time,EasingStyle,EasingDirection,RepeatCount,Reverses,DelayTime.EqandToStringmetamethods.EasingStyle/EasingDirectionarguments are validated against theirEnumtypes, mirroring howFontvalidatesFontWeight/FontStyle.Implementation notes
TweenInfois never stored on instances, so it has norbx_dom_weakbacking type. Like the enum singletons, it's therefore a standalone datatype and does not participate in DOM conversion (conversion.rs/extension.rs/attributes.rsare untouched). The two easing enums are stored asEnumItemrather than re-declared as Rust enums, keeping the surface small.Testing
tests/roblox/datatypes/TweenInfo.luaucovering constructors, defaults, property round-trips, enum-type validation errors, equality, and tostring — registered incrates/lune/src/tests.rs.cargo test -p lune roblox_datatype_tween_infopasses.cargo fmtclean;cargo clippyreports nothing new for the added code.