diff --git a/modules/config.lua b/modules/config.lua index 3d9878ba..44ad9ccb 100644 --- a/modules/config.lua +++ b/modules/config.lua @@ -24,8 +24,9 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("panel", "right", "center", "time") pfUI:UpdateConfig("panel", "right", "right", "gold") pfUI:UpdateConfig("panel", "other", "minimap", "zone") - pfUI:UpdateConfig("castbar", "player", "hide_blizz", "1") + pfUI:UpdateConfig("castbar", "player", "hide_blizz", "1") pfUI:UpdateConfig("tooltip", nil, "position", "bottom") + pfUI:UpdateConfig("thirdparty", "dpsmate", "enable", "1") pfUI:UpdateConfig("position", nil, nil, nil) end @@ -52,4 +53,4 @@ function pfUI:UpdateConfig(group, subgroup, entry, value) pfUI:Debug("Creating Config in Subgroup (" .. subgroup .. "): " .. entry .. " with value " .. value) pfUI_config[group][subgroup][entry] = value end -end \ No newline at end of file +end diff --git a/modules/gui.lua b/modules/gui.lua index 897ff6ce..6449ae36 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -21,7 +21,9 @@ pfUI:RegisterModule("gui", function () end) function pfUI.gui.SwitchTab(frame) - local elements = { pfUI.gui.global, pfUI.gui.uf , pfUI.gui.bar, pfUI.gui.panel, pfUI.gui.tooltip, pfUI.gui.castbar } + local elements = { pfUI.gui.global, pfUI.gui.uf , pfUI.gui.bar, pfUI.gui.panel, pfUI.gui.tooltip, + pfUI.gui.castbar, pfUI.gui.thirdparty } + for _, hide in pairs(elements) do hide:Hide() end @@ -353,6 +355,38 @@ pfUI:RegisterModule("gui", function () pfUI.gui.castbar.title:SetFontObject(GameFontWhite) pfUI.gui.castbar.title:SetText("Castbar Settings") + -- Thirdparty settings + pfUI.gui.thirdparty = CreateFrame("Frame", nil, pfUI.gui) + pfUI.gui.thirdparty:SetWidth(400) + pfUI.gui.thirdparty:SetHeight(320) + + pfUI.gui.thirdparty:SetBackdrop(pfUI.backdrop) + pfUI.gui.thirdparty:SetBackdropColor(0,0,0,.50); + pfUI.gui.thirdparty:SetPoint("RIGHT",0,0) + + pfUI.gui.thirdparty.switch = CreateFrame("Button", nil, pfUI.gui) + pfUI.gui.thirdparty.switch:ClearAllPoints() + pfUI.gui.thirdparty.switch:SetWidth(80) + pfUI.gui.thirdparty.switch:SetHeight(20) + pfUI.gui.thirdparty.switch:SetPoint("TOPLEFT", 0, -120) + pfUI.gui.thirdparty.switch:SetBackdrop(pfUI.backdrop) + pfUI.gui.thirdparty.switch.text = pfUI.gui.thirdparty.switch:CreateFontString("Status", "LOW", "GameFontNormal") + pfUI.gui.thirdparty.switch.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", pfUI_config.global.font_size, "OUTLINE") + pfUI.gui.thirdparty.switch.text:ClearAllPoints() + pfUI.gui.thirdparty.switch.text:SetAllPoints(pfUI.gui.thirdparty.switch) + pfUI.gui.thirdparty.switch.text:SetPoint("CENTER", 0, 0) + pfUI.gui.thirdparty.switch.text:SetFontObject(GameFontWhite) + pfUI.gui.thirdparty.switch.text:SetText("Thirdparty") + pfUI.gui.thirdparty.switch:SetScript("OnClick", function() + pfUI.gui.SwitchTab(pfUI.gui.thirdparty) + end) + + pfUI.gui.thirdparty.title = pfUI.gui.thirdparty:CreateFontString("Status", "LOW", "GameFontNormal") + pfUI.gui.thirdparty.title:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", pfUI_config.global.font_size + 2, "OUTLINE") + pfUI.gui.thirdparty.title:SetPoint("TOP", 0, -10) + pfUI.gui.thirdparty.title:SetFontObject(GameFontWhite) + pfUI.gui.thirdparty.title:SetText("Thirdparty Addons") + -- Reset Frames pfUI.gui.resetFrames = CreateFrame("Button", nil, pfUI.gui) pfUI.gui.resetFrames:ClearAllPoints() @@ -485,4 +519,7 @@ pfUI:RegisterModule("gui", function () -- castbar pfUI.gui.CreateConfig(pfUI.gui.castbar, "Hide blizzards castbar:", pfUI_config.castbar.player, "hide_blizz") + -- thirdparty + pfUI.gui.CreateConfig(pfUI.gui.thirdparty, "DPSMate:", pfUI_config.thirdparty.dpsmate, "enable") + end) diff --git a/modules/thirdparty.lua b/modules/thirdparty.lua new file mode 100644 index 00000000..61b56a86 --- /dev/null +++ b/modules/thirdparty.lua @@ -0,0 +1,30 @@ +pfUI:RegisterModule("thirdparty", function () + -- DPSMate Integration + -- Move DPSMate to right chat and let the chat-hide button toggle it + if DPSMate and pfUI_config.thirdparty.dpsmate.enable == "1" then + DPSMate_DPSMate:Hide() + + pfUIhookDPSMate_Show = DPSMate_DPSMate.Show + function DPSMate_DPSMate.Show () + pfUIhookDPSMate_Show(DPSMate_DPSMate) + DPSMate_DPSMate:SetAllPoints(pfUI.chat.right) + DPSMate_DPSMate:ClearAllPoints() + DPSMate_DPSMate:SetPoint("TOPLEFT", pfUI.chat.right, "TOPLEFT", 3, -3) + DPSMate_DPSMate:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", -3, 3) + + if DPSMate_DPSMate_ScrollFrame then + DPSMate_DPSMate_ScrollFrame:SetPoint("TOPLEFT", pfUI.chat.right, "TOPLEFT", 3, -23) + DPSMate_DPSMate_ScrollFrame:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", -3, 3) + end + end + + pfUI.panel.right.hide:SetScript("OnClick", function() + if DPSMate_DPSMate:IsShown() then + DPSMate_DPSMate:Hide() + else + DPSMate_DPSMate:Show() + end + end) + + end +end) diff --git a/pfUI.toc b/pfUI.toc index e344e70b..22bee737 100644 --- a/pfUI.toc +++ b/pfUI.toc @@ -43,3 +43,4 @@ modules\bags.lua modules\cooldown.lua modules\tooltip.lua modules\uf_tukui.lua +modules\thirdparty.lua