Improve QuestFrame font handling
All checks were successful
forgejo/Czech Quests/addon/pipeline/head This commit looks good

This commit is contained in:
Roman Jaroš 2025-03-08 21:39:43 +01:00
parent d90715c2cc
commit 7a12abeda3
8 changed files with 96 additions and 181 deletions

View file

@ -49,6 +49,9 @@ local function ShowQuestTranslation(event)
if data then
local title = GetQuestTitle(data.title, questId)
local xOffset = hasModel and 210 or 10
if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then
xOffset = -20
end
if event == "QUEST_PROGRESS" then
frame:SetData(title, data.progress, "", "", QuestFrame, -20, xOffset)
elseif event == "QUEST_COMPLETE" then
@ -109,13 +112,21 @@ local function InitQuests()
if event == "PLAYER_LOGIN" then
-- classic
if QuestLogFrame then
QuestLogFrame:SetScript("OnEnter", function() ShowQuestTranslation() end)
QuestLogFrame:SetScript("OnLeave", function() frame:Hide() end)
QuestLogFrame:SetScript("OnEnter", function()
ShowQuestTranslation()
end)
QuestLogFrame:SetScript("OnLeave", function()
frame:Hide()
end)
end
-- retail
if QuestMapDetailsScrollFrame then
QuestMapDetailsScrollFrame:SetScript("OnEnter", function() ShowQuestTranslation() end)
QuestMapDetailsScrollFrame:SetScript("OnLeave", function() frame:Hide() end)
QuestMapDetailsScrollFrame:SetScript("OnEnter", function()
ShowQuestTranslation()
end)
QuestMapDetailsScrollFrame:SetScript("OnLeave", function()
frame:Hide()
end)
end
frame:Init()