Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: Add a Configuration Table #9

Open
1 task done
ghost opened this issue May 27, 2023 · 5 comments
Open
1 task done

[FEATURE]: Add a Configuration Table #9

ghost opened this issue May 27, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented May 27, 2023

Contact Details

https://devforum.roblox.com/u/vscplays/summary

Is your feature request related to a problem?

I have an problem when I was adding some values, It makes the code harder for me to read

these are the properties

time: number?,
	style: Enum.EasingStyle?,
	direction: Enum.EasingDirection?,
	repeatCount: number?,
	reverses: boolean?,
	delayTime: number?

Describe the solution you'd like

I would like to see the configuration table of these properties

time: number?,
	style: Enum.EasingStyle?,
	direction: Enum.EasingDirection?,
	repeatCount: number?,
	reverses: boolean?,
	delayTime: number?

Describe alternatives you've considered

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ghost ghost added the enhancement New feature or request label May 27, 2023
@ghost ghost changed the title [FEATURE]: Add a Configuration [FEATURE]: Add a Configuration Table May 27, 2023
@RyanLua
Copy link
Owner

RyanLua commented May 28, 2023

From what your stating you would prefer to have the constructor be changed from

new(parent: GuiObject, time: number?, style: EasingStyle?, direction: EasingDirection?, repeatCount: number?, reverses: boolean?, delayTime: number?)

to

new(parent: GuiObject, tweenInfo: TweenInfo?)

or something similar. The TweenInfo data type already can be used instead of a table.

Shime aims to be as familiar and easy to use as possible so it would make sense to borrow TweenInfo table, which is very much in scope of Shime.

Currently as it stands if I do change the constructor, it would break backwards compatibility with the previous, including LTS releases of Shime.

@ghost
Copy link
Author

ghost commented May 28, 2023

Yeah that is better ;)

For now I gotta close this

I found how to fix this

function Shime.new(parent: GuiObject, tweenInfo: TweenInfo?)
	tweenInfo = tweenInfo or TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1, false, 0)

	local self = setmetatable({}, Shime)

	-- Create the shimmer frame and animation
	local shimmer = createShimmer(parent)
	self._frame = shimmer
	self._gradient = shimmer:FindFirstChildOfClass("UIGradient")
	self._corner = shimmer:FindFirstChildOfClass("UICorner")

	-- Create the tween
	self._tween = TweenService:Create(
		self._gradient,
		tweenInfo,
		{ Offset = Vector2.new(1, 0) }
	)

	-- Setup tween completion callback. Under default constants this will never be called as the tween will repeat infinitely
	self._tween.Completed:Connect(function()
		self:_TweenCompleted()
	end)

	return self
end

@ghost ghost closed this as completed May 28, 2023
@RyanLua
Copy link
Owner

RyanLua commented May 28, 2023

I didn't push any commits? I'm not sure how I solved this issue but alright.

@ghost ghost reopened this May 29, 2023
@ghost
Copy link
Author

ghost commented May 29, 2023

You mentioned this:

From what your stating you would prefer to have the constructor be changed from

new(parent: GuiObject, time: number?, style: EasingStyle?, direction: EasingDirection?, repeatCount: number?, reverses: boolean?, delayTime: number?)

to

new(parent: GuiObject, tweenInfo: TweenInfo?)

or something similar. The TweenInfo data type already can be used instead of a table.

@RyanLua
Copy link
Owner

RyanLua commented May 29, 2023

You mentioned this:

From what your stating you would prefer to have the constructor be changed from

new(parent: GuiObject, time: number?, style: EasingStyle?, direction: EasingDirection?, repeatCount: number?, reverses: boolean?, delayTime: number?)

to

new(parent: GuiObject, tweenInfo: TweenInfo?)

or something similar. The TweenInfo data type already can be used instead of a table.

I'm not planning to introduce a new constructor yet as it will break all pre-existing ones and require me to update all documentation for a small change which gives little benefits.

So I don't get why this is marked as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant