thirdparty: add support for latest dpsmate

This commit is contained in:
shagu
2017-02-26 19:31:26 +01:00
parent ec22ad33eb
commit 30693b66ca
+58 -46
View File
@@ -3,36 +3,43 @@ pfUI:RegisterModule("thirdparty", function ()
-- DPSMate Integration -- DPSMate Integration
-- Move DPSMate to right chat and let the chat-hide button toggle it -- Move DPSMate to right chat and let the chat-hide button toggle it
local function pfSetupDPSMate() if pfUI_config.thirdparty.dpsmate.enable == "1" then
-- set DPSMate appearance to match pfUI
DPSMateSettings["windows"][1]["titlebarheight"] = 18
DPSMateSettings["windows"][1]["titlebarfontsize"] = 12
DPSMateSettings["windows"][1]["titlebarfont"] = "Accidental Presidency"
DPSMateSettings["windows"][1]["titlebarbgcolor"][1] = 0
DPSMateSettings["windows"][1]["titlebarbgcolor"][2] = 0
DPSMateSettings["windows"][1]["titlebarbgcolor"][3] = 0
DPSMateSettings["windows"][1]["barheight"] = 15 local function pfDPSMateConfig()
DPSMateSettings["windows"][1]["barfontsize"] = 12 -- set DPSMate appearance to match pfUI
DPSMateSettings["windows"][1]["bartexture"] = "BantoBar" DPSMateSettings["windows"][1]["titlebarheight"] = 18
DPSMateSettings["windows"][1]["barfont"] = "Accidental Presidency" DPSMateSettings["windows"][1]["titlebarfontsize"] = 12
DPSMateSettings["windows"][1]["titlebarfont"] = "Accidental Presidency"
DPSMateSettings["windows"][1]["titlebarbgcolor"][1] = 0
DPSMateSettings["windows"][1]["titlebarbgcolor"][2] = 0
DPSMateSettings["windows"][1]["titlebarbgcolor"][3] = 0
DPSMateSettings["windows"][1]["bgopacity"] = 1 DPSMateSettings["windows"][1]["barheight"] = 15
DPSMateSettings["windows"][1]["opacity"] = 1 DPSMateSettings["windows"][1]["barfontsize"] = 12
DPSMateSettings["windows"][1]["contentbgtexture"] = "Solid Background" DPSMateSettings["windows"][1]["bartexture"] = "BantoBar"
DPSMateSettings["windows"][1]["contentbgcolor"][1] = 0 DPSMateSettings["windows"][1]["barfont"] = "Accidental Presidency"
DPSMateSettings["windows"][1]["contentbgcolor"][2] = 0
DPSMateSettings["windows"][1]["contentbgcolor"][3] = 0
DPSMateSettings["windows"][1]["contentbgcolor"][3] = 0
DPSMate_DPSMate:Hide() DPSMateSettings["windows"][1]["bgopacity"] = 1
DPSMateSettings["windows"][1]["borderopacity"] = 0
DPSMateSettings["windows"][1]["opacity"] = 1
DPSMateSettings["windows"][1]["contentbgtexture"] = "Solid Background"
DPSMateSettings["windows"][1]["contentbgcolor"][1] = 0
DPSMateSettings["windows"][1]["contentbgcolor"][2] = 0
DPSMateSettings["windows"][1]["contentbgcolor"][3] = 0
DPSMateSettings["windows"][1]["contentbgcolor"][3] = 0
if not pfUIhookDPSMate_Show then if pfUI.panel then
pfUIhookDPSMate_Show = DPSMate_DPSMate.Show pfUI.panel.right.hide:SetScript("OnClick", function()
if DPSMate_DPSMate:IsShown() then
DPSMate_DPSMate:Hide()
else
DPSMate_DPSMate:Show()
end
end)
end
end end
function DPSMate_DPSMate.Show ()
pfUIhookDPSMate_Show(DPSMate_DPSMate)
local function pfDPSMateToggle()
if pfUI.chat and pfUI.panel then if pfUI.chat and pfUI.panel then
DPSMate_DPSMate:ClearAllPoints() DPSMate_DPSMate:ClearAllPoints()
DPSMate_DPSMate:SetAllPoints(pfUI.chat.right) DPSMate_DPSMate:SetAllPoints(pfUI.chat.right)
@@ -49,30 +56,35 @@ pfUI:RegisterModule("thirdparty", function ()
end end
end end
if pfUI.panel then local pfHookDPSMate = CreateFrame("Frame", nil)
pfUI.panel.right.hide:SetScript("OnClick", function() pfHookDPSMate:RegisterEvent("VARIABLES_LOADED")
if DPSMate_DPSMate:IsShown() then pfHookDPSMate:SetScript("OnEvent",function()
DPSMate_DPSMate:Hide() if event == "VARIABLES_LOADED" then
else if DPSMate then
DPSMate_DPSMate:Show() pfHookDPSMate:UnregisterEvent("VARIABLES_LOADED")
end pfDPSMateConfig()
end)
end
end
if pfUI_config.thirdparty.dpsmate.enable == "1" then -- overwrite code (new)
if DPSMate_DPSMate then local pfDPSMateOnLoad = DPSMate.OnLoad
pfSetupDPSMate() function DPSMate:OnLoad()
else pfDPSMateOnLoad()
local pfHookDPSMate = CreateFrame("Frame", nil) pfDPSMateToggle()
pfHookDPSMate:RegisterEvent("VARIABLES_LOADED") DPSMate_DPSMate:Hide()
pfHookDPSMate:SetScript("OnEvent",function()
if DPSMate_DPSMate then
pfHookDPSMate:UnregisterEvent("VARIABLES_LOADED")
pfSetupDPSMate()
end end
end)
end -- overwrite code (old)
if DPSMate_DPSMate then
DPSMate_DPSMate:Hide()
local pfDPSMateOnShow = DPSMate_DPSMate.Show
function DPSMate_DPSMate.Show ()
pfDPSMateOnShow(DPSMate_DPSMate)
pfDPSMateToggle()
end
end
end
end
end)
end end
-- WIM Integration -- WIM Integration