local format = format
+ local BreakUpLargeNumbers = BreakUpLargeNumbers
local strjoin = strjoin
local GetCritChance = GetCritChance
local GetRangedCritChance = GetRangedCritChance
local GetCombatRating = GetCombatRating
local GetCombatRatingBonus = GetCombatRatingBonus
local STAT_CATEGORY_ENHANCEMENTS = STAT_CATEGORY_ENHANCEMENTS
local CRIT_ABBR = CRIT_ABBR
local MELEE_CRIT_CHANCE = MELEE_CRIT_CHANCE
local CR_CRIT_MELEE_TOOLTIP = CR_CRIT_MELEE_TOOLTIP
local CR_CRIT_MELEE = CR_CRIT_MELEE
local CR_CRIT_RANGED = CR_CRIT_RANGED
+ local CR_CRIT_TOOLTIP = CR_CRIT_TOOLTIP
local displayString, db = ''
local meleeCrit, rangedCrit, ratingIndex = 0, 0
local function OnEnter()
DT.tooltip:ClearLines()
+ if E.Classic then
DT.tooltip:AddLine(format('%s: %.2f%%', MELEE_CRIT_CHANCE, meleeCrit))
+ else
- if not E.Classic then
- DT.tooltip:AddLine(' ')
- DT.tooltip:AddLine(format(CR_CRIT_MELEE_TOOLTIP, GetCombatRating(ratingIndex), GetCombatRatingBonus(ratingIndex)))
+ DT.tooltip:AddLine(format('|cffFFFFFF%s|r %s%.2F%%|r', MELEE_CRIT_CHANCE, '|cffFFFFFF', meleeCrit))
+ DT.tooltip:AddDoubleLine(format(CR_CRIT_TOOLTIP, BreakUpLargeNumbers(critical) , GetCombatRatingBonus(ratingIndex)))
end
DT.tooltip:Show()
end
If you were to apply this change this tooltip now looks like the image below.
This is the same as what the character sheet shows and is no longer mismatched from the other DataTexts.
Reproducing the issue.
No response
Lua Errors
No response
Verification Steps
[X] I have read the Changelog and verified ElvUI is up to date by checking /estatus
[X] I have verified my issue doesn't exist in the Default UI or the Issue Tracker.
[ ] I have not read any of these steps, please close my issue when you see it.
[X] I have done the Troubleshooting Steps and included the requested screenshots, which show the issue and status panel.
Troubleshooting Steps
When playing the game in retail and using a DataText for Critical Strike the tooltip used is the one you should be getting in classic.
This gif show how distinctly different Critical Strike is from all other secondary stats. []
Below is an image of how the tooltip is displayed on the character sheet.
Here is one more image with the status screen showing that all other addons are turned off.
Describe the expected behavior and what actually happened?
This has been bugging me for a while now so I decided to look into the source code and fix the bug myself by copying how haste is done.
In the file ElvUI/ElvUI/Core/Datatexts/Crit.lua, the function
OnEvent()
does not properly distinguish between classic and retail.If you were to apply this change this tooltip now looks like the image below.
This is the same as what the character sheet shows and is no longer mismatched from the other DataTexts.
Reproducing the issue.
No response
Lua Errors
No response
Verification Steps