mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 05:50:50 +00:00
enable scaling of all movables
This commit is contained in:
@@ -147,6 +147,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
frame.drag:SetBackdrop(pfUI.backdrop_col)
|
frame.drag:SetBackdrop(pfUI.backdrop_col)
|
||||||
frame.drag:SetBackdropBorderColor(.2, 1, .8)
|
frame.drag:SetBackdropBorderColor(.2, 1, .8)
|
||||||
frame.drag:SetBackdropColor(1,1,1,.75)
|
frame.drag:SetBackdropColor(1,1,1,.75)
|
||||||
|
frame.drag:EnableMouseWheel(1)
|
||||||
frame.drag.text = frame.drag:CreateFontString("Status", "LOW", "GameFontNormal")
|
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:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", pfUI_config.global.font_size, "OUTLINE")
|
||||||
frame.drag.text:ClearAllPoints()
|
frame.drag.text:ClearAllPoints()
|
||||||
@@ -155,6 +156,28 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
frame.drag.text:SetFontObject(GameFontWhite)
|
frame.drag.text:SetFontObject(GameFontWhite)
|
||||||
frame.drag.text:SetText(strsub(frame:GetName(),3))
|
frame.drag.text:SetText(strsub(frame:GetName(),3))
|
||||||
frame.drag:SetAlpha(1)
|
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
|
end
|
||||||
|
|
||||||
frame.drag:SetScript("OnMouseDown",function()
|
frame.drag:SetScript("OnMouseDown",function()
|
||||||
|
|||||||
@@ -83,8 +83,14 @@ pfUI.utils = CreateFrame("Frame",nil,UIParent)
|
|||||||
|
|
||||||
function pfUI.utils:loadPosition(frame)
|
function pfUI.utils:loadPosition(frame)
|
||||||
if pfUI_config["position"][frame:GetName()] then
|
if pfUI_config["position"][frame:GetName()] then
|
||||||
frame:ClearAllPoints()
|
if pfUI_config["position"][frame:GetName()]["scale"] then
|
||||||
frame:SetPoint("TOPLEFT", pfUI_config["position"][frame:GetName()].xpos, pfUI_config["position"][frame:GetName()].ypos)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user