Skip to content

Commit

Permalink
Merge branch 'main' into ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Aug 7, 2024
2 parents 8bf4e17 + da0ab14 commit 54e0193
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
14 changes: 11 additions & 3 deletions ElvUI/Core/General/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1394,21 +1394,29 @@ function E:DBConvertDF()
local currency = E.global.datatexts.customCurrencies
if currency then
for id, data in next, E.global.datatexts.customCurrencies do
local info = { name = data.NAME, showMax = data.SHOW_MAX, currencyTooltip = data.DISPLAY_IN_MAIN_TOOLTIP, nameStyle = data.DISPLAY_STYLE and (strfind(data.DISPLAY_STYLE, 'ABBR') and 'abbr' or strfind(data.DISPLAY_STYLE, 'TEXT') and 'full' or 'none') or nil }
local info = {
name = data.NAME or nil,
showMax = data.SHOW_MAX or nil,
currencyTooltip = data.DISPLAY_IN_MAIN_TOOLTIP or nil,
nameStyle = data.DISPLAY_STYLE and (strfind(data.DISPLAY_STYLE, 'ABBR') and 'abbr' or strfind(data.DISPLAY_STYLE, 'TEXT') and 'full' or 'none') or nil
}

if next(info) then
E.global.datatexts.customCurrencies[id] = info
end
end
end
end

function E:DBConvertDev()
if E.private.general.gameMenuScale ~= nil then
E.db.general.gameMenuScale = E.private.general.gameMenuScale
E.private.general.gameMenuScale = nil
end
end

function E:DBConvertDev()

end

function E:UpdateDB()
E.private = E.charSettings.profile
E.global = E.data.global
Expand Down
2 changes: 1 addition & 1 deletion ElvUI/Core/General/Tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ E:AddTag('spec', 'PLAYER_TALENT_UPDATE UNIT_NAME_UPDATE', function(unit)
if info then
return info.name
end
end, not E.Retail)
end)

E:AddTag('specialization', 'PLAYER_TALENT_UPDATE UNIT_NAME_UPDATE', function(unit)
return _TAGS.spec(unit)
Expand Down
35 changes: 17 additions & 18 deletions ElvUI/Core/Modules/Nameplates/Nameplates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,21 @@ function NP:SetNamePlateSizes()
C_NamePlate_SetNamePlateFriendlySize(NP.db.plateSize.friendlyWidth * E.uiscale, NP.db.plateSize.friendlyHeight * E.uiscale)
end

function NP:HideClassNameplateBar(bar)
if not bar then return end

bar:Hide()
bar:UnregisterAllEvents()
end

function NP:SetupClassNameplateBars()
if not self or self:IsForbidden() then return end

NP:HideClassNameplateBar(self.classNamePlatePowerBar)
NP:HideClassNameplateBar(self.classNamePlateMechanicFrame)
NP:HideClassNameplateBar(self.classNamePlateAlternatePowerBar) -- BrewmasterBar / EbonMightBar
end

function NP:Initialize()
NP.db = E.db.nameplates

Expand All @@ -942,26 +957,10 @@ function NP:Initialize()
NP.multiplier = 0.35
NP.numPlates = 0

local BlizzPlateManaBar = _G.NamePlateDriverFrame.classNamePlatePowerBar
if BlizzPlateManaBar then
BlizzPlateManaBar:Hide()
BlizzPlateManaBar:UnregisterAllEvents()
end

if E.Retail then
NP.SetupClassNameplateBars(_G.NamePlateDriverFrame)
hooksecurefunc(_G.NamePlateDriverFrame, 'UpdateNamePlateOptions', NP.SetNamePlateSizes)
hooksecurefunc(_G.NamePlateDriverFrame, 'SetupClassNameplateBars', function(frame)
if not frame or frame:IsForbidden() then
return
end
if frame.classNamePlateMechanicFrame then
frame.classNamePlateMechanicFrame:Hide()
end
if frame.classNamePlatePowerBar then
frame.classNamePlatePowerBar:Hide()
frame.classNamePlatePowerBar:UnregisterAllEvents()
end
end)
hooksecurefunc(_G.NamePlateDriverFrame, 'SetupClassNameplateBars', NP.SetupClassNameplateBars)
end

ElvUF:Spawn('player', 'ElvNP_Player', '')
Expand Down

0 comments on commit 54e0193

Please sign in to comment.