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

fix: use official color:lerp implementation if possible #56

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

JustPlayerDE
Copy link
Collaborator

@JustPlayerDE JustPlayerDE commented Jul 3, 2024

With garrysmod version 2024.06.28 there is a new official colorObj:Lerp() method which is not directly compatible with pixel's definition as the parameters are swapped causing issues.
Wiki Page: https://wiki.facepunch.com/gmod/Color:Lerp

The new Lerp method does not seem to be on default branch right now, for this case I have left the old pixel ui implementation as a replacement with the parameters swapped but with backwards compatibility and deprecation warning until the new implementation gets merged to garrysmod main.

Addons using the original pixel ui implementation may break with this change after the garrysmod update.

Copy link
Owner

@TomDotBat TomDotBat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, not sure I like the idea of throwing an ErrorNoHalt on every call considering this method is generally used every frame.

@JustPlayerDE
Copy link
Collaborator Author

Looks good, not sure I like the idea of throwing an ErrorNoHalt on every call considering this method is generally used every frame.

I would say this is fine considering that this is a thing that should be updated as fast as possible, otherwise real errors will be thrown ever frame anyways in the future but with actually stopping the stack too (causing actual errors like breaking the entire hud)

I can make it throw only once though. as soon as a developer sees the initial error it should be clear enough I guess.

@TomDotBat TomDotBat merged commit a9747e4 into master Jul 4, 2024
1 check passed
@TomDotBat TomDotBat deleted the justink/use-official-color-lerp branch July 4, 2024 09:13
Lythium4848 added a commit to Pulsar-Dev/pulsar-ui that referenced this pull request Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants