59 lines
2.5 KiB
Lua
59 lines
2.5 KiB
Lua
|
function CzechQuestsAddon:CreateTranslationSpeechFrame()
|
||
|
local frame = {};
|
||
|
|
||
|
-- Speech Translation Frame
|
||
|
frame = CreateFrame("Frame", "CzechQuestsTranslationSpeechFrame", UIParant, "BackdropTemplate")
|
||
|
frame:SetSize(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH, 50)
|
||
|
frame:SetPoint("CENTER", UIParent, "CENTER")
|
||
|
|
||
|
-- Make draggable
|
||
|
frame:EnableMouse(true)
|
||
|
frame:SetMovable(true)
|
||
|
frame:RegisterForDrag("LeftButton")
|
||
|
frame:SetScript("OnDragStart", function(self) self:StartMoving() end)
|
||
|
frame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
|
||
|
|
||
|
frame:Hide()
|
||
|
|
||
|
frame.npcName = frame:CreateFontString("CzechQuestsTranslationSpeechNpcName", "OVERLAY")
|
||
|
frame.npcName:SetTextColor(1, 1, 0)
|
||
|
frame.npcName:SetFont(
|
||
|
CzechQuestsAddon.fontPath .. CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_NPC_FONT_FAMILY,
|
||
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_NPC_FONT_SIZE,
|
||
|
"OUTLINE"
|
||
|
)
|
||
|
frame.npcName:SetPoint("LEFT", frame, "LEFT", 0, 5)
|
||
|
|
||
|
frame.text = frame:CreateFontString("CzechQuestsTranslationSpeechText", "OVERLAY")
|
||
|
frame.text:SetTextColor(1, 1, 1)
|
||
|
frame.text:SetWordWrap(true)
|
||
|
frame.text:SetFont(
|
||
|
CzechQuestsAddon.fontPath .. CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY,
|
||
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE,
|
||
|
"OUTLINE"
|
||
|
)
|
||
|
frame.text:SetTextColor(1, 1, 1)
|
||
|
frame.text:SetWidth(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH)
|
||
|
frame.text:SetJustifyH("LEFT")
|
||
|
frame.text:SetJustifyV("TOP")
|
||
|
|
||
|
return frame;
|
||
|
end
|
||
|
|
||
|
function CzechQuestsAddon:UpdateTranslationSpeechFrameSettings()
|
||
|
-- Font
|
||
|
CzechQuestsAddon.translationSpeechFrame.npcName:SetFont(
|
||
|
CzechQuestsAddon.fontPath .. CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_NPC_FONT_FAMILY,
|
||
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_NPC_FONT_SIZE,
|
||
|
"OUTLINE"
|
||
|
)
|
||
|
CzechQuestsAddon.translationSpeechFrame.text:SetFont(
|
||
|
CzechQuestsAddon.fontPath .. CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY,
|
||
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE,
|
||
|
"OUTLINE"
|
||
|
)
|
||
|
|
||
|
-- Width
|
||
|
CzechQuestsAddon.translationSpeechFrame.text:SetWidth(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH)
|
||
|
CzechQuestsAddon.translationSpeechFrame:SetWidth(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH)
|
||
|
end
|