diff --git a/README.md b/README.md index 2e346aca..c8dfe602 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ pfUI will support and contain language specific code for the following languages * [HealComm](https://github.com/Aviana/HealComm/releases) * [WIM](http://addons.us.to/addon/wim), [WIM (continued)](https://github.com/shirsig/WIM) * [MobHealth3](http://addons.us.to/addon/mobhealth) +* [Clean_Up](https://github.com/shirsig/Clean_Up-lib) ## Installation (common) 1. Download from Github as Zip, unpack and rename the folder pfUI-master to pfUI. diff --git a/img/sort.tga b/img/sort.tga new file mode 100644 index 00000000..367f98d8 Binary files /dev/null and b/img/sort.tga differ diff --git a/modules/config.lua b/modules/config.lua index 09ec4823..34bde9ae 100644 --- a/modules/config.lua +++ b/modules/config.lua @@ -52,6 +52,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("thirdparty", "dpsmate", "enable", "1") pfUI:UpdateConfig("thirdparty", "wim", "enable", "1") pfUI:UpdateConfig("thirdparty", "healcomm","enable", "1") + pfUI:UpdateConfig("thirdparty", "cleanup", "enable", "1") pfUI:UpdateConfig("position", nil, nil, nil) pfUI:UpdateConfig("disabled", nil, nil, nil) end diff --git a/modules/gui.lua b/modules/gui.lua index 4e21497b..abc9633c 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -636,6 +636,7 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.thirdparty, "DPSMate:", pfUI_config.thirdparty.dpsmate, "enable", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.thirdparty, "WIM:", pfUI_config.thirdparty.wim, "enable", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.thirdparty, "HealComm:", pfUI_config.thirdparty.healcomm, "enable", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.thirdparty, "CleanUp:", pfUI_config.thirdparty.cleanup, "enable", "checkbox") -- [[ bottom section ]] -- diff --git a/modules/thirdparty.lua b/modules/thirdparty.lua index e47fc253..40a11585 100644 --- a/modules/thirdparty.lua +++ b/modules/thirdparty.lua @@ -1,4 +1,6 @@ pfUI:RegisterModule("thirdparty", function () + pfUI.thirdparty = {} + -- 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 @@ -274,4 +276,53 @@ pfUI:RegisterModule("thirdparty", function () end end) + + -- CleanUp Integration + -- Integrate CleanUp bag sorting into pfUI + if Clean_Up and pfUI_config.thirdparty.cleanup.enable == "1" then + pfUI.thirdparty.cleanup = CreateFrame("Frame", nil) + pfUI.thirdparty.cleanup:RegisterEvent("BAG_UPDATE") + pfUI.thirdparty.cleanup:SetScript("OnEvent", function() + -- make sure bagframe was already created + if not pfUI.bag or not pfUI.bag.right then return end + pfUI.thirdparty.cleanup:UnregisterAllEvents() + + -- draw the button + if not pfUI.bag.right.sort then + pfUI.bag.right.money:ClearAllPoints() + pfUI.bag.right.money:SetPoint("TOPRIGHT", pfUI.bag.right, "TOPRIGHT", -55, -6) + + pfUI.bag.right.sort = CreateFrame("Button", "pfBagSlotShow", UIParent) + pfUI.bag.right.sort:SetParent(pfUI.bag.right) + pfUI.bag.right.sort:SetPoint("TOPRIGHT", -pfUI_config.bars.border*2 - 45 , -pfUI_config.bars.border*2 ) + pfUI.bag.right.sort:SetBackdrop(pfUI.backdrop) + pfUI.bag.right.sort:SetHeight(15) + pfUI.bag.right.sort:SetWidth(15) + pfUI.bag.right.sort:SetTextColor(1,1,.25,1) + pfUI.bag.right.sort:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", pfUI_config.global.font_size, "OUTLINE") + pfUI.bag.right.sort.texture = pfUI.bag.right.sort:CreateTexture("pfBagArrowUp") + pfUI.bag.right.sort.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\sort") + pfUI.bag.right.sort.texture:ClearAllPoints() + pfUI.bag.right.sort.texture:SetPoint("TOPLEFT", pfUI.bag.right.sort, "TOPLEFT", 3, -3) + pfUI.bag.right.sort.texture:SetPoint("BOTTOMRIGHT", pfUI.bag.right.sort, "BOTTOMRIGHT", -3, 3) + pfUI.bag.right.sort.texture:SetVertexColor(.25,.25,.25,1) + + pfUI.bag.right.sort:SetScript("OnEnter", function () + pfUI.bag.right.sort:SetBackdrop(pfUI.backdrop_col) + pfUI.bag.right.sort:SetBackdropBorderColor(1,1,.25,1) + pfUI.bag.right.sort.texture:SetVertexColor(1,1,.25,1) + end) + + pfUI.bag.right.sort:SetScript("OnLeave", function () + pfUI.bag.right.sort:SetBackdrop(pfUI.backdrop) + pfUI.bag.right.sort:SetBackdropBorderColor(1,1,1,1) + pfUI.bag.right.sort.texture:SetVertexColor(.25,.25,.25,1) + end) + + pfUI.bag.right.sort:SetScript("OnClick", function() + Clean_Up("bags") + end) + end + end) + end end)