diff --git a/modules/gui.lua b/modules/gui.lua index a92c2f16..f5560a68 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -147,6 +147,7 @@ pfUI:RegisterModule("gui", function () frame.drag:SetBackdrop(pfUI.backdrop_col) frame.drag:SetBackdropBorderColor(.2, 1, .8) frame.drag:SetBackdropColor(1,1,1,.75) + frame.drag:EnableMouseWheel(1) frame.drag.text = frame.drag:CreateFontString("Status", "LOW", "GameFontNormal") frame.drag.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", pfUI_config.global.font_size, "OUTLINE") frame.drag.text:ClearAllPoints() @@ -155,6 +156,28 @@ pfUI:RegisterModule("gui", function () frame.drag.text:SetFontObject(GameFontWhite) frame.drag.text:SetText(strsub(frame:GetName(),3)) frame.drag:SetAlpha(1) + + frame.drag:SetScript("OnMouseWheel", function() + local scale = round(frame:GetScale() + arg1/10, 1) + frame:SetScale(scale) + + if not pfUI_config.position[frame:GetName()] then + pfUI_config.position[frame:GetName()] = {} + end + pfUI_config.position[frame:GetName()]["scale"] = scale + + frame.drag.text:SetText("Scale: " .. scale) + frame.drag.text:SetAlpha(1) + + frame.drag:SetScript("OnUpdate", function() + this.text:SetAlpha(this.text:GetAlpha() -0.05) + if this.text:GetAlpha() < 0.1 then + this.text:SetText(strsub(this:GetParent():GetName(),3)) + this.text:SetAlpha(1) + this:SetScript("OnUpdate", function() return end) + end + end) + end) end frame.drag:SetScript("OnMouseDown",function() diff --git a/pfUI.lua b/pfUI.lua index 4aef0d5b..decaaee4 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -83,8 +83,14 @@ pfUI.utils = CreateFrame("Frame",nil,UIParent) function pfUI.utils:loadPosition(frame) if pfUI_config["position"][frame:GetName()] then - frame:ClearAllPoints() - frame:SetPoint("TOPLEFT", pfUI_config["position"][frame:GetName()].xpos, pfUI_config["position"][frame:GetName()].ypos) + if pfUI_config["position"][frame:GetName()]["scale"] then + frame:SetScale(pfUI_config["position"][frame:GetName()].scale) + end + + if pfUI_config["position"][frame:GetName()]["xpos"] then + frame:ClearAllPoints() + frame:SetPoint("TOPLEFT", pfUI_config["position"][frame:GetName()].xpos, pfUI_config["position"][frame:GetName()].ypos) + end end end