addon/Frames/TranslationInfoFrame.lua

43 lines
2.4 KiB
Lua
Executable file

local headerFontPath = "Interface\\AddOns\\CzechQuests\\Fonts\\morpheus_cz.ttf"
local textFontPath = "Interface\\AddOns\\CzechQuests\\Fonts\\frizquadratatt_cz.ttf"
local translationInfoFrame = CreateFrame("Frame", "TranslationInfoFrame", nil, BackdropTemplateMixin and "BackdropTemplate")
translationInfoFrame:SetWidth(QuestLogFrame:GetWidth())
translationInfoFrame:SetBackdrop({
bgFile = "Interface/Buttons/WHITE8x8",
edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 },
})
translationInfoFrame:Hide()
local TranslationInfoFramePrimaryHeader = translationInfoFrame:CreateFontString("TranslationInfoFramePrimaryHeader", "OVERLAY", "QuestTitleFont")
TranslationInfoFramePrimaryHeader:SetWidth(translationInfoFrame:GetWidth() - 20)
TranslationInfoFramePrimaryHeader:SetJustifyH("LEFT")
TranslationInfoFramePrimaryHeader:SetTextColor(0, 0, 0, 1)
TranslationInfoFramePrimaryHeader:SetFont(headerFontPath, 20, nil)
local TranslationInfoFrameSecondaryHeader = translationInfoFrame:CreateFontString("TranslationInfoFrameSecondaryHeader", "OVERLAY", "QuestTitleFont")
TranslationInfoFrameSecondaryHeader:SetWidth(translationInfoFrame:GetWidth() - 20)
TranslationInfoFrameSecondaryHeader:SetJustifyH("LEFT")
TranslationInfoFrameSecondaryHeader:SetTextColor(0, 0, 0, 1)
TranslationInfoFrameSecondaryHeader:SetFont(headerFontPath, 20, nil)
local TranslationInfoFramePrimaryText = translationInfoFrame:CreateFontString("TranslationInfoFramePrimaryText", "OVERLAY", "QuestFont")
TranslationInfoFramePrimaryText:SetWidth(translationInfoFrame:GetWidth() - 20)
TranslationInfoFramePrimaryText:SetJustifyH("LEFT")
TranslationInfoFramePrimaryText:SetTextColor(0, 0, 0, 1)
TranslationInfoFramePrimaryText:SetFont(textFontPath, 15, nil)
local TranslationInfoFrameSecondaryText = translationInfoFrame:CreateFontString("TranslationInfoFrameSecondaryText", "OVERLAY", "QuestFont")
TranslationInfoFrameSecondaryText:SetWidth(translationInfoFrame:GetWidth() - 20)
TranslationInfoFrameSecondaryText:SetJustifyH("LEFT")
TranslationInfoFrameSecondaryText:SetTextColor(0, 0, 0, 1)
TranslationInfoFrameSecondaryText:SetFont(textFontPath, 15, nil)
TranslationInfoFrame:RegisterEvent("QUEST_PROGRESS")
TranslationInfoFrame:RegisterEvent("QUEST_COMPLETE")
TranslationInfoFrame:RegisterEvent("QUEST_FINISHED")
TranslationInfoFrame:RegisterEvent("QUEST_DETAIL")
TranslationInfoFrame:RegisterEvent("ITEM_TEXT_READY")