fix: show learner tooltips in auto mode
This commit is contained in:
@@ -586,6 +586,12 @@ function QuestieLearner:IsLearnerLiveEnabled()
|
||||
return mode == "auto" or mode == "learner"
|
||||
end
|
||||
|
||||
function QuestieLearner:CanShowLearnerTooltips()
|
||||
if not EnsureLearnedData() then return false end
|
||||
local mode = self:GetDataSourceMode()
|
||||
return mode == "auto" or mode == "learner"
|
||||
end
|
||||
|
||||
function QuestieLearner:ApplyDataSourceMode()
|
||||
if not EnsureLearnedData() then return end
|
||||
local settings = Questie.dbLearner and Questie.dbLearner.global and Questie.dbLearner.global.settings
|
||||
@@ -4901,7 +4907,7 @@ end
|
||||
local function _ShowLearnerTooltipFrame(sourceTooltip, lines)
|
||||
local tooltip = _GetLearnerTooltipFrame()
|
||||
tooltip:ClearLines()
|
||||
tooltip:SetOwner(sourceTooltip or GameTooltip, "ANCHOR_RIGHT")
|
||||
tooltip:SetOwner(UIParent, "ANCHOR_NONE")
|
||||
for _, line in next, lines do
|
||||
tooltip:AddLine(line)
|
||||
end
|
||||
@@ -4909,6 +4915,9 @@ local function _ShowLearnerTooltipFrame(sourceTooltip, lines)
|
||||
if QuestieTooltips and QuestieTooltips.ResizeTooltip then
|
||||
QuestieTooltips:ResizeTooltip(tooltip)
|
||||
end
|
||||
local anchor = sourceTooltip or GameTooltip
|
||||
tooltip:ClearAllPoints()
|
||||
tooltip:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", 0, -2)
|
||||
tooltip:Show()
|
||||
end
|
||||
|
||||
@@ -4921,6 +4930,10 @@ local function _AddLearnedSpawnTooltipLine(unitToken)
|
||||
_HideLearnerTooltipFrame()
|
||||
return
|
||||
end
|
||||
if not QuestieLearner:CanShowLearnerTooltips() then
|
||||
_HideLearnerTooltipFrame()
|
||||
return
|
||||
end
|
||||
if not Questie.db.profile or Questie.db.profile.learnerTooltips == false then
|
||||
_HideLearnerTooltipFrame()
|
||||
return
|
||||
|
||||
@@ -302,7 +302,10 @@ local function _GetLearnerTooltipLines(key)
|
||||
if not id then return nil end
|
||||
|
||||
local QuestieLearner = QuestieLoader:ImportModule("QuestieLearner")
|
||||
if not QuestieLearner or not QuestieLearner.IsEnabled or not QuestieLearner:IsEnabled() then
|
||||
if not QuestieLearner
|
||||
or not QuestieLearner.CanShowLearnerTooltips
|
||||
or not QuestieLearner:CanShowLearnerTooltips()
|
||||
then
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user