diff --git a/api/ui-widgets.lua b/api/ui-widgets.lua index 46bc7fc0..561092a0 100644 --- a/api/ui-widgets.lua +++ b/api/ui-widgets.lua @@ -895,8 +895,7 @@ function pfUI.api.SkinDropDown(frame, cr, cg, cb, useSmall) CreateBackdrop(button) button.backdrop:ClearAllPoints() - button.backdrop:SetWidth(18) - button.backdrop:SetHeight(18) + button.backdrop:SetSize(18, 18) button.backdrop:SetPoint("RIGHT", frame.backdrop, "RIGHT", -2, 0) if not button.icon then diff --git a/api/unitframes.lua b/api/unitframes.lua index 8e70a6ba..2d032ef1 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -397,8 +397,7 @@ function pfUI.uf:UpdateConfig() f.power:ClearAllPoints() f.power:SetPoint(f.config.panchor, f.hp, relative_point, f.config.poffx, -2 * default_border - spacing + f.config.poffy * GetPerfectPixel()) - f.power:SetWidth((f.config.pwidth ~= "-1" and f.config.pwidth or f.config.width)) - f.power:SetHeight(f.config.pheight) + f.power:SetSize((f.config.pwidth ~= "-1" and f.config.pwidth or f.config.width), f.config.pheight) if tonumber(f.config.pheight) < 0 then f.power:Hide() end pfUI.api.CreateBackdrop(f.power, default_border) @@ -790,8 +789,7 @@ function pfUI.uf:UpdateConfig() f.debuffs[i]:SetFrameLevel(12) f.debuffs[i]:RegisterForClicks("RightButtonUp") f.debuffs[i]:ClearAllPoints() - f.debuffs[i]:SetWidth(f.config.debuffsize) - f.debuffs[i]:SetHeight(f.config.debuffsize) + f.debuffs[i]:SetSize(f.config.debuffsize, f.config.debuffsize) f.debuffs[i]:SetNormalTexture(nil) -- Create CD frame if it doesn't exist @@ -1782,8 +1780,7 @@ function pfUI.uf:RefreshUnit(unit, component) if size ~= indicator.size or disptype ~= indicator.disp or indipos ~= indicator.ipos then indicator:ClearAllPoints() indicator:SetPoint(indipos, 0, 0) - indicator:SetHeight(size) - indicator:SetWidth(size) + indicator:SetSize(size, size) indicator.size = size indicator.disp = disptype indicator.ipos = indipos @@ -1812,16 +1809,14 @@ function pfUI.uf:RefreshUnit(unit, component) indicator[debuff].tex:SetVertexColor(dispelColor:GetRGBA()) indicator[debuff].tex:Show() indicator[debuff]:ClearAllPoints() - indicator[debuff]:SetHeight(size) - indicator[debuff]:SetWidth(size) + indicator[debuff]:SetSize(size, size) indicator[debuff]:SetBackdrop(nil) elseif disptype == "3" then indicator[debuff].tex:SetTexture(dispelColor:GetRGBA()) indicator[debuff].tex:SetVertexColor(1,1,1,1) indicator[debuff].tex:Show() indicator[debuff]:ClearAllPoints() - indicator[debuff]:SetHeight(size) - indicator[debuff]:SetWidth(size) + indicator[debuff]:SetSize(size, size) indicator[debuff]:SetBackdrop(nil) elseif disptype == "2" then indicator[debuff].tex:Hide() @@ -2270,8 +2265,7 @@ function pfUI.uf:AddIcon(frame, pos, icon, timeleft, stacks, start, duration) -- update icon configuration if frame.icon[pos].iconsize ~= iconsize or frame.icon[pos].spacing ~= spacing then - frame.icon[pos]:SetWidth(iconsize) - frame.icon[pos]:SetHeight(iconsize) + frame.icon[pos]:SetSize(iconsize, iconsize) frame.icon[pos]:SetPoint("TOPLEFT", frame.icon, "TOPLEFT", (pos-1)*(iconsize + spacing), 0) frame.icon[pos].stacks:SetFont(pfUI.font_unit, math.max(iconsize/3, 10), "OUTLINE") frame.icon[pos].iconsize = iconsize diff --git a/modules/actionbar.lua b/modules/actionbar.lua index e2173e0a..7905b294 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -168,8 +168,7 @@ pfUI:RegisterModule("actionbar", function () ["zoomfade"] = function() if this.active == 0 then -- init animation - this:SetWidth(this.parent:GetWidth()) - this:SetHeight(this.parent:GetHeight()) + this:SetSize(this.parent:GetSize()) this:SetScale(this.parent:GetScale()) this.tex:SetTexture(this.parent.icon:GetTexture()) this.tex:SetVertexColor(this.parent.icon:GetVertexColor()) @@ -191,8 +190,7 @@ pfUI:RegisterModule("actionbar", function () ["shrinkreturn"] = function() if this.active == 0 then -- init animation - this:SetWidth(this.parent:GetWidth()) - this:SetHeight(this.parent:GetHeight()) + this:SetSize(this.parent:GetSize()) this:SetScale(this.parent:GetScale()) this.tex:SetTexture(this.parent.icon:GetTexture()) this.tex:SetVertexColor(this.parent.icon:GetVertexColor()) @@ -218,8 +216,7 @@ pfUI:RegisterModule("actionbar", function () ["elasticzoom"] = function() if this.active == 0 then -- init animation - this:SetWidth(this.parent:GetWidth()) - this:SetHeight(this.parent:GetHeight()) + this:SetSize(this.parent:GetSize()) this:SetScale(this.parent:GetScale()) this.tex:SetTexture(this.parent.icon:GetTexture()) this.tex:SetVertexColor(this.parent.icon:GetVertexColor()) @@ -245,8 +242,7 @@ pfUI:RegisterModule("actionbar", function () ["wobblezoom"] = function() if this.active == 0 then -- init animation - this:SetWidth(this.parent:GetWidth()) - this:SetHeight(this.parent:GetHeight()) + this:SetSize(this.parent:GetSize()) this:SetScale(this.parent:GetScale()) this.tex:SetTexture(this.parent.icon:GetTexture()) this.tex:SetVertexColor(this.parent.icon:GetVertexColor()) @@ -1176,8 +1172,7 @@ pfUI:RegisterModule("actionbar", function () -- general appearance f.showempty = showempty == "1" and true or nil - f:SetHeight(size) - f:SetWidth(size) + f:SetSize(size, size) CreateBackdrop(f, border) return f @@ -1349,8 +1344,7 @@ pfUI:RegisterModule("actionbar", function () -- adjust actionbar size BarLayoutSize(bars[i], buttons, formfactor, size, border, spacing, uneven, fillmode) - bars[i]:SetWidth(bars[i]._size[1]) - bars[i]:SetHeight(bars[i]._size[2]) + bars[i]:SetSize(bars[i]._size[1], bars[i]._size[2]) bars[i]:ClearAllPoints() if i == 1 then -- main bars[i]:SetPoint("BOTTOM", 0, 2*border) diff --git a/modules/addonbuttons.lua b/modules/addonbuttons.lua index 431c03ad..0f70a913 100644 --- a/modules/addonbuttons.lua +++ b/modules/addonbuttons.lua @@ -37,15 +37,10 @@ pfUI:RegisterModule("addonbuttons", function () pfUI.addonbuttons.minimapbutton = CreateFrame("Button", "pfMinimapButton", pfUI.minimap or UIParent) pfUI.addonbuttons.minimapbutton:SetFrameLevel(24) - pfUI.addonbuttons.minimapbutton:SetWidth(12) - pfUI.addonbuttons.minimapbutton:SetHeight(12) + pfUI.addonbuttons.minimapbutton:SetSize(12, 12) pfUI.addonbuttons.minimapbutton:SetScript("OnClick", function() - if pfUI.addonbuttons:IsShown() then - pfUI.addonbuttons:Hide() - else - pfUI.addonbuttons:Show() - end + pfUI.addonbuttons:SetShown(not pfUI.addonbuttons:IsShown()) end) pfUI.addonbuttons.buttons = {} @@ -163,27 +158,25 @@ pfUI:RegisterModule("addonbuttons", function () pfUI.addonbuttons:SetScale(pfUI.minimap:GetScale()) pfUI.addonbuttons.minimapbutton:ClearAllPoints() + local mbtnWidth, mbtnHeight = pfUI.minimap:GetSize() + local dynamicSize = ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing) if C.abuttons.position == "bottom" then - pfUI.addonbuttons:SetWidth(pfUI.minimap:GetWidth()) - pfUI.addonbuttons:SetHeight(ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing)) + pfUI.addonbuttons:SetSize(mbtnWidth, dynamicSize) pfUI.addonbuttons:SetPoint("TOP", pfUI.minimap, "BOTTOM", 0 , -default_border * 3) SkinArrowButton(pfUI.addonbuttons.minimapbutton, "down") pfUI.addonbuttons.minimapbutton:SetPoint("BOTTOM", pfUI.minimap, "BOTTOM", 0, 4) elseif C.abuttons.position == "left" then - pfUI.addonbuttons:SetWidth(ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing)) - pfUI.addonbuttons:SetHeight(pfUI.minimap:GetHeight()) + pfUI.addonbuttons:SetSize(dynamicSize, mbtnHeight) pfUI.addonbuttons:SetPoint("TOPRIGHT", pfUI.minimap, "TOPLEFT", -default_border * 3, 0) SkinArrowButton(pfUI.addonbuttons.minimapbutton, "left") pfUI.addonbuttons.minimapbutton:SetPoint("LEFT", pfUI.minimap, "LEFT", 4, 0) elseif C.abuttons.position == "top" then - pfUI.addonbuttons:SetWidth(pfUI.minimap:GetWidth()) - pfUI.addonbuttons:SetHeight(ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing)) + pfUI.addonbuttons:SetSize(mbtnWidth, dynamicSize) pfUI.addonbuttons:SetPoint("BOTTOM", pfUI.minimap, "TOP", 0 , default_border * 3) SkinArrowButton(pfUI.addonbuttons.minimapbutton, "up") pfUI.addonbuttons.minimapbutton:SetPoint("TOP", pfUI.minimap, "TOP", 0, -4) elseif C.abuttons.position == "right" then - pfUI.addonbuttons:SetWidth(ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing)) - pfUI.addonbuttons:SetHeight(pfUI.minimap:GetHeight()) + pfUI.addonbuttons:SetSize(dynamicSize, mbtnHeight) pfUI.addonbuttons:SetPoint("TOPLEFT", pfUI.minimap, "TOPRIGHT", default_border * 3, 0) SkinArrowButton(pfUI.addonbuttons.minimapbutton, "right") pfUI.addonbuttons.minimapbutton:SetPoint("RIGHT", pfUI.minimap, "RIGHT", -4, 0) @@ -256,8 +249,7 @@ pfUI:RegisterModule("addonbuttons", function () frame:SetClampedToScreen(frame.backup.is_clamped_to_screen) frame:SetMovable(frame.backup.is_movable) frame:SetScale(frame.backup.scale) - frame:SetHeight(frame.backup.size[1]) - frame:SetWidth(frame.backup.size[2]) + frame:SetSize(frame.backup.size[2], frame.backup.size[1]) frame:ClearAllPoints() frame:SetPoint(frame.backup.point[1], frame.backup.point[2], frame.backup.point[3], frame.backup.point[4], frame.backup.point[5]) if frame.backup.on_drag_start ~= nil then diff --git a/modules/addons.lua b/modules/addons.lua index d0793870..2ee4f967 100644 --- a/modules/addons.lua +++ b/modules/addons.lua @@ -18,8 +18,7 @@ pfUI:RegisterModule("addons", function () -- addon window pfUI.addons = CreateFrame("Frame", "pfAddons", UIParent) pfUI.addons:SetFrameStrata("DIALOG") - pfUI.addons:SetHeight(490) - pfUI.addons:SetWidth(380) + pfUI.addons:SetSize(380, 490) pfUI.addons:SetPoint("CENTER", 0,0) pfUI.addons:EnableMouseWheel(1) pfUI.addons:SetMovable(true) @@ -51,8 +50,7 @@ pfUI:RegisterModule("addons", function () pfUI.addons.close = CreateFrame("Button", "pfBagClose", pfUI.addons) pfUI.addons.close:SetPoint("TOPRIGHT", -border*2,-border*2 ) CreateBackdrop(pfUI.addons.close) - pfUI.addons.close:SetHeight(15) - pfUI.addons.close:SetWidth(15) + pfUI.addons.close:SetSize(15, 15) pfUI.addons.close.texture = pfUI.addons.close:CreateTexture("pfBagClose") pfUI.addons.close.texture:SetTexture(pfUI.media["img:close"]) pfUI.addons.close.texture:ClearAllPoints() @@ -125,8 +123,7 @@ pfUI:RegisterModule("addons", function () end) pfUI.addons.profile:SetPoint("TOP", pfUI.addons, "TOP", 0, -30) - pfUI.addons.profile:SetHeight(30) - pfUI.addons.profile:SetWidth(370) + pfUI.addons.profile:SetSize(370, 30) CreateBackdrop(pfUI.addons.profile, nil, true) -- addon profile: title @@ -139,8 +136,7 @@ pfUI:RegisterModule("addons", function () -- addon profile: delete pfUI.addons.profile.del = CreateFrame("Button", nil, pfUI.addons.profile, "UIPanelButtonTemplate") SkinButton(pfUI.addons.profile.del) - pfUI.addons.profile.del:SetWidth(16) - pfUI.addons.profile.del:SetHeight(16) + pfUI.addons.profile.del:SetSize(16, 16) pfUI.addons.profile.del:SetPoint("RIGHT", -10, 0) pfUI.addons.profile.del:GetFontString():SetPoint("CENTER", 1, 0) pfUI.addons.profile.del:SetText("-") @@ -157,8 +153,7 @@ pfUI:RegisterModule("addons", function () -- addon profile: create pfUI.addons.profile.add = CreateFrame("Button", nil, pfUI.addons.profile, "UIPanelButtonTemplate") SkinButton(pfUI.addons.profile.add) - pfUI.addons.profile.add:SetWidth(16) - pfUI.addons.profile.add:SetHeight(16) + pfUI.addons.profile.add:SetSize(16, 16) pfUI.addons.profile.add:SetPoint("RIGHT", pfUI.addons.profile.del, "LEFT", -4, 0) pfUI.addons.profile.add:GetFontString():SetPoint("CENTER", 1, 0) pfUI.addons.profile.add:SetText("+") @@ -201,8 +196,7 @@ pfUI:RegisterModule("addons", function () -- addon list: scroll frame pfUI.addons.scroll = CreateScrollFrame("pfAddonListScroll", pfUI.addons) - pfUI.addons.scroll:SetWidth(360) - pfUI.addons.scroll:SetHeight(410) + pfUI.addons.scroll:SetSize(360, 410) pfUI.addons.scroll:SetPoint("BOTTOM", 0, 10) pfUI.addons.scroll.backdrop = CreateFrame("Frame", nil, pfUI.addons.scroll) @@ -292,8 +286,7 @@ pfUI:RegisterModule("addons", function () frame.adeps = { GetAddOnDependencies(i) } -- required (.toc Dependencies) frame.aoptdeps = { C_AddOns.GetAddOnOptionalDependencies(i) } -- optional (.toc OptionalDeps) - frame:SetWidth(340) - frame:SetHeight(25) + frame:SetSize(340, 25) frame:SetPoint("TOPLEFT", 5, i * -25 + 20) frame:SetBackdrop(pfUI.backdrop_hover) diff --git a/modules/afkcam.lua b/modules/afkcam.lua index e2668023..10422a8a 100644 --- a/modules/afkcam.lua +++ b/modules/afkcam.lua @@ -48,8 +48,7 @@ pfUI:RegisterModule("afkcam", function () local chat = CreateFrame("ScrollingMessageFrame", "pfAFKCamChat", overlay) chat:EnableMouse(false) chat:EnableMouseWheel(true) - chat:SetHeight(150) - chat:SetWidth(500) + chat:SetSize(500, 150) chat:SetPoint("BOTTOMLEFT",overlay,"BOTTOMLEFT", 10, 10) chat:SetTimeVisible(1800.0) chat:SetMaxLines(500) diff --git a/modules/autovendor.lua b/modules/autovendor.lua index 68dcccc6..209e73e7 100644 --- a/modules/autovendor.lua +++ b/modules/autovendor.lua @@ -56,8 +56,7 @@ pfUI:RegisterModule("autovendor", function () -- Setup Autosell button autovendor.button = CreateFrame("Button", "pfMerchantAutoVendorButton", MerchantFrame) - autovendor.button:SetWidth(36) - autovendor.button:SetHeight(36) + autovendor.button:SetSize(36, 36) autovendor.button.icon = autovendor.button:CreateTexture("ARTWORK") autovendor.button.icon:SetTexture("Interface\\Icons\\Spell_Shadow_SacrificialShield") autovendor.button:SetScript("OnEnter", function() diff --git a/modules/bags.lua b/modules/bags.lua index f4c537ca..91dbbec9 100644 --- a/modules/bags.lua +++ b/modules/bags.lua @@ -326,8 +326,7 @@ pfUI:RegisterModule("bags", function () default_border + x*(frame.button_size+default_border*3), -default_border*2 - y*(frame.button_size+default_border*3) - topspace) - pfUI.bags[bag].slots[slot].frame:SetHeight(frame.button_size) - pfUI.bags[bag].slots[slot].frame:SetWidth(frame.button_size) + pfUI.bags[bag].slots[slot].frame:SetSize(frame.button_size, frame.button_size) if x >= rowlength - 1 then y = y + 1 @@ -545,8 +544,7 @@ pfUI:RegisterModule("bags", function () local width = (frame.button_size/5*4 + default_border*2) * (max-min+1+extra) local height = default_border + (frame.button_size/5*4 + default_border) - frame.bagslots:SetWidth(width) - frame.bagslots:SetHeight(height) + frame.bagslots:SetSize(width, height) for slot=min, max do if not frame.bagslots.slots[slot] then frame.bagslots.slots[slot] = {} @@ -606,8 +604,7 @@ pfUI:RegisterModule("bags", function () frame.bagslots.slots[slot].frame:ClearAllPoints() frame.bagslots.slots[slot].frame:SetPoint("TOPLEFT", frame.bagslots, "TOPLEFT", left, top) - frame.bagslots.slots[slot].frame:SetHeight(frame.button_size/5*4) - frame.bagslots.slots[slot].frame:SetWidth(frame.button_size/5*4) + frame.bagslots.slots[slot].frame:SetSize(frame.button_size/5*4, frame.button_size/5*4) CreateBackdrop(frame.bagslots.slots[slot].frame, default_border) frame.bagslots.slots[slot].frame:Show() @@ -626,8 +623,7 @@ pfUI:RegisterModule("bags", function () end frame.bagslots.buy:SetPoint("RIGHT", frame.bagslots, "RIGHT", -default_border, 0) CreateBackdrop(frame.bagslots.buy, default_border) - frame.bagslots.buy:SetHeight(frame.button_size/5*4) - frame.bagslots.buy:SetWidth(frame.button_size/5*4) + frame.bagslots.buy:SetSize(frame.button_size/5*4, frame.button_size/5*4) frame.bagslots.buy:SetText("+") frame.bagslots.buy:SetTextColor(.5,.5,1,1) frame.bagslots.buy:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") @@ -719,8 +715,7 @@ pfUI:RegisterModule("bags", function () frame.close = CreateFrame("Button", "pfBagClose", frame) frame.close:SetPoint("TOPRIGHT", -default_border*1,-default_border ) CreateBackdrop(frame.close, default_border) - frame.close:SetHeight(12) - frame.close:SetWidth(12) + frame.close:SetSize(12, 12) frame.close.texture = frame.close:CreateTexture("pfBagClose") frame.close.texture:SetTexture(pfUI.media["img:close"]) frame.close.texture:ClearAllPoints() @@ -745,8 +740,7 @@ pfUI:RegisterModule("bags", function () frame.bags = CreateFrame("Button", "pfBagSlotShow", frame) frame.bags:SetPoint("TOPRIGHT", frame.close, "TOPLEFT", -default_border*3, 0) CreateBackdrop(frame.bags, default_border) - frame.bags:SetHeight(12) - frame.bags:SetWidth(12) + frame.bags:SetSize(12, 12) frame.bags:SetTextColor(1,1,.25,1) frame.bags:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") frame.bags.texture = frame.bags:CreateTexture("pfBagArrowUp") @@ -786,8 +780,7 @@ pfUI:RegisterModule("bags", function () frame.open = CreateFrame("Button", "pfBagSlotOpen", frame) frame.open:SetPoint("TOPRIGHT", frame.bags, "TOPLEFT", -default_border*3, 0) CreateBackdrop(frame.open, default_border) - frame.open:SetHeight(12) - frame.open:SetWidth(12) + frame.open:SetSize(12, 12) frame.open:SetTextColor(1,1,.25,1) frame.open:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") frame.open.texture = frame.open:CreateTexture("pfBagOpenContainer") @@ -845,8 +838,7 @@ pfUI:RegisterModule("bags", function () frame.disenchant = CreateFrame("Button", "pfBagSlotDisenchant", frame) frame.disenchant:SetPoint("TOPRIGHT", frame.open, "TOPLEFT", -default_border*3, 0) CreateBackdrop(frame.disenchant, default_border) - frame.disenchant:SetHeight(12) - frame.disenchant:SetWidth(12) + frame.disenchant:SetSize(12, 12) frame.disenchant:SetTextColor(1,1,.25,1) frame.disenchant:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") frame.disenchant.texture = frame.disenchant:CreateTexture("pfBagDisenchant") @@ -888,8 +880,7 @@ pfUI:RegisterModule("bags", function () frame.picklock = CreateFrame("Button", "pfBagSlotPicklock", frame) frame.picklock:SetPoint("TOPRIGHT", frame.disenchant, "TOPLEFT", -default_border*3, 0) CreateBackdrop(frame.picklock, default_border) - frame.picklock:SetHeight(12) - frame.picklock:SetWidth(12) + frame.picklock:SetSize(12, 12) frame.picklock:SetTextColor(1,1,.25,1) frame.picklock:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") frame.picklock.texture = frame.picklock:CreateTexture("pfBagPicklock") @@ -931,8 +922,7 @@ pfUI:RegisterModule("bags", function () frame.keys = CreateFrame("Button", "pfBagSlotShow", frame) frame.keys:SetPoint("TOPRIGHT", frame.picklock, "TOPLEFT", -default_border*3, 0) CreateBackdrop(frame.keys, default_border) - frame.keys:SetHeight(12) - frame.keys:SetWidth(12) + frame.keys:SetSize(12, 12) frame.keys:SetTextColor(1,1,.25,1) frame.keys:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") frame.keys.texture = frame.keys:CreateTexture("pfBagArrowUp") @@ -974,8 +964,7 @@ pfUI:RegisterModule("bags", function () frame.sort = CreateFrame("Button", "pfBagSort", frame) frame.sort:SetPoint("TOPRIGHT", frame.keys, "TOPLEFT", -default_border*3, 0) CreateBackdrop(frame.sort, default_border) - frame.sort:SetHeight(12) - frame.sort:SetWidth(12) + frame.sort:SetSize(12, 12) frame.sort.texture = frame.sort:CreateTexture("pfBagSortIcon") frame.sort.texture:SetTexture(pfUI.media["img:sort"]) frame.sort.texture:ClearAllPoints() @@ -1008,8 +997,7 @@ pfUI:RegisterModule("bags", function () if not frame.gold and (C.appearance.bags.movable == "1" or not pfUI.panel) then frame.gold = CreateFrame("Frame", "pfBagGoldString", frame) frame.gold:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -4, 1) - frame.gold:SetWidth(200) - frame.gold:SetHeight(18) + frame.gold:SetSize(200, 18) frame.gold:RegisterEvent("PLAYER_ENTERING_WORLD") frame.gold:RegisterEvent("PLAYER_MONEY") frame.gold:SetScript("OnEvent", function() @@ -1145,8 +1133,7 @@ pfUI:RegisterModule("bags", function () frame.close = CreateFrame("Button", "pfBagClose", frame) frame.close:SetPoint("TOPRIGHT", -default_border*1,-default_border ) CreateBackdrop(frame.close, default_border) - frame.close:SetHeight(12) - frame.close:SetWidth(12) + frame.close:SetSize(12, 12) frame.close.texture = frame.close:CreateTexture("pfBagClose") frame.close.texture:SetTexture(pfUI.media["img:close"]) frame.close.texture:ClearAllPoints() @@ -1171,8 +1158,7 @@ pfUI:RegisterModule("bags", function () frame.bags = CreateFrame("Button", "pfBagSlotShow", frame) frame.bags:SetPoint("TOPRIGHT", frame.close, "TOPLEFT", -default_border*3, 0) CreateBackdrop(frame.bags, default_border) - frame.bags:SetHeight(12) - frame.bags:SetWidth(12) + frame.bags:SetSize(12, 12) frame.bags:SetTextColor(1,1,.25,1) frame.bags:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") frame.bags.texture = frame.bags:CreateTexture("pfBagArrowUp") diff --git a/modules/bgscore.lua b/modules/bgscore.lua index 23cffdcf..26e425a1 100644 --- a/modules/bgscore.lua +++ b/modules/bgscore.lua @@ -2,14 +2,12 @@ pfUI:RegisterModule("bgscore", function () local bgframe = WorldStateAlwaysUpFrame if not bgframe then bgframe = CreateFrame("Frame", "WorldStateAlwaysUpFrame", UIParent) - bgframe:SetWidth(200) - bgframe:SetHeight(25) + bgframe:SetSize(200, 25) bgframe:SetPoint("TOP", UIParent, "TOP", 0, -100) end local mover = CreateFrame("Frame", "pfUIBGScoreMover", UIParent) - mover:SetWidth(220) - mover:SetHeight(30) + mover:SetSize(220, 30) mover:SetPoint("TOP", UIParent, "TOP", 0, -100) mover:SetFrameStrata("DIALOG") mover:SetMovable(true) diff --git a/modules/buff.lua b/modules/buff.lua index a361447d..cf5a8092 100644 --- a/modules/buff.lua +++ b/modules/buff.lua @@ -277,28 +277,27 @@ pfUI:RegisterModule("buff", function () -- config loading function pfUI.buff:UpdateConfigBuffButton(buff) local fontsize = C.buffs.fontsize == "-1" and C.global.font_size or C.buffs.fontsize + local buffSize, buffSpacing = tonumber(C.buffs.size), tonumber(C.buffs.spacing) local rowcount, relFrame, offsetX, offsetY if buff.btype == "HELPFUL" then if buff.weapon == 1 and C.buffs.separateweapons == "1" then rowcount = floor((buff.gid-1) / tonumber(C.buffs.wepbuffrowsize)) relFrame = pfUI.buff.wepbuffs - offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.wepbuffrowsize))*(tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)) - offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)) + offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.wepbuffrowsize))*(buffSize+2*buffSpacing) + offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing) else rowcount = floor((buff.gid-1) / tonumber(C.buffs.buffrowsize)) relFrame = pfUI.buff.buffs - offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.buffrowsize))*(tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)) - offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)) + offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.buffrowsize))*(buffSize+2*buffSpacing) + offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing) end else rowcount = floor((buff.gid-1) / tonumber(C.buffs.debuffrowsize)) relFrame = pfUI.buff.debuffs - offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.debuffrowsize))*(tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)) - offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing)) + offsetX = -(buff.gid-1-rowcount*tonumber(C.buffs.debuffrowsize))*(buffSize+2*buffSpacing) + offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing) end - - buff:SetWidth(tonumber(C.buffs.size)) - buff:SetHeight(tonumber(C.buffs.size)) + buff:SetSize(buffSize, buffSize) buff:ClearAllPoints() buff:SetPoint("TOPRIGHT", relFrame, "TOPRIGHT",offsetX, offsetY) @@ -318,20 +317,26 @@ pfUI:RegisterModule("buff", function () function pfUI.buff:UpdateConfig() local fontsize = C.buffs.fontsize == "-1" and C.global.font_size or C.buffs.fontsize - pfUI.buff.buffs:SetWidth(tonumber(C.buffs.buffrowsize) * (tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))) - pfUI.buff.buffs:SetHeight(ceil(32/tonumber(C.buffs.buffrowsize)) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))) - pfUI.buff.buffs:SetPoint("TOPRIGHT", pfUI.minimap or UIParent, "TOPLEFT", -4*tonumber(C.buffs.spacing), 0) + local spacing = tonumber(C.buffs.spacing) + local cell = tonumber(C.buffs.size) + 2 * spacing + local rowextra = C.buffs.textinside == "1" and 0 or (fontsize * 1.5) + + local function SizeBuffFrame(frame, rowsize, count) + rowsize = tonumber(rowsize) + frame:SetSize(rowsize * cell, ceil(count / rowsize) * (rowextra + cell)) + end + + SizeBuffFrame(pfUI.buff.buffs, C.buffs.buffrowsize, 32) + pfUI.buff.buffs:SetPoint("TOPRIGHT", pfUI.minimap or UIParent, "TOPLEFT", -4 * spacing, 0) UpdateMovable(pfUI.buff.buffs) - pfUI.buff.debuffs:SetWidth(tonumber(C.buffs.debuffrowsize) * (tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))) - pfUI.buff.debuffs:SetHeight(ceil(16/tonumber(C.buffs.debuffrowsize)) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))) + SizeBuffFrame(pfUI.buff.debuffs, C.buffs.debuffrowsize, 16) pfUI.buff.debuffs:SetPoint("TOPRIGHT", pfUI.buff.buffs, "BOTTOMRIGHT", 0, 0) UpdateMovable(pfUI.buff.debuffs) if C.buffs.separateweapons == "1" then pfUI.buff.wepbuffs:ClearAllPoints() - pfUI.buff.wepbuffs:SetWidth(tonumber(C.buffs.wepbuffrowsize) * (tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))) - pfUI.buff.wepbuffs:SetHeight(ceil(2/tonumber(C.buffs.wepbuffrowsize)) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+tonumber(C.buffs.size)+2*tonumber(C.buffs.spacing))) + SizeBuffFrame(pfUI.buff.wepbuffs, C.buffs.wepbuffrowsize, 2) pfUI.buff.wepbuffs:SetPoint("TOPRIGHT", pfUI.buff.debuffs, "BOTTOMRIGHT", 0, 0) pfUI.buff.wepbuffs:Show() UpdateMovable(pfUI.buff.wepbuffs) diff --git a/modules/buffwatch.lua b/modules/buffwatch.lua index e353cd07..d22523a4 100644 --- a/modules/buffwatch.lua +++ b/modules/buffwatch.lua @@ -162,8 +162,7 @@ pfUI:RegisterModule("buffwatch", function () local color = parent.color local bordercolor = parent.bordercolor local textcolor = parent.textcolor - local width = parent:GetWidth() - local height = parent:GetHeight() + local width, height = parent:GetSize() local framename = "pf" .. parent.unit .. ( parent.type == "HARMFUL" and "Debuff" or "Buff" ) .. "Bar" .. bar local font = parent.config.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default @@ -172,8 +171,7 @@ pfUI:RegisterModule("buffwatch", function () frame:EnableMouse(1) frame:Hide() frame:SetPoint("BOTTOM", 0, (bar-1)*(height+2*border+1)) - frame:SetWidth(width) - frame:SetHeight(height) + frame:SetSize(width, height) frame.bar = CreateFrame("StatusBar", "pfBuffBar" .. bar, frame) frame.bar:SetPoint("TOPLEFT", frame, "TOPLEFT", height+1, 0) @@ -202,8 +200,7 @@ pfUI:RegisterModule("buffwatch", function () frame.time:SetJustifyH("RIGHT") frame.icon = frame:CreateTexture(nil, "OVERLAY") - frame.icon:SetWidth(height) - frame.icon:SetHeight(height) + frame.icon:SetSize(height, height) frame.icon:SetPoint("LEFT", frame, "LEFT", 0, 0) frame.icon:SetTexCoord(.07,.93,.07,.93) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 18152f12..374cc850 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -1546,8 +1546,7 @@ nameplates:RegisterEvent("SPELL_FAILED_OTHER") nameplate.health.zoomTransition = true else if nameplate.health.zoomTransition then - nameplate.health:SetWidth(wc) - nameplate.health:SetHeight(hc) + nameplate.health:SetSize(wc, hc) nameplate.health.zoomTransition = nil end nameplate.health.zoomed = true