Skip to content

Commit

Permalink
Fixed an error when manually selection the tooltip anchor position
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed May 8, 2024
1 parent 042322a commit 5aa9929
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
13 changes: 11 additions & 2 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 535
local dversion = 536
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down Expand Up @@ -4488,6 +4488,7 @@ function DF:GetClassSpecIds(engClass) --naming conventions
return DF:GetClassSpecIDs(engClass)
end

--kinda deprecated
local getDragonflightTalents = function()
if (not ClassTalentFrame) then
ClassTalentFrame_LoadUI()
Expand Down Expand Up @@ -4522,9 +4523,17 @@ local getDragonflightTalents = function()
return exportStream:GetExportString()
end

local getDragonflightTalentsEasy = function()
local activeConfigID = C_ClassTalents.GetActiveConfigID()
if (activeConfigID and activeConfigID > 0) then
return C_Traits.GenerateImportString(activeConfigID)
end
return ""
end

--/dump DetailsFramework:GetDragonlightTalentString()
function DF:GetDragonlightTalentString()
local runOkay, errorText = pcall(getDragonflightTalents)
local runOkay, errorText = pcall(getDragonflightTalentsEasy)
if (not runOkay) then
DF:Msg("error 0x4517", errorText)
return ""
Expand Down
12 changes: 6 additions & 6 deletions frames/window_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3327,8 +3327,7 @@ do
tooltip_anchor:SetBackdropColor(0, 0, 0, 1)

tooltip_anchor:SetScript("OnEnter", function(self)
tooltip_anchor.alert.animIn:Stop()
tooltip_anchor.alert.animOut:Play()
tooltip_anchor.glowAnimation:Stop()
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT")
GameTooltip:ClearLines()
GameTooltip:AddLine(Loc["STRING_OPTIONS_TOOLTIPS_ANCHOR_TEXT_DESC"])
Expand Down Expand Up @@ -3370,16 +3369,14 @@ do
self:SetMovable(true)
self:SetFrameStrata("FULLSCREEN")
self.locked = false
tooltip_anchor.alert.animOut:Stop()
tooltip_anchor.alert.animIn:Play()
tooltip_anchor.glowAnimation:Play()
else
self:SetAlpha(0)
self:EnableMouse(false)
self:SetFrameStrata("MEDIUM")
self:SetMovable(false)
self.locked = true
tooltip_anchor.alert.animIn:Stop()
tooltip_anchor.alert.animOut:Play()
tooltip_anchor.glowAnimation:Stop()
end
end

Expand All @@ -3400,6 +3397,9 @@ do
tooltip_anchor.alert:SetPoint("topleft", tooltip_anchor, "topleft", -60, 6)
tooltip_anchor.alert:SetPoint("bottomright", tooltip_anchor, "bottomright", 40, -6)

local glowAnimation = gump:CreateGlowOverlay(tooltip_anchor, "yellow", "white")
tooltip_anchor.glowAnimation = glowAnimation

local icon = tooltip_anchor:CreateTexture(nil, "overlay")
icon:SetTexture([[Interface\AddOns\Details\images\minimap]])
icon:SetPoint("left", tooltip_anchor, "left", 4, 0)
Expand Down

0 comments on commit 5aa9929

Please sign in to comment.