diff --git a/ElvUI/Core/Core.lua b/ElvUI/Core/Core.lua index 8c253fe..9f9f71f 100644 --- a/ElvUI/Core/Core.lua +++ b/ElvUI/Core/Core.lua @@ -396,6 +396,9 @@ function E:IncompatibleAddOn(addon, module) end function E:IsAddOnEnabled(addon) + if addon == "Ascension_NamePlates" then + return C_CVar.GetBool("useNewNamePlates") + end local _, _, _, enabled, _, reason = GetAddOnInfo(addon) if reason ~= "MISSING" and enabled then return true @@ -420,6 +423,10 @@ function E:CheckIncompatible() self:IncompatibleAddOn("Healers-Have-To-Die", "NamePlates") elseif self:IsAddOnEnabled("TidyPlates") then self:IncompatibleAddOn("TidyPlates", "NamePlates") + elseif self:IsAddOnEnabled("Ascension_NamePlates") then + self:IncompatibleAddOn("Ascension_NamePlates", "NamePlates") + elseif self:IsAddOnEnabled("Kui_Nameplates") then + self:IncompatibleAddOn("Kui_Nameplates", "NamePlates") end end @@ -1111,6 +1118,18 @@ function E:DBConversions() E:CopyTable(self.db.nameplates, P.nameplates) end + if E.db.version and E.db.version < 7.13 then + if E.db.nameplates.plateSize.enemyWidth then + E.db.nameplates.plateSize.width = E.db.nameplates.plateSize.enemyWidth + E.db.nameplates.plateSize.enemyWidth = nil + end + + if E.db.nameplates.plateSize.enemyHeight then + E.db.nameplates.plateSize.width = E.db.nameplates.plateSize.enemyHeight + E.db.nameplates.plateSize.enemyHeight = nil + end + end + E.db.version = E.versionNum end diff --git a/ElvUI/Core/StaticPopups.lua b/ElvUI/Core/StaticPopups.lua index fdb6004..7d275df 100644 --- a/ElvUI/Core/StaticPopups.lua +++ b/ElvUI/Core/StaticPopups.lua @@ -166,7 +166,14 @@ E.PopupDialogs.DISABLE_INCOMPATIBLE_ADDON = { E.PopupDialogs.INCOMPATIBLE_ADDON = { text = L["INCOMPATIBLE_ADDON"], - OnAccept = function() DisableAddOn(E.PopupDialogs.INCOMPATIBLE_ADDON.addon) ReloadUI() end, + OnAccept = function() + if E.PopupDialogs.INCOMPATIBLE_ADDON.addon == "Ascension_NamePlates" then + C_CVar.Set("useNewNamePlates", "0") + else + DisableAddOn(E.PopupDialogs.INCOMPATIBLE_ADDON.addon) + end + ReloadUI() + end, OnCancel = function() E.private[strlower(E.PopupDialogs.INCOMPATIBLE_ADDON.module)].enable = false ReloadUI() end, button3 = L["Disable Warning"], OnAlt = function () diff --git a/ElvUI/Modules/Nameplates/Nameplates.lua b/ElvUI/Modules/Nameplates/Nameplates.lua index c7f0ea0..bbe4918 100644 --- a/ElvUI/Modules/Nameplates/Nameplates.lua +++ b/ElvUI/Modules/Nameplates/Nameplates.lua @@ -33,8 +33,15 @@ local UnitIsUnit = UnitIsUnit local UnitName = UnitName local UnitReaction = UnitReaction local UnitThreatSituation = UnitThreatSituation -local C_NamePlate_SetNamePlateEnemySize = C_NamePlateManager.SetNamePlateEnemySize -local C_NamePlate_SetNamePlateFriendlySize = C_NamePlateManager.SetNamePlateFriendlySize +local C_NamePlateManager_SetNamePlateSize +if not C_NamePlateManager.GetNamePlateSize then -- if this function isnt set, we are on old version still + C_NamePlateManager_SetNamePlateSize = function(width, height) + C_NamePlateManager.SetNamePlateFriendlySize(width, height) + C_NamePlateManager.SetNamePlateEnemySize(width, height) + end +else + C_NamePlateManager_SetNamePlateSize = C_NamePlateManager.SetNamePlateSize +end local hooksecurefunc = hooksecurefunc do -- credit: oUF/private.lua @@ -487,11 +494,7 @@ function NP:ConfigurePlates(init) NP.SkipFading = true if not init then -- these only need to happen when changing options for nameplate in pairs(NP.Plates) do - if nameplate.frameType == 'FRIENDLY_PLAYER' or nameplate.frameType == 'FRIENDLY_NPC' then - nameplate:Size(NP.db.plateSize.friendlyWidth, NP.db.plateSize.friendlyHeight) - else - nameplate:Size(NP.db.plateSize.enemyWidth, NP.db.plateSize.enemyHeight) - end + nameplate:Size(NP.db.plateSize.width, NP.db.plateSize.height) nameplate.previousType = nil -- keep over the callback, we still need a full update NP:NamePlateCallBack(nameplate, 'NAME_PLATE_UNIT_ADDED') @@ -557,14 +560,8 @@ function NP:UpdatePlateType(nameplate) end function NP:UpdatePlateSize(nameplate) - if nameplate.frameType == 'FRIENDLY_PLAYER' or nameplate.frameType == 'FRIENDLY_NPC' then - nameplate.width, nameplate.height = NP.db.plateSize.friendlyWidth, NP.db.plateSize.friendlyHeight - C_NamePlate_SetNamePlateFriendlySize(nameplate.width, nameplate.height) - else - nameplate.width, nameplate.height = NP.db.plateSize.enemyWidth, NP.db.plateSize.enemyHeight - C_NamePlate_SetNamePlateEnemySize(nameplate.width, nameplate.height) - end - + nameplate.width, nameplate.height = NP.db.plateSize.width, NP.db.plateSize.height + C_NamePlateManager_SetNamePlateSize(nameplate.width, nameplate.height) nameplate:Size(nameplate.width, nameplate.height) end @@ -681,8 +678,7 @@ end function NP:SetNamePlateSizes() --if InCombatLockdown() then return end - C_NamePlate_SetNamePlateEnemySize(NP.db.plateSize.enemyWidth, NP.db.plateSize.enemyHeight) - C_NamePlate_SetNamePlateFriendlySize(NP.db.plateSize.friendlyWidth, NP.db.plateSize.friendlyHeight) + C_NamePlateManager_SetNamePlateSize(NP.db.plateSize.width, NP.db.plateSize.height) end function NP:Initialize() diff --git a/ElvUI/Settings/Profile.lua b/ElvUI/Settings/Profile.lua index 167199e..b80c749 100644 --- a/ElvUI/Settings/Profile.lua +++ b/ElvUI/Settings/Profile.lua @@ -496,10 +496,8 @@ P.nameplates = { plateSize = { personalWidth = 150, personalHeight = 30, - friendlyWidth = 150, - friendlyHeight = 30, - enemyWidth = 150, - enemyHeight = 30, + width = 150, + height = 30, }, threat = { enable = true, diff --git a/ElvUI_OptionsUI/Nameplates.lua b/ElvUI_OptionsUI/Nameplates.lua index 2d400a9..df36aca 100644 --- a/ElvUI_OptionsUI/Nameplates.lua +++ b/ElvUI_OptionsUI/Nameplates.lua @@ -430,15 +430,8 @@ NamePlates.generalGroup.args.bossMods.args.settings.args.growthDirection = ACH:S NamePlates.generalGroup.args.clickableRange = ACH:Group(L["Clickable Size"], nil, 70, nil, function(info) return E.db.nameplates.plateSize[info[#info]] end, function(info, value) E.db.nameplates.plateSize[info[#info]] = value NP:ConfigureAll() end) -NamePlates.generalGroup.args.clickableRange.args.friendly = ACH:Group(L["Friendly"], nil, 2) -NamePlates.generalGroup.args.clickableRange.args.friendly.inline = true -NamePlates.generalGroup.args.clickableRange.args.friendly.args.friendlyWidth = ACH:Range(L["Clickable Width / Width"], L["Change the width and controls how big of an area on the screen will accept clicks to target unit."], 1, { min = 50, max = 250, step = 1 }) -NamePlates.generalGroup.args.clickableRange.args.friendly.args.friendlyHeight = ACH:Range(L["Clickable Height"], L["Controls how big of an area on the screen will accept clicks to target unit."], 2, { min = 10, max = 75, step = 1 }) - -NamePlates.generalGroup.args.clickableRange.args.enemy = ACH:Group(L["Enemy"], nil, 3) -NamePlates.generalGroup.args.clickableRange.args.enemy.inline = true -NamePlates.generalGroup.args.clickableRange.args.enemy.args.enemyWidth = ACH:Range(L["Clickable Width / Width"], L["Change the width and controls how big of an area on the screen will accept clicks to target unit."], 1, { min = 50, max = 250, step = 1 }) -NamePlates.generalGroup.args.clickableRange.args.enemy.args.enemyHeight = ACH:Range(L["Clickable Height"], L["Controls how big of an area on the screen will accept clicks to target unit."], 2, { min = 10, max = 75, step = 1 }) +NamePlates.generalGroup.args.clickableRange.args.width = ACH:Range(L["Clickable Width / Width"], L["Change the width and controls how big of an area on the screen will accept clicks to target unit."], 1, { min = 50, max = 250, step = 1 }) +NamePlates.generalGroup.args.clickableRange.args.height = ACH:Range(L["Clickable Height"], L["Controls how big of an area on the screen will accept clicks to target unit."], 2, { min = 10, max = 75, step = 1 }) NamePlates.generalGroup.args.cutaway = ACH:Group(L["Cutaway Bars"], nil, 75) NamePlates.generalGroup.args.cutaway.args.health = ACH:Group(L["Health"], nil, 1, nil, function(info) return E.db.nameplates.cutaway.health[info[#info]] end, function(info, value) E.db.nameplates.cutaway.health[info[#info]] = value NP:ConfigureAll() end)