diff --git a/api/config.lua b/api/config.lua index e76d556f..da321758 100644 --- a/api/config.lua +++ b/api/config.lua @@ -656,6 +656,8 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("thirdparty", "myroleplay", "enable", "1") pfUI:UpdateConfig("thirdparty", "druidmana", "enable", "1") pfUI:UpdateConfig("thirdparty", "noteit", "enable", "1") + pfUI:UpdateConfig("thirdparty", "recount", "skin", "1") + pfUI:UpdateConfig("thirdparty", "recount", "dock", "1") pfUI:UpdateConfig("position", nil, nil, nil) pfUI:UpdateConfig("disabled", nil, nil, nil) diff --git a/modules/gui.lua b/modules/gui.lua index bcef7233..4aead6fe 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2079,6 +2079,8 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(nil, T["Use Chat Colors for Meters"], C.thirdparty, "chatbg", "checkbox") CreateConfig(nil, "DPSMate (" .. T["Skin"] .. ")", C.thirdparty.dpsmate, "skin", "checkbox") CreateConfig(nil, "DPSMate (" .. T["Dock"] .. ")", C.thirdparty.dpsmate, "dock", "checkbox") + CreateConfig(nil, "Recount (" .. T["Skin"] .. ")", C.thirdparty.recount, "skin", "checkbox", nil, nil, nil, nil, "tbc") + CreateConfig(nil, "Recount (" .. T["Dock"] .. ")", C.thirdparty.recount, "dock", "checkbox", nil, nil, nil, nil, "tbc") CreateConfig(nil, "SWStats (" .. T["Skin"] .. ")", C.thirdparty.swstats, "skin", "checkbox", nil, nil, nil, nil, "vanilla") CreateConfig(nil, "SWStats (" .. T["Dock"] .. ")", C.thirdparty.swstats, "dock", "checkbox", nil, nil, nil, nil, "vanilla") CreateConfig(nil, "KLH Threat Meter (" .. T["Skin"] .. ")", C.thirdparty.ktm, "skin", "checkbox", nil, nil, nil, nil, "vanilla") diff --git a/modules/thirdparty-tbc.lua b/modules/thirdparty-tbc.lua index db3a66c5..7fa8a79f 100644 --- a/modules/thirdparty-tbc.lua +++ b/modules/thirdparty-tbc.lua @@ -2,4 +2,67 @@ pfUI:RegisterModule("thirdparty-tbc", "tbc", function () -- abort when thirdparty core module is not loaded if not pfUI.thirdparty then return end local rawborder, default_border = GetBorderSize() + + HookAddonOrVariable("Recount", function() + local docktable = { "recount", "Recount", "Recount_MainWindow", + function() -- single + Recount.MainWindow:ClearAllPoints() + Recount.MainWindow:SetPoint("TOPLEFT", pfUI.chat.right, "TOPLEFT", 0, 10) + Recount.MainWindow:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", 0, 18) + Recount.MainWindow:SetWidth(pfUI.chat.right:GetWidth()) + end, + function() -- dual + Recount.MainWindow:ClearAllPoints() + Recount.MainWindow:SetPoint("TOPLEFT", pfUI.chat.right, "TOP", 0, 10) + Recount.MainWindow:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", 0, 18) + Recount.MainWindow:SetWidth(pfUI.chat.right:GetWidth() / 2) + end, + function() -- show + Recount.MainWindow:Show() + Recount:ResizeMainWindow() + Recount:RefreshMainWindow() + end, + function() -- hide + Recount.MainWindow:Hide() + end, + function() -- once + local hookResize = Recount.ResizeMainWindow + Recount.ResizeMainWindow = function() + hookResize() + + local a, b, c = Recount.MainWindow:GetPoint() + if b == pfUI.chat.right and Recount.MainWindow.backdrop then + Recount.MainWindow.backdrop:SetPoint("BOTTOMRIGHT", default_border, -18-default_border) + else + Recount.MainWindow.backdrop:SetPoint("BOTTOMRIGHT", default_border, default_border) + end + end + end, + } + + pfUI.thirdparty.meters:RegisterMeter("damage", docktable) + + if C.thirdparty.recount.skin == "1" then + if Recount_MainWindow then + StripTextures(Recount.MainWindow) + CreateBackdrop(Recount.MainWindow, nil, nil, (C.thirdparty.chatbg == "1" and .8)) + CreateBackdropShadow(Recount.MainWindow) + SkinScrollbar(Recount_MainWindow_ScrollBarScrollBar) + Recount_MainWindow_ScrollBarScrollBarScrollUpButton.Overlay:SetTexture(nil) + Recount_MainWindow_ScrollBarScrollBarScrollDownButton.Overlay:SetTexture(nil) + Recount.MainWindow.DragBottomLeft:SetNormalTexture(nil) + Recount.MainWindow.DragBottomRight:SetNormalTexture(nil) + + -- backdrop adjustments + Recount.MainWindow.backdrop:SetPoint("TOPLEFT", -default_border, -5-default_border) + if C.thirdparty.chatbg == "1" and C.chat.global.custombg == "1" then + local r, g, b, a = strsplit(",", C.chat.global.background) + Recount.MainWindow.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) + + local r, g, b, a = strsplit(",", C.chat.global.border) + Recount.MainWindow.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) + end + end + end + end) end)