Refactor QuestFrame text and position handling
All checks were successful
forgejo/Czech Quests/addon/pipeline/head This commit looks good
All checks were successful
forgejo/Czech Quests/addon/pipeline/head This commit looks good
This commit is contained in:
parent
bbda7d7b34
commit
39f772ed43
3 changed files with 24 additions and 25 deletions
|
@ -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()
|
||||
|
|
|
@ -77,13 +77,6 @@ function QuestFrame:UpdateSettings()
|
|||
end
|
||||
end
|
||||
|
||||
function QuestFrame:ResetText()
|
||||
self.Title:SetText("")
|
||||
self.Header:SetText("")
|
||||
self.Text1:SetText("")
|
||||
self.Text2:SetText("")
|
||||
end
|
||||
|
||||
function QuestFrame:SetTextColor(r, g, b, a)
|
||||
self.Title:SetTextColor(r, g, b, a)
|
||||
self.Header:SetTextColor(r, g, b, a)
|
||||
|
@ -124,16 +117,15 @@ end
|
|||
function QuestFrame:SetData(name, text1, header, text2, parentFrame, yOffset, xOffset)
|
||||
-- Reset previously values
|
||||
self:ApplyTheme()
|
||||
self:ResetText()
|
||||
|
||||
-- Set parent
|
||||
self:SetParent(parentFrame)
|
||||
|
||||
-- set text to labels
|
||||
self.Title:SetText(name)
|
||||
self.Text1:SetText(text1)
|
||||
self.Header:SetText(header)
|
||||
self.Text2:SetText(text2)
|
||||
self.Title:SetText(name or "")
|
||||
self.Text1:SetText(text1 or "")
|
||||
self.Header:SetText(header or "")
|
||||
self.Text2:SetText(text2 or "")
|
||||
|
||||
-- apply text positions
|
||||
self.Title:SetPoint("TOPLEFT", self, "TOPLEFT", 10, -10)
|
||||
|
@ -142,11 +134,7 @@ function QuestFrame:SetData(name, text1, header, text2, parentFrame, yOffset, xO
|
|||
self.Text2:SetPoint("TOPLEFT", self.Header, "BOTTOMLEFT", 0, -5)
|
||||
|
||||
-- apply frame position
|
||||
if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then
|
||||
self:SetPoint("TOPLEFT", parentFrame, "TOPRIGHT", xOffset, yOffset)
|
||||
else
|
||||
self:SetPoint("TOPLEFT", parentFrame, "TOPRIGHT", xOffset, yOffset)
|
||||
end
|
||||
self:SetPoint("TOPLEFT", parentFrame, "TOPRIGHT", xOffset, yOffset)
|
||||
|
||||
self:Show()
|
||||
|
||||
|
|
8
sync.sh
8
sync.sh
|
@ -1,13 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
wow_source_folder="retail"
|
||||
wow_destiny_folder="retail"
|
||||
#wow_source_folder="retail"
|
||||
#wow_destiny_folder="retail"
|
||||
|
||||
#wow_destiny_folder="retail"
|
||||
#wow_destiny_folder="beta"
|
||||
|
||||
#wow_source_folder="classic_era"
|
||||
#wow_destiny_folder="classic_era"
|
||||
wow_source_folder="classic_era"
|
||||
wow_destiny_folder="classic_era"
|
||||
|
||||
src_folder="."
|
||||
dest_folder="/Applications/World of Warcraft/_${wow_destiny_folder}_/Interface/AddOns/CzechQuests"
|
||||
|
|
Loading…
Add table
Reference in a new issue