Commit 7d4b07c2 authored by Blazeflack's avatar Blazeflack

Added synchronization with DBM

When a clue is found it will now send a message to DBM so that users of DBM will see it on their info screen.
Additionally this addon will listen to clues sent from DBM users and will no longer announce a clue that was previously announced by a DBM user.
parent 3454fe84
......@@ -100,6 +100,29 @@ local clues = {
[AddOn.L.Pouch4] = "pouch"
}
local DBM_MOD
local function HandleDBM()
DBM_MOD = DBM:GetModByName("CoSTrash")
hooksecurefunc(DBM_MOD, "OnSync", function(self, msg, clue)
if msg == "CoS" and clue then
hints[clue] = true
end
end)
end
if IsAddOnLoaded("DBM-Party-Legion") then
HandleDBM()
else
local frame = CreateFrame("Frame")
frame:RegisterEvent("ADDON_LOADED")
frame:SetScript("OnEvent", function(self, event, addon)
if addon == "DBM-Party-Legion" then
self:UnregisterEvent(event)
HandleDBM()
end
end)
end
local function ResetSpyHints()
table_wipe(hints)
end
......@@ -142,6 +165,9 @@ local function HandleGossip()
CloseGossip()
SendChatMessage(hintTranslations[clue], (IsPartyLFG() and "INSTANCE_CHAT" or "PARTY"))
hints[clue] = true
if DBM_MOD then
DBM_MOD:SendSync("CoS", clue)
end
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment