Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Frames/MultiLanguageOptionsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ local function getDefaultOptions(optionsTranslations)
SELECTED_INTERACTION = 'hover',
AVAILABLE_INTERACTIONS = {
{value = 'hover', text = optionsTranslations["interactionModes"]["hover"]},
{value = 'hover-hotkey', optionsTranslations["interactionModes"]["hoverHotkey"]}
{value = 'hover-hotkey', optionsTranslations["interactionModes"]["hoverHotkey"]},
{value = 'always', text = optionsTranslations["interactionModes"]["always"]}
},
SELECTED_HOTKEY = nil
}
Expand Down
30 changes: 20 additions & 10 deletions Localization/Translations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ local function addonLoaded(self, event, addonLoadedName)
},
interactionModes = {
hover = "Hover",
["hover-hotkey"] = "Hover + hotkey"
["hover-hotkey"] = "Hover + hotkey",
always = "Always show"
}
}
}
Expand Down Expand Up @@ -73,7 +74,8 @@ local function addonLoaded(self, event, addonLoadedName)
},
interactionModes = {
hover = "Pasar el cursor",
["hover-hotkey"] = "Pasar el cursor + tecla de acceso rápido"
["hover-hotkey"] = "Pasar el cursor + tecla de acceso rápido",
always = "Mostrar siempre"
}
}
}
Expand Down Expand Up @@ -109,7 +111,8 @@ local function addonLoaded(self, event, addonLoadedName)
},
interactionModes = {
hover = "Hover",
["hover-hotkey"] = "Hover + Hotkey"
["hover-hotkey"] = "Hover + Hotkey",
always = "Immer anzeigen"
}
}
}
Expand Down Expand Up @@ -145,7 +148,8 @@ local function addonLoaded(self, event, addonLoadedName)
},
interactionModes = {
hover = "Survol",
["hover-hotkey"] = "Survol + raccourci clavier"
["hover-hotkey"] = "Survol + raccourci clavier",
always = "Toujours afficher"
}
}
}
Expand Down Expand Up @@ -181,7 +185,8 @@ local function addonLoaded(self, event, addonLoadedName)
},
interactionModes = {
hover = "Passar o mouse",
["hover-hotkey"] = "Passar o mouse + atalho"
["hover-hotkey"] = "Passar o mouse + atalho",
always = "Mostrar sempre"
}
}
}
Expand Down Expand Up @@ -217,7 +222,8 @@ local function addonLoaded(self, event, addonLoadedName)
},
interactionModes = {
hover = "Наведение",
["hover-hotkey"] = "Наведение + горячая клавиша"
["hover-hotkey"] = "Наведение + горячая клавиша",
always = "Всегда показывать"
}
}
}
Expand Down Expand Up @@ -253,7 +259,8 @@ local function addonLoaded(self, event, addonLoadedName)
},
interactionModes = {
hover = "悬停",
["hover-hotkey"] = "悬停 + 快捷键"
["hover-hotkey"] = "悬停 + 快捷键",
always = "始终显示"
}
}
}
Expand Down Expand Up @@ -289,7 +296,8 @@ local function addonLoaded(self, event, addonLoadedName)
},
interactionModes = {
hover = "마우스 오버",
["hover-hotkey"] = "마우스 오버 + 단축키"
["hover-hotkey"] = "마우스 오버 + 단축키",
always = "항상 표시"
}
}
}
Expand Down Expand Up @@ -325,7 +333,8 @@ local function addonLoaded(self, event, addonLoadedName)
},
interactionModes = {
hover = "Sostener",
["hover-hotkey"] = "Sostener + tecla de acceso rápido"
["hover-hotkey"] = "Sostener + tecla de acceso rápido",
always = "Mostrar siempre"
}
}
}
Expand Down Expand Up @@ -361,7 +370,8 @@ local function addonLoaded(self, event, addonLoadedName)
},
interactionModes = {
hover = "懸停",
["hover-hotkey"] = "懸停 + 快捷鍵"
["hover-hotkey"] = "懸停 + 快捷鍵",
always = "始終顯示"
}
}
}
Expand Down
37 changes: 33 additions & 4 deletions MultiLanguage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ local function SetQuestDetails(headerText, objectiveText, descriptionHeader, des
)
end

local function UpdateQuestTranslationFrame()
if QuestMapDetailsScrollFrame:IsShown() and QuestMapDetailsScrollFrame:IsMouseOver() then
function UpdateQuestTranslationFrame()
local isAlways = MultiLanguageOptions and MultiLanguageOptions.SELECTED_INTERACTION == "always"
if QuestMapDetailsScrollFrame:IsShown() and (isAlways or QuestMapDetailsScrollFrame:IsMouseOver()) then
local questID = C_QuestLog.GetSelectedQuest()

if not questID then
Expand Down Expand Up @@ -268,7 +269,7 @@ local function UpdateQuestTranslationFrame()
)
end

if QuestFrame:IsShown() and QuestFrame:IsMouseOver() then
if QuestFrame:IsShown() and (isAlways or QuestFrame:IsMouseOver()) then
local questID = GetQuestID()

if not questID then
Expand Down Expand Up @@ -345,7 +346,9 @@ local function SetQuestHoverScripts(frame, children)
end)

frame:SetScript("OnLeave", function()
QuestTranslationFrame:Hide()
if not (MultiLanguageOptions and MultiLanguageOptions.SELECTED_INTERACTION == "always") then
QuestTranslationFrame:Hide()
end
questFrameBeingHovered = false
end)

Expand Down Expand Up @@ -823,3 +826,29 @@ translationFrame:SetPropagateKeyboardInput(true)
SetQuestHoverScripts(QuestFrameDetailPanel, true)
SetQuestHoverScripts(QuestMapDetailsScrollFrame, false)
SetQuestHoverScripts(QuestFrame, false)

-- "Always show" interaction mode: auto-update quest translations
local alwaysModeFrame = CreateFrame("Frame")
alwaysModeFrame:RegisterEvent("QUEST_LOG_UPDATE")
alwaysModeFrame:SetScript("OnEvent", function()
if MultiLanguageOptions and MultiLanguageOptions.SELECTED_INTERACTION == "always"
and MultiLanguageOptions.QUEST_TRANSLATIONS
and QuestMapDetailsScrollFrame and QuestMapDetailsScrollFrame:IsShown() then
UpdateQuestTranslationFrame()
end
end)

QuestMapDetailsScrollFrame:HookScript("OnShow", function()
if MultiLanguageOptions and MultiLanguageOptions.SELECTED_INTERACTION == "always"
and MultiLanguageOptions.QUEST_TRANSLATIONS then
C_Timer.After(0.1, function()
UpdateQuestTranslationFrame()
end)
end
end)

QuestMapDetailsScrollFrame:HookScript("OnHide", function()
if MultiLanguageOptions and MultiLanguageOptions.SELECTED_INTERACTION == "always" then
QuestTranslationFrame:Hide()
end
end)