CoA: route item/spell/NPC/quest links to db.exil.es
db.exil.es is the CoA-aware item/spell DB; Wowhead doesn't know about CoA's custom classes, spells, or worldforged items. Achievements aren't indexed on db.exil.es yet, so those still go to Wowhead. - item/spell/npc/quest URLs now use path syntax (db.exil.es/item/<id>). - Fallback search routes to /items?q=… instead of Wowhead's /search. - WowheadLinkComments toggle is now a no-op for db.exil.es URLs (no comments there); it still works for the achievement fallback.
This commit is contained in:
+20
-68
@@ -1413,31 +1413,10 @@ function LeaPlusLC:Isolated()
|
||||
end
|
||||
end)
|
||||
|
||||
-- Get localised Wowhead URL
|
||||
local wowheadLoc
|
||||
if GameLocale == "deDE" then
|
||||
wowheadLoc = "wowhead.com/wotlk/de"
|
||||
elseif GameLocale == "esMX" then
|
||||
wowheadLoc = "wowhead.com/wotlk/es"
|
||||
elseif GameLocale == "esES" then
|
||||
wowheadLoc = "wowhead.com/wotlk/es"
|
||||
elseif GameLocale == "frFR" then
|
||||
wowheadLoc = "wowhead.com/wotlk/fr"
|
||||
elseif GameLocale == "itIT" then
|
||||
wowheadLoc = "wowhead.com/wotlk/it"
|
||||
elseif GameLocale == "ptBR" then
|
||||
wowheadLoc = "wowhead.com/wotlk/pt"
|
||||
elseif GameLocale == "ruRU" then
|
||||
wowheadLoc = "wowhead.com/wotlk/ru"
|
||||
elseif GameLocale == "koKR" then
|
||||
wowheadLoc = "wowhead.com/wotlk/ko"
|
||||
elseif GameLocale == "zhCN" then
|
||||
wowheadLoc = "wowhead.com/wotlk/cn"
|
||||
elseif GameLocale == "zhTW" then
|
||||
wowheadLoc = "wowhead.com/wotlk/cn"
|
||||
else
|
||||
wowheadLoc = "wowhead.com/wotlk"
|
||||
end
|
||||
-- CoA: use db.exil.es (self-hosted CoA-aware DB) for item/spell/npc/quest links.
|
||||
-- Achievements aren't on db.exil.es, so fall back to Wowhead for those only.
|
||||
local wowheadLoc = "db.exil.es"
|
||||
local achievementHost = "wowhead.com/wotlk"
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- Achievements frame
|
||||
@@ -1480,9 +1459,9 @@ function LeaPlusLC:Isolated()
|
||||
if achievementID then
|
||||
-- Set editbox text
|
||||
if LeaPlusLC["WowheadLinkComments"] == "On" then
|
||||
aEB:SetText("https://" .. wowheadLoc .. "/achievement=" .. achievementID .. "#comments")
|
||||
aEB:SetText("https://" .. achievementHost .. "/achievement=" .. achievementID .. "#comments")
|
||||
else
|
||||
aEB:SetText("https://" .. wowheadLoc .. "/achievement=" .. achievementID)
|
||||
aEB:SetText("https://" .. achievementHost .. "/achievement=" .. achievementID)
|
||||
end
|
||||
lastAchievementLink = aEB:GetText()
|
||||
-- Set hidden fontstring then resize editbox to match
|
||||
@@ -1588,12 +1567,8 @@ function LeaPlusLC:Isolated()
|
||||
mEB:Show()
|
||||
end
|
||||
|
||||
-- Set editbox text
|
||||
if LeaPlusLC["WowheadLinkComments"] == "On" then
|
||||
mEB:SetText("https://" .. wowheadLoc .. "/quest=" .. questID .. "#comments")
|
||||
else
|
||||
mEB:SetText("https://" .. wowheadLoc .. "/quest=" .. questID)
|
||||
end
|
||||
-- Set editbox text (db.exil.es has no /quest comments, so the toggle is a no-op here)
|
||||
mEB:SetText("https://" .. wowheadLoc .. "/quest/" .. questID)
|
||||
|
||||
-- Set hidden fontstring then resize editbox to match
|
||||
mEB.z:SetText(mEB:GetText())
|
||||
@@ -18470,32 +18445,9 @@ function LeaPlusLC:SlashFunc(str)
|
||||
end) :gsub(" ", "+")
|
||||
end
|
||||
|
||||
-- Show web link
|
||||
-- Show web link (CoA: db.exil.es, see header for rationale)
|
||||
if not LeaPlusLC.WowheadLock then
|
||||
-- Set Wowhead link prefix
|
||||
if GameLocale == "deDE" then
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk/de"
|
||||
elseif GameLocale == "esMX" then
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk/es"
|
||||
elseif GameLocale == "esES" then
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk/es"
|
||||
elseif GameLocale == "frFR" then
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk/fr"
|
||||
elseif GameLocale == "itIT" then
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk/it"
|
||||
elseif GameLocale == "ptBR" then
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk/pt"
|
||||
elseif GameLocale == "ruRU" then
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk/ru"
|
||||
elseif GameLocale == "koKR" then
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk/ko"
|
||||
elseif GameLocale == "zhCN" then
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk/cn"
|
||||
elseif GameLocale == "zhTW" then
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk/cn"
|
||||
else
|
||||
LeaPlusLC.WowheadLock = "wowhead.com/wotlk"
|
||||
end
|
||||
LeaPlusLC.WowheadLock = "db.exil.es"
|
||||
end
|
||||
-- Store frame under mouse
|
||||
local mouseFocus = GetMouseFocus()
|
||||
@@ -18513,7 +18465,7 @@ function LeaPlusLC:SlashFunc(str)
|
||||
if itemLink then
|
||||
local itemID = itemLink:match("item:(%d+):")
|
||||
if itemID then
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/item=" .. itemID, false)
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/item/" .. itemID, false)
|
||||
LeaPlusLC.FactoryEditBox.f:SetText(L["Item"] .. ": " .. itemLink .. " (" .. itemID .. ")")
|
||||
return
|
||||
end
|
||||
@@ -18521,7 +18473,7 @@ function LeaPlusLC:SlashFunc(str)
|
||||
-- Spell
|
||||
local name, void, spellID = tooltip:GetSpell()
|
||||
if name and spellID then
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell=" .. spellID, false)
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell/" .. spellID, false)
|
||||
LeaPlusLC.FactoryEditBox.f:SetText(L["Spell"] .. ": " .. name .. " (" .. spellID .. ")")
|
||||
return
|
||||
end
|
||||
@@ -18531,7 +18483,7 @@ function LeaPlusLC:SlashFunc(str)
|
||||
if npcName and npcGuid then
|
||||
local void, void, void, void, void, npcID = strsplit("-", npcGuid)
|
||||
if npcID then
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/npc=" .. npcID, false)
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/npc/" .. npcID, false)
|
||||
LeaPlusLC.FactoryEditBox.f:SetText(L["NPC"] .. ": " .. npcName .. " (" .. npcID .. ")")
|
||||
return
|
||||
end
|
||||
@@ -18541,7 +18493,7 @@ function LeaPlusLC:SlashFunc(str)
|
||||
if _G["BuffButton" .. i] and mouseFocus == _G["BuffButton" .. i] then
|
||||
local spellName, void, void, void, void, void, void, void, void, void, spellID = UnitBuff("player", i)
|
||||
if spellName and spellID then
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell=" .. spellID, false)
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell/" .. spellID, false)
|
||||
LeaPlusLC.FactoryEditBox.f:SetText(L["Spell"] .. ": " .. spellName .. " (" .. spellID .. ")")
|
||||
end
|
||||
return
|
||||
@@ -18551,7 +18503,7 @@ function LeaPlusLC:SlashFunc(str)
|
||||
if _G["DebuffButton" .. i] and mouseFocus == _G["DebuffButton" .. i] then
|
||||
local spellName, void, void, void, void, void, void, void, void, void, spellID = UnitDebuff("player", i)
|
||||
if spellName and spellID then
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell=" .. spellID, false)
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell/" .. spellID, false)
|
||||
LeaPlusLC.FactoryEditBox.f:SetText(L["Spell"] .. ": " .. spellName .. " (" .. spellID .. ")")
|
||||
end
|
||||
return
|
||||
@@ -18563,7 +18515,7 @@ function LeaPlusLC:SlashFunc(str)
|
||||
if _G["TargetFrameBuff" .. i] and mouseFocus == _G["TargetFrameBuff" .. i] then
|
||||
local spellName, void, void, void, void, void, void, void, void, void, spellID = UnitBuff("target", i)
|
||||
if spellName and spellID then
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell=" .. spellID, false)
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell/" .. spellID, false)
|
||||
LeaPlusLC.FactoryEditBox.f:SetText(L["Spell"] .. ": " .. spellName .. " (" .. spellID .. ")")
|
||||
end
|
||||
return
|
||||
@@ -18573,7 +18525,7 @@ function LeaPlusLC:SlashFunc(str)
|
||||
if _G["TargetFrameDebuff" .. i] and mouseFocus == _G["TargetFrameDebuff" .. i] then
|
||||
local spellName, void, void, void, void, void, void, void, void, void, spellID = UnitDebuff("target", i)
|
||||
if spellName and spellID then
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell=" .. spellID, false)
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell/" .. spellID, false)
|
||||
LeaPlusLC.FactoryEditBox.f:SetText(L["Spell"] .. ": " .. spellName .. " (" .. spellID .. ")")
|
||||
end
|
||||
return
|
||||
@@ -18585,7 +18537,7 @@ function LeaPlusLC:SlashFunc(str)
|
||||
-- if _G["FocusFrameDebuff" .. i] and mouseFocus == _G["FocusFrameDebuff" .. i] then
|
||||
-- local spellName, void, void, void, void, void, void, void, void, void, spellID = UnitDebuff("focus", i)
|
||||
-- if spellName and spellID then
|
||||
-- LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell=" .. spellID, false)
|
||||
-- LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/spell/" .. spellID, false)
|
||||
-- LeaPlusLC.FactoryEditBox.f:SetText(L["Spell"] .. ": " .. spellName .. " (" .. spellID .. ")")
|
||||
-- end
|
||||
-- return
|
||||
@@ -18604,8 +18556,8 @@ function LeaPlusLC:SlashFunc(str)
|
||||
end
|
||||
if not unitFocus or not UnitIsPlayer(unitFocus) then
|
||||
tipTitle = tipTitle:gsub("|c%x%x%x%x%x%x%x%x", ""):gsub("|r", "")
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/search?q=" .. urlencode(tipTitle), false)
|
||||
LeaPlusLC.FactoryEditBox.f:SetText("|cffff0000" .. L["Link will search Wowhead"])
|
||||
LeaPlusLC:ShowSystemEditBox("https://" .. LeaPlusLC.WowheadLock .. "/items?q=" .. urlencode(tipTitle), false)
|
||||
LeaPlusLC.FactoryEditBox.f:SetText("|cffff0000" .. L["Link will search db.exil.es"])
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user