-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Item Popup stat bars display revamp #10821
Conversation
@@ -2,7 +2,7 @@ | |||
* Given a value 0-1, returns a string describing it as a percentage from 0-100 | |||
*/ | |||
export function percent(val: number): string { | |||
return `${Math.min(100, Math.floor(100 * val))}%`; | |||
return `${Math.min(100, Math.floor((1000 * val) / 10))}%`; |
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.
This fixed a JS rounding issue. .29
would become 28%
.
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.
The updated UI looks great. I haven't checked the code but i'm sure it's fine.
opacity: 0.8; | ||
} | ||
|
||
.tooltipNetStat { |
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.
As a general rule, we don't need to nest selectors unless they have different properties when nested and when un-nested. Otherwise, since they're always uniquely-named, they won't ever conflict with anything else.
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.
Fair in tooltipNetStat, though some of these simpler class names like "negative" "mod" etc are doing double duty with nesting as bar colors and text colors.
Currently, stat bars are made up of multiple segments, each with its own tooltip, some difficult to aim a mouse at.

This PR