-
Notifications
You must be signed in to change notification settings - Fork 58
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
stagger: Move colour update to its own function #359
Conversation
elements/stagger.lua
Outdated
element:SetMinMaxValues(0, max) | ||
element:SetValue(cur) | ||
|
||
--[[ Override: Stagger:UpdateColor(unit, perc) |
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.
unit is unused
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.
yeah, forgot to remove it 😁🔫
elements/stagger.lua
Outdated
element:SetValue(cur) | ||
|
||
--[[ Override: Stagger:UpdateColor(unit, perc) | ||
Used to completely override the internal function for updating the widgets' colors. |
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.
widget's
instead of widgets'
- we only have one
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.
Copypaste typo o_O
Copied it from health element, it says widgets'
there...
elements/stagger.lua
Outdated
Used to completely override the internal function for updating the widgets' colors. | ||
|
||
* self - the Stagger element | ||
* perc - the percentage of staggered damage (number) |
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.
Maybe add that it is relative to the player's maximum health.
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.
And maybe add value range
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.
Why though? It can't be relative to anything else, and it's a percentage, it's 0-1, always...
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.
It can be relative to what matters to whoever overrides UpdateColor. Also not all ppl think of percentages as values between 0-1. Actually perc is only used by UpdateColor, why not pass stagger and max health to it and calc perc in UpdateColor?
No description provided.