enable scaling of all movables

This commit is contained in:
shagu
2016-11-06 17:22:32 +01:00
parent 7c7cc282e0
commit 4fcb3076aa
2 changed files with 31 additions and 2 deletions
+23
View File
@@ -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()
+8 -2
View File
@@ -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